Skip to content

Instantly share code, notes, and snippets.

View mredar's full-sized avatar

Mark Redar mredar

  • CDL
  • Oakland, CA
View GitHub Profile
ps -fA|grep ssh|awk '{print $2}'|xargs -I {} kill {}
@mredar
mredar / find_replace_sed
Created May 3, 2017 17:49
Find and replace text in multiple files from linux CLI
grep -rli 'old-word' * | xargs -i@ sed -i 's/old-word/new-word/g' @
@mredar
mredar / AWS_meta-data
Created June 20, 2017 18:07
AWS instance meta-data
curl http://169.254.169.254/latest/meta-data/
curl http://169.254.169.254/latest/meta-data/local-ipv4
@mredar
mredar / show.bash
Created July 5, 2017 21:51
show command bash - will check aliases, functions and commands
function show
{
# Show the definition of the verb given in $1 e.g. `show ll` (alias) or
# `show show` (function) or `show who` (command).
verb=$1
alias $1 2>/dev/null \
|| declare -f $1 2>/dev/null \
|| /usr/bin/which $1 2>/dev/null \
|| echo "Unrecognized command '$1'"
import readline
readline.write_history_file('my_history.py')
@mredar
mredar / error_fixes.md
Created August 29, 2017 17:09
Error messages and fixes

boto

  • AttributeError: 'BlockDeviceType' object has no attribute 'encrypted' - upgrade to >=2.3.0