Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
NapoleonWils0n / ipaddress_wan.sh
Created November 11, 2012 22:37
macosx: get wan ip address
#!/bin/sh
#----------------------------------------------------------------------------------------#
# Get remote ipv4 address #
#----------------------------------------------------------------------------------------#
curl -s "http://v4.ipv6-test.com/api/myip.php"
@NapoleonWils0n
NapoleonWils0n / ipaddress_lan.sh
Created November 11, 2012 22:37
macosx: get lan ip address
#!/bin/sh
#----------------------------------------------------------------------------------------#
# Get local ip address for wifi #
#----------------------------------------------------------------------------------------#
ifconfig en0 |grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'
@NapoleonWils0n
NapoleonWils0n / ipaddress_ipv6.sh
Created November 11, 2012 22:36
macosx: get ipv6 ip adress
#!/bin/sh
#----------------------------------------------------------------------------------------#
# ipv6 ip address #
#----------------------------------------------------------------------------------------#
curl -s 'http://v6.ipv6-test.com/api/myip.php'
@NapoleonWils0n
NapoleonWils0n / cipher.sh
Created November 11, 2012 22:33
macosx: cipher encrypt files with ssl
#!/bin/sh
#===================================================================================================================================#
# cipher.sh
# Encypting files on the Mac with Openssl
# Openssl aes-256 encryption with public private keys and a password
# Openssl keys stored in aes-256 encryption dmg
#  dmg and openssl password stored in secondary keychain that isnt unlocked at login
#===================================================================================================================================#
@NapoleonWils0n
NapoleonWils0n / git_remove_file_from_being_tracked.sh
Created November 11, 2012 21:20
git: remove file from being tracked by git
#!/bin/sh
# remove file from being tracked by git , but dont delete it
git rm --cached filename
@NapoleonWils0n
NapoleonWils0n / wget_urls_from_file.sh
Created November 11, 2012 20:30
wget: download urls from a text file
#!/bin/sh
# download a list of urls from a text file with wget
wget -i ~/Desktop/urls.txt
@NapoleonWils0n
NapoleonWils0n / wget_mirror_website.sh
Created November 11, 2012 20:30
wget: mirror website
#!/bin/sh
#----------------------------------------------------------------------------------------#
# wget mirror website #
#----------------------------------------------------------------------------------------#
wget -m http://textfiles.com/hacking/INTERNET/
@NapoleonWils0n
NapoleonWils0n / wget_download_website.sh
Created November 11, 2012 20:29
wget: download website
#!/bin/sh
# =========================
# = wget download website =
# =========================
wget --wait=20 --limit-rate=20K -r -p -U Mozilla http://www.somesite.com/
# quick and dirty
wget -r -p -U Mozilla http://somesite.com
@NapoleonWils0n
NapoleonWils0n / wget_directory_prefix.sh
Created November 11, 2012 20:28
wget: directory prefix for downloads
#!/bin/sh
# =========================
# = wget directory prefix =
# =========================
# example
# wget --directory-prefix=Downloads http://example.com/video.mov
@NapoleonWils0n
NapoleonWils0n / wget_check_for_404s.sh
Created November 11, 2012 20:28
wget: check for 404s
#!/bin/sh
# =======================
# = wget check for 404s =
# =======================
wget get --spider -nd -r <URL>