Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
NapoleonWils0n / ipaddress_wan.sh
Created Nov 11, 2012
macosx: get wan ip address
View ipaddress_wan.sh
#!/bin/sh
#----------------------------------------------------------------------------------------#
# Get remote ipv4 address #
#----------------------------------------------------------------------------------------#
curl -s "http://v4.ipv6-test.com/api/myip.php"
@NapoleonWils0n
NapoleonWils0n / ipaddress_lan.sh
Created Nov 11, 2012
macosx: get lan ip address
View ipaddress_lan.sh
#!/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 Nov 11, 2012
macosx: get ipv6 ip adress
View ipaddress_ipv6.sh
#!/bin/sh
#----------------------------------------------------------------------------------------#
# ipv6 ip address #
#----------------------------------------------------------------------------------------#
curl -s 'http://v6.ipv6-test.com/api/myip.php'
@NapoleonWils0n
NapoleonWils0n / cipher.sh
Created Nov 11, 2012
macosx: cipher encrypt files with ssl
View cipher.sh
#!/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 Nov 11, 2012
git: remove file from being tracked by git
View git_remove_file_from_being_tracked.sh
#!/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 Nov 11, 2012
wget: download urls from a text file
View wget_urls_from_file.sh
#!/bin/sh
# download a list of urls from a text file with wget
wget -i ~/Desktop/urls.txt
View wget_mirror_website.sh
#!/bin/sh
#----------------------------------------------------------------------------------------#
# wget mirror website #
#----------------------------------------------------------------------------------------#
wget -m http://textfiles.com/hacking/INTERNET/
View wget_download_website.sh
#!/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 Nov 11, 2012
wget: directory prefix for downloads
View wget_directory_prefix.sh
#!/bin/sh
# =========================
# = wget directory prefix =
# =========================
# example
# wget --directory-prefix=Downloads http://example.com/video.mov
View wget_check_for_404s.sh
#!/bin/sh
# =======================
# = wget check for 404s =
# =======================
wget get --spider -nd -r <URL>