Skip to content

Instantly share code, notes, and snippets.

View dreamingbinary's full-sized avatar
💭
I love to build

Charles Le dreamingbinary

💭
I love to build
  • Los Angeles, Earth.
View GitHub Profile
@dreamingbinary
dreamingbinary / Dictionary-Interpolation.py
Last active July 7, 2016 08:43
Python dict-style interpolation
print("Executing on %s as %s" % (env.host, env.user))
# Using dict-style interpolation is more readable and slightly shorter:
print("Executing on %(host)s as %(user)s" % env)
# Reference: http://docs.fabfile.org/en/1.11/usage/env.html
#!/bin/sh
#for i in $(networksetup -listallhardwareports | grep Device | gawk '{print $2}')
for i in $( ifconfig -l )
do
echo "\"$i\" :" \"$(ipconfig getifaddr $i)\"
# grep -e 'en*' -e 'tun*'
done
#!/usr/bin/python
#
# git-slim
#
# Remove big files from git repo history.
#
# Requires GitPython (https://github.com/gitpython-developers/GitPython)
#
# References:
# - http://help.github.com/remove-sensitive-data/