Skip to content

Instantly share code, notes, and snippets.

View bcx's full-sized avatar
💭
In the future everything will work.

Bill C bcx

💭
In the future everything will work.
View GitHub Profile
# delete line 5-11 and 12
sed -i.bak -e '5,10d;12d' file
# dumps out a line suitable for use in .ssh/authorized_keys
ssh-keygen -y -f .ssh/foo.pem
# what package owns this file?
dpkg-query -S /bin/bash
@bcx
bcx / example.sql
Created May 28, 2016 04:50
case sensitive queries in mysql
select * from products_golden
where binary id_string != binary lower(id_string);
select * from product_variants
where binary id_string != binary lower(id_string);
@bcx
bcx / gist:65287238c498e81056c63ffc15827062
Created May 27, 2016 03:32
Lookup Elasticache Redis Endpoint
aws elasticache describe-replication-groups | jq -r '.ReplicationGroups[] |
select(.ReplicationGroupId=="redis-prod").NodeGroups[0].PrimaryEndpoint |
.Address,.Port' | paste -sd : -
redis-prod.foobar.zz.0001.usw2.cache.amazonaws.com:6379
@bcx
bcx / box_and_whiskers.R
Last active March 18, 2016 01:36
Box & Whisker Plots from Lists of Numbers
# Each `runN` file is a column of numbers.
# `idx` is set to the length of the shortest run
idx <- 170
r1 <- read.table('run1', colClasses="numeric")$V1[1:idx]
r2 <- read.table('run2', colClasses="numeric")$V1[1:idx]
r3 <- read.table('run3', colClasses="numeric")$V1[1:idx]
df <- data.frame(r1, r2, r3)