Skip to content

Instantly share code, notes, and snippets.

View epower's full-sized avatar

Eamonn Power epower

View GitHub Profile

Keybase proof

I hereby claim:

  • I am epower on github.
  • I am epower (https://keybase.io/epower) on keybase.
  • I have a public key ASD2eVIop8O3V1kePKuljqxall5K9Q6e8UiezqfwGGOqsQo

To claim this, I am signing this object:

@epower
epower / gist:a1128b646766661e1c4b
Created April 29, 2015 21:10
ubuntu stats gathering
#!/bin/bash
sudo apt-get install python-pip -y
sudo pip install ansible
ansible -m setup all -i localhost, --connection=local >> stats.json
#!/bin/bash
aws ec2 describe-instances --filters "Name=tag:Name, Values=EP_*" --query 'Reservations[].Instances[].[Tags[?Key==`Name`] | [0]. Value, State.Name, InstanceId]' --output table
@epower
epower / ping-test.sh
Created September 10, 2014 14:55
ping test
#!/bin/bash
ping $1 | awk '{ sent=NR-1; received+=/^.*(time=.+ ms).*$/; loss=0; } { if (sent>0) loss=100-((received/sent)*100) } { printf "sent:%d received: %d loss:%d%%\n", sent, received, loss }'

Software for scientists

Some things takes much less time and stress once you know the right tool. Below, there is a community edited list of software for scientists.

Text editors

General purpose text/code editors. It may be better to have a good editor for everything, than different ones for different languages, scripts, notes.

@epower
epower / gist:5110753
Created March 7, 2013 19:01
bash tips
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest. Come back soon for more!
BASH
* In bash, 'ctrl-r' searches your command history as you type
- Add "set -o vi" in your ~/.bashrc to make use the vi keybindings instead
of the Emacs ones. Takes some time to get used to, but it's fantastic!
- Input from the commandline as if it were a file by replacing
'command < file.in' with 'command <<< "some input text"'
- '^' is a sed-like operator to replace chars from last command
@epower
epower / javascript-osx
Created November 2, 2012 14:34
javascript for OSX
from http://webreflection.blogspot.ie/2010/10/javascriptcore-via-terminal.html
sudo ln -F /System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc /usr/bin