Automatically Upload Desktop, Documents and Downloads to Dropbox from your Mac

 

If you would like to automatically upload your Desktop, Documents and Downloads automatically to your Dropbox from your Mac, follow this nice little trick:

I will be using the “Documents” folder as an example:

Open Terminal (Spotlight/Terminal)

Change directory to your Dropbox folder (by default it is in the users home directory)

Create the symbolic link from your users Documents folder to Dropbox

(Mine already exists)

Repeat for any other folders you want to back up automatically to Dropbox.

Fix resolution for VMware Fusion Unity

Fix resolution for VMware Fusion Unity

This is for VMware Fusion version 7.1 however it might work *not tested with other versions.

I’m just doing a quick write up about how to fix the annoying resolution problem when running applications in Unity on VMware Fusion. This issue just keeps coming back (after installing VMware Fusion) and I can never remember how to fix it. It’s obvious when you see it but it isn’t when you are in a panic trying to fix it!

Under the virtual machine, click settings

Click on Display

Click on “Use full resolution for Retina display”

VMTools will prompt you to log off

Now go into Unity view and you will now see things without a microscope!

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.

Creating a software RAID on Ubuntu/Debian

Creating a software raid of disks is quite easy in Ubuntu, I will assume the disks are attached (physically or virtually) to the guest operating system.

Currently Ubuntu supports the following raid levels:

  • RAID level 0
  • RAID level 1
  • RAID level 2
  • RAID level 3
  • RAID level 4
  • RAID level 5
  • RAID level 6
  • RAID level 10
  • RAID level 50
  • RAID level 0+1

In this example I am using sdb1 and sdc1 disks and settings the raid to a mirror (1) with a total mirrored size of 4TB (3906885440K)

  • Install mdadm (if not already installed)

  • Run mdadm to create the mirror

  • Run mkfs.ext3 to create a ext3 filesystem on the mirror volume

  • Mount the mirror by creating a mount point and running mount to mount the md0 volume

  • Check to see if you can see the mirror

  • Check the status of the build

  • Add to fstab to auto mount on startup

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.

VMware Creating RDMs from Locally Attached SATA Disks

I recently had to connect two 4TB sata disks to a server to provide some raw storage to the network. Going on past experiences I didn’t want to virtualise the disks but rather present them to the virtual machine guest as a raw device mapping (RDM).

You will need a separate datastore that is separate to the ones you are attaching. It will have to be VMFS5 to get around the 2TB limit with VMFS3.

Note: This is not supported by VMware to the best of my knowledge.

Procedure

  1. Start a SSH session to the VMware ESX host (or if on the physical server, drop to console)
  2. Run fdisk to see the disk layout.

  1. You will need to find the vml identifier, you need to match that to the drive.

In my example, the two I am interested in are:

vml.01000000002020202020202020202020205a33303346325742535434303030

vml.01000000002020202020202020202020205a33303351523246535434303030

  1. Now browse to the VMFS5 datastore you will be creating the RDM’s

  1. Best practise would be to create a folder for the RDM’s to sit in

  1. Create the RDM’s by running the vmkfstools command (use the vml. location that you found in previous steps)

  1. Verify you have the files created

  1. Attach to virtual machine

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.

Limit SSH connections geographically

There is a real security risk to leaving your shell connection ports exposed to the internet especially if you don’t ever intend on connecting from Zimbabwe as well as other random countries.

This can limit brute force attack exposure and also save valuable resources and bandwidth by rejecting a packets before a tcp handshake.

Install GeoIP

You will need to implement a database that can be queried locally that stores IP ranges to countries.

Query GeoIP database

The script

Past the following in:

Enable script

Lock down SSH

Setup a deny all for the ssh daemon

Add the following into the deny file

Enable the script in the allow ssh file

Add the following into the allow file

Testing

Test the script by inputting the script name and then an IP afterwards

Should output something like the following:

Update GeoIP

There is only one constant with the world and that is change, IP addresses are no exception.

Create a new file called update_geo.sh in /scripts

Add the following into the file

Change the script to execute

Edit the crontab

Paste the following at the bottom of the crontab