Monday, June 13, 2016

Resizing a VirtualBox disk image

This should go without saying, but make sure you have a good backup of everything before you do any of this.. If in doubt, just backup the whole VirtualBox folder. You have been warned.

Sunday, May 1, 2016

Configuring Gnome-Shell from the command line

Here's some useful tricks to automate the configuration of the gnome shell

Ubuntu-Gnome 16.04 on Thinkpad x230

This is mostly for myself, but perhaps someone else might get some ideas from it..

Tuesday, April 26, 2016

Edit gnome settings with your favorite editor

Using the vipe command, we can read from stdin, edit the contents in the default editor and send it down the pipe.

Saturday, March 26, 2016

find files from a certain date range in linux

When you need to find a file from a specific range of dates, like a reciept that you know you saved but can't remember where.. You can use the find command along with some parameters to find files newer than a specific date, older or between two dates.

Bash one-liner to fix "Failed to fetch" error for chrome in ubuntu

See this page for details on how an why, but here's the error:

W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release:
    Unable to find expected entry 'main/binary-i386/Packages'
    in Release file (Wrong sources.list entry or malformed file)

And this will fix it in one shot:

sudo sed -i 's?deb http://dl.google.com/linux/chrome/deb/ stable main?deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main?g' /etc/apt/sources.list.d/google-chrome.list

Sunday, March 13, 2016

bash functions to view markdown documents

If you're writing markdown documents from vim or emacs, here's a couple handy ways to view them as rendered HTML.

Saturday, March 12, 2016

Kill an ssh connection from the server side

So you don't like Bob today or maybe you want to test a failed connection.. Whatever your reason you need to kill the ssh connections for his user on your server.

Friday, March 11, 2016

Reverse SSH Forward with special user

We will create a user on our machine that the remote machine can connect as and initiate a reverse port forward. For this example, we'll allow the remote machine to connect with the user name "ssh-limited" and forward port 62222 back to themselves.

Tuesday, January 26, 2016

Make better bash scripts for yourself (and others)

When you write a bash script, there's a few things you can do to make your life (and anyone else who uses it) a lot better. Here's a few of the things that I (try) to do when I write scripts to make it easier to use and less error prone.

Sunday, January 17, 2016

Ditch capslock for escape in xwindows

Run this and your capslock will be changed to the escape key for the current session:
xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'
Taken from this post on the vim wiki