Re-defining a variable composed of dynamic variables

In one of my scripts, I wanted to create a log file that was dynamic based on how the script was running. For example, if the script was doing something like waiting on another script or generated an error for whatever reason, I wanted the log file name to change to reflect that. I started with this. I used the $STATUS as the switch and called a function (setstatus) to change that based on what was passed (by another function or whatever etc.

Continue reading ↦

Reload rtorrent configuration without restart

You might want to get in the habit of doing this so you don’t have to restart rtorrent all the time. Ctrl + x, import=~/.rtorrent.rc If you are only adding a few lines, you can just Ctrl + x and paste/enter them for them to be loaded. Thanks, http://rakshasa.no/pipermail/libtorrent-devel/2008-January/001476.html


I really wanted terminal printing to be in color

Yeah. ccze. is awesome! I really wanted to use it across my systems and with all applicable commands like head, tail, cat, etc.. So I wrote a zsh function to check if the command exists and utilize it. This was kind of a pain because of the corner cases (people using pipes or redirection with the command etc..) Through it all, I created two new commands, catless and tacless. Read some of the comments to find why.

Continue reading ↦

Changing your repos` remote origin

The server I usually use to store my repo is going to go offline soon. So I decided to just move it to bitbucket (love the free private repos:) $ git remote origin So obviously we only have our remote origin. git remote remove origin git remote add origin [email protected]:username/repo.git Then, lets push up our repo and all associated data with it (i.e. your commits) git push -u origin --all # pushes up the repo and its refs for the first time git push -u origin --tags # pushes up any tags And thats it!

Continue reading ↦

Migrating from Maildir to Gmail

delete old emails if necessary, turn off convo view (Settings > General) since this lumps everything together. (note, you can do things like “before:2014/4/29?) Use getmail to pull all emails as mbox or Maildir format from your old email account. I initially did maildir hence why below I convert them to mbox for thunderbird. I configured like this for pulling from our corporate exchange server: [retriever] type = SimpleIMAPSSLRetriever server = exchange.

Continue reading ↦

Dealing with VPN on Linux Mint

Setting up VPN via NetworkManager in Linux Mint was actually really simple. But I kept having issues with DNS. I set up my VPN server to push down itself as the dns server to use and a domain-search domain. The domain search domain from vpn was getting mixed in with the other search domains from the local dhcp server when the connection was on eth0. NetworkManager launches dnsmasq when it starts.

Continue reading ↦

Making your client send all traffic through the VPN

This hack will enable your client machines to basically use the internet entirely through the vpn. On the server add the following to your openvpn config file: push "redirect-gateway def1" push "dhcp-option DNS 192.168.1.1" If your vpn is for example your home gateway, you’ll definitely want to use the gateway address. If your vpn server is on a remote server somewhere and it doesn’t run its own dns server or you don’t have a dns server running on the vpn network, you’ll want to just use a public dns server address such as Google’s 8.

Continue reading ↦

Hardening your SSH private keys

You probably have your ssh private key password protected. However, are you encrypting them with the more secure PKCS#8 standard, or the default that ssh-keygen for some reason still uses? The following articles help explain this whole idea that using PKCS#8 (which is a part of OpenSSL, hence can be used with OpenSSH) is a much stronger format for encrypt your keys with. I recommend you read them in this order:

Continue reading ↦

Decrypting a hard disk on Mac OSX

From apple discussions: (note this relates to time machine as I wanted to decrpyt since I’m moving to linux. Once on linux, this script seems to be necessary) — I too was under the mistaken belief that I would be able to turn off encryption the same place that I turned it on. This cannot be done from within Time Machine (at least not in OS X 10.9) – you need to do it from within the Disk Utility:

Continue reading ↦