Skip to content

Instantly share code, notes, and snippets.

general settings

  • turn off key clicks: Progrm + backslash

remap - any platform (press they key you want it to be first, then the key you will press to get that)

  • Tab --> Caps Lock
  • Esc --> Tab
  • Back Space --> Ctrl (left)
  • Delete --> Alt (left)
  • Down Arrow --> ]}
  • [{ --> Down Arrow
#instructions for ubuntu 12.04
sudo apt-get -y update
sudo apt-get install git emacs curl build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev libmysql-ruby libmysqlclient-dev
cd /tmp
#install ruby -- from: http://stackoverflow.com/questions/16222738/how-to-install-ruby-2-0-0-correctly-on-ubuntu-12-04
wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz
tar -xvzf ruby-2.0.0-p353.tar.gz
cd ruby-2.0.0-p353/
./configure --prefix=/usr/local
@eegrok
eegrok / locate.updatedb.comment
Created April 8, 2014 23:40
locate.updatedb on osx as root instead of nobody user -- indexes home directory files
# comment out this region to index as root according to:
# http://apple.stackexchange.com/questions/84532/how-can-i-search-my-entire-drive-for-a-file-without-getting-recursively-stuck-in/84556#84556
# if [ "$(id -u)" = "0" ]; then
# rc=0
# export FCODES=`mktemp -t updatedb`
# chown nobody $FCODES
# tmpdb=`su -fm nobody -c "$0"` || rc=1
# if [ $rc = 0 ]; then
# install -m 0444 -o nobody -g wheel $FCODES /var/db/locate.database
# fi
@eegrok
eegrok / curl-ca-cert-import.txt
Created April 16, 2014 01:04
curl SSL3_GET_SERVER_CERTIFICATE error fix
# I recently got the following error while using curl:
# curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
# error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
openssl s_client -connect www.whateverserver.com:443 |tee logfile
# then QUIT <RETURN>
# copy from BEGIN CERTIFICATE to END CERTIFICATE into /tmp/certstuff.pem
openssl x509 -inform PEM -in /tmp/certstuff.pem -text -out certdata
cat certdata
# in there, I saw this line:
@eegrok
eegrok / cltools.sh
Last active August 29, 2015 14:05 — forked from jellybeansoup/cltools.sh
install command line tools on osx / other libraries as well
#!/bin/sh
##
# Install autoconf, automake, libtool and pkg-config smoothly on Mac OS X.
# Newer versions of these libraries may be available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/src # or wherever you'd like to build
@eegrok
eegrok / mysql-import-individual-table
Created November 22, 2014 05:23
extract individual tables from database dump, for import -- mysql
touch /tmp/empty
ack "Table structure" /path/to/database_backup.sql /tmp/empty
it spits out something like this:
...
56160:-- Table structure for table `sub_human`
56195:-- Table structure for table `fool`
56385:-- Table structure for table `fool_games`
56465:-- Table structure for table `fool_games_old`
56657:-- Table structure for table `fool_games_texts`
@eegrok
eegrok / openvpn-server.conf
Created May 4, 2011 22:21
OpenVPN server config file
dev tun
# customize these ips to not conflict
ifconfig 172.23.0.1 172.23.0.2
# make sure this port UDP is open on the firewall -- 1194 is the default OpenVPN port
#port 2794
secret /etc/openvpn/static.key
#you can uncomment the following line to see a lot of debug info, including traffic
#verb 6
@eegrok
eegrok / openvpn-client.conf
Created May 4, 2011 22:29
OpenVPN client config file
#modify the remote myremote.mydomain to be the server address
remote myremote.mydomain
dev tun
ifconfig 172.23.0.2 172.23.0.1
secret /etc/openvpn/static.key
# uncomment this to keep this connection alive if you need to connect from the server to the client sometimes
# keepalive 10 120
@eegrok
eegrok / save-iptables.inst
Created May 5, 2011 21:59
how to save iptables
#on redhat based linux's
service iptables save
#on debian based linux's
#put the following 2 lines in your /etc/network/interfaces file
post-up iptables-restore < /etc/iptables.rules
post-down iptables-save > /etc/iptables.rules
# it'll then automatically save -- if you want to guard against a possible hard powerdown (power plug pulled, e.g.)
# you can manually save them then using
@eegrok
eegrok / openvpn-rhel5-install.txt
Created May 5, 2011 20:33
Install OpenVPN on RHEL5
#partially from: http://www.throx.net/2008/04/13/openvpn-and-centos-5-installation-and-configuration-guide/
wget http://swupdate.openvpn.net/community/releases/openvpn-2.1.4.tar.gz
wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm
wget http://www.opensc-project.org/files/pkcs11-helper/pkcs11-helper-1.08.tar.bz2
wget ftp://fr2.rpmfind.net/linux/dag/redhat/el5/en/x86_64/dag/RPMS/pkcs11-helper-devel-1.08-1.el5.rf.x86_64.rpm
wget ftp://rpmfind.net/linux/dag/redhat/el5/en/x86_64/dag/RPMS/pkcs11-helper-1.08-1.el5.rf.x86_64.rpm
yum install rpm-build
yum install autoconf.noarch
yum install zlib-devel