How To: Mac OS X and Midnight Commander “Insert” Key fix

After moving from Linux (Ubuntu) to OS X, one of the most annoying things i’ve ran into, was not having the Insert Key work as it was intended inside Midnight Commander. In Linux, while in mc, you can hit the Ins key to select or tag an individual file or folder. This is very useful when you want to cleanup and folder or move/copy stuff around. While there is the Ctrl + T shortcut (i’ve found that via:, it’s pretty annoying to use it when the muscle memory keeps going to the Ins key.

I was using BetterTouchTool to get the back/forward mouse buttons working on Yosemite, so i’ve looked around if i can setup a keyboard shortcut. And you can: I’ve setup under “Keyboard” options, an entry for iTerm (my Terminal app of choice on the mac), if the Ins key is pressed to trigger the Ctrl + T shortcut. Works like a charm in mc :)
Screen Shot 2015-01-27 at 5.41.10 PM

How to: Create a new wine prefix or bottle

When running Windows apps under Linux via wine, it’s always a good idea to have each app in it’s own sandbox or wine bottle if you will. After you get an app running with wine, you can store the bottle and grab it from the cellar when you need it.

A wine bottle, is similar to a clean windows install. When creating it, you can specify if the architecture should be 32 or 64bit, which basically emulates a 32 or 64bit machine with windows. You can also keep for each bottle individual settings via winecfg.

Here is how you can create one:

winearch=win32 WINEPREFIX="/opt/cellar/civ5" winecfg

This will create a clean 32bit wine prefix, stores everything in the “/opt/cellar/civ5″ folder and opens the winecfg app for that prefix. Note that in order to use that prefix, you must always make sure you specify it:

winearch=win32 WINEPREFIX="/opt/cellar/civ5" wine notepad

I keep all my wine bottles on an external HDD mounted under /opt/cellar. As long as the correct wine version is installed on each machine for that bottle, i can take the HDD and use the apps on any Linux machine.

How To: Delete ALL older kernels

If you are using Ubuntu, there is a good chance you get kernel upgrades once in a while. There is no reason, after you’ve booted the new kernel and verified that everything is working properly, why you should not delete all older kernels. This will free up a bit of that root partition. If you are like me and mount / on a small SSD partition, every MB counts. For me the modules for each kernel version are around 160MB.

Here is a CLI one-liner to delete all order kernels, leaving only the latest on the system:

sudo apt-get remove --purge $(dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d')

Fix VMware Workstation Module compile error on Ubuntu/Debian Linux

# Become root
sudo -i

# Do a couple of pre-requisites
apt-get install build-essential
ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h

# Extract each of the VMware module packages

cd /usr/lib/vmware/modules/source
for file in *
tar xvf $file

# Fetch and apply patches required for this release...
patch -p0 < vmci.linux-3-8.patch

# Put the VMware module source packages back together again
for file in *-only
tar cvf `basename $file -only`.tar $file
rm -rf *-only

# Tell VMware to rebuild the modules - can also just run the command "vmware" as root
vmware-modconfig --console --install-all

Real time folder monitoring in CLI Linux

I needed to see the changes to a folder in realtime and after a bit of looking around, i’ve found this solution:

 watch -d -n 1 'df; echo " "; echo "Local folder updates:"; ls -FIAt;'

If you want to refresh at longer intervals (not 1s as it is now) all you have to do is change the value of the -n parameter as so:

 watch -d -n 10 'df; echo " "; echo "Local folder updates:"; ls -FIAt;'

This will show you the changes to the current folder every 10s.