Skip to content

Instantly share code, notes, and snippets.

View kitchen's full-sized avatar
🚴‍♂️
traveling the world

Jeremy Kitchen kitchen

🚴‍♂️
traveling the world
View GitHub Profile
@kitchen
kitchen / .muttrc
Created August 23, 2012 03:49
muttrc first iteration
# me
set realname = "Jeremy Kitchen"
set from = "[email protected]"
set envelope_from = yes
# work account info
set imap_user="jeremy.kitchen"
set imap_pass="REDACTED"
set folder = imaps://mail.example.com/
@kitchen
kitchen / .muttrc
Created August 11, 2012 07:06
mutt config
set imap_user="[email protected]
set imap_pass="PASSWORDGOESHERE"
set smtp_url=smtps://[email protected]@smtp.gmail.com/
set smtp_pass=$imap_pass
# real name info
set realname="Jeremy Kitchen"
set from="[email protected]"
alternates "[email protected]"
set envelope_from=yes
@kitchen
kitchen / gist:3162029
Created July 23, 2012 05:00
success!
kitchen@river ~
% /usr/local/bin/python
Python 2.7.3 (default, Jul 22 2012, 21:45:32)
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.61)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>>
@kitchen
kitchen / gist:3161865
Created July 23, 2012 03:19
certificate info
% openssl s_client -crlf -connect foilhat.org:443 !8215
CONNECTED(00000003)
depth=1 /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/OU=Domain Control Validated/OU=Provided by New Dream Network, LLC/OU=DreamHost Basic SSL/CN=foilhat.org
i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
1 s:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
@kitchen
kitchen / make-symlinks.sh
Created July 18, 2012 17:27
dotfiles make-symlinks
@kitchen
kitchen / gist:2998174
Created June 26, 2012 19:17
generating strings for php which need to be in quotes
$foo = <%= bar %>

if bar is being passed in as just baz (no quotes) php will complain.
if bar is being passed in as "baz" (with quotes) it will work fine.

if I do something like:

$foo = "<%= bar %>"

bar can be passed in directly without quotes and it will Just Work

r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
126.0 33.0 980.6 49.0 0.0 0.9 0.0 5.4 0 43 c16t3d0
126.0 34.0 1145.6 49.0 0.0 1.6 0.0 10.2 0 69 c16t4d0
119.0 33.0 1155.1 49.0 0.0 1.2 0.0 7.6 0 53 c16t5d0
122.0 33.0 1155.6 48.5 0.0 1.1 0.0 7.1 0 49 c16t6d0
106.0 33.0 1056.1 48.5 0.0 2.2 0.0 16.1 0 73 c16t7d0
106.0 33.0 1011.6 49.0 0.0 1.0 0.0 7.2 0 45 c16t12d0
103.0 33.0 968.1 49.0 0.0 0.8 0.0 6.2 0 41 c16t13d0
103.0 33.0 1191.1 49.0 0.0 1.7 0.0 12.3 0 66 c16t14d0
116.0 33.0 1182.6 49.0 0.0 1.0 0.0 6.9 0 51 c16t15d0
#perl
grep { !($_ % 2) } (1,2,3,4)
#ruby
[1,2,3,4].select{ |x| x.even? }
#python
[x for x in [1,2,3,4] if not x%2]
#or, more norvingly
filter(lambda x: not x%2, [1,2,3,4])