Categories / System Administration
Use git-crypt to Store Secrets in Git

git-crypt (github) keeps your secrets safe in a git repository. It decrypts on checkout and encrypts at commit using standard git hooks. Once configured, it is completely transparent.

I had a situation where the secrets were already in the repo and I needed to encrypt them (if you’re in this situation, you should also change your secrets because git log -p).

To encrypt files (foo.conf, bar.conf) already in the repo:

2014-07-15    
Duplicate an SD Card in OS X

I made these notes as a result of my experimentation with a Raspberry Pi. I kept messing up the software on the SD card and needed to start over, but it took a long time to go through all of the RPi setup steps. By copying the partitions, I was able to restore relatively quickly.

Get the info of each partition you want to copy on your SD card using diskutil:

2013-04-28    
Miscellaneous System Administration Notes

Some miscellaneous notes I may split out into separate posts later… don’t bookmark this one.

View open network connections on OS X

sudo lsof -lnP +M -i4

The options:

-l      don't convert uids to login
-n      dont' convert network numbers to to hostnames
-P      don't convert port numbers to service names
+M      enable portmapping
-i4     look for IPv4 connections

See also nettop. 3rd party apps include Little Snitch and RubberNet.

2012-08-15    
yum notes

Some notes I kept when I was learning how to use yum.

Installing a package that has been excluded

The file /etc/yum.conf may contain an ’excludes’ line that will disallow updates of any of packages listed. To bypass this, you can comment out those packages in /etc/yum.conf, or you can one-off it like this:

yum --disableexcludes all install gcc

Finding which repo has the file you need

yum provides '*apxs*'

You may need to add ‘–disableexcludes all’ too.

2012-03-13    
iptables notes

Here are some notes I keep for myself when I play with iptables (I don’t use it often enough to remember how it works):

List all rules

# iptables -L

See the rules and their numbers

# service iptables status

Delete a rule

# iptables -D CHAIN NUM

E.g.:

# iptables -D INPUT 12

Add a new rule at the bottom of the chain

# iptables -A INPUT -i eth0 -p tcp --dport 8888 -j ACCEPT

Insert a new rule in a particular place

This inserts a rule in position 6; the rule that was formerly in 6th position will be bumped down (and all rules below it):

2012-03-09