This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo killall -HUP mDNSResponder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dscacheutil -flushcache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -o lgllc.tar.gz -b cookies.txt --user-agent "Mozilla/5.0" --user user:pass -k https://[host]:[port]/[filename] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/bin/bash | |
if [ ! -f /tmp/foo.txt ]; then | |
echo "File not found!" | |
fi | |
# for directories: | |
if [ -d "$DIRECTORY" ]; then | |
# Control will enter here if $DIRECTORY exists. | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if exist {insert file name here} ( | |
rem file exists | |
) else ( | |
rem file doesn't exist | |
) | |
# or on a single line (if only a single action needs to occur): | |
if exist {insert file name here} {action} | |
# a quick little example testing for both files and/or directories: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# touch | |
## doesn't work on read-only files | |
type nul >>file & copy file +,, | |
## for read-only files, use the following: | |
:touch | |
if not exist "%~1" type nul >>"%~1"& goto :eof | |
set _ATTRIBUTES=%~a1 | |
if "%~a1"=="%_ATTRIBUTES:r=%" (copy "%~1"+,,) else attrib -r "%~1" & copy "%~1"+,, & attrib +r "%~1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# not an actual script - these are only commands, but the script would be basically the same. | |
# requires jailbroken iOS device | |
# get into the filesystem | |
ssh root:alpine@iphone | |
# update your package list, and install sqlite | |
apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# 1) create function to get current Unix Epoch Time | |
EPOCHTIME () { date -u +%s; } | |
# $ EPOCHTIME | |
# 1378623423 | |
# $ EPOCHTIME | |
# 1378623429 | |
# 2) get Unix Epoch Time at 12am on January 1, 2001, as STATIC variable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
TZ='America/Chicagp' | |
/usr/bin/sqlite3 /var/mobile/Library/SMS/txt.db <<! | |
.mode list | |
.separator | | |
.out txt.dmp | |
SELECT | |
m.rowid as RowID, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dependencies: img2xterm (not available via Homebrew -- you will need to build from source, see below) | |
Rossy's img2xterm project link: https://github.com/rossy/img2xterm | |
Notes: I had to re-install ImageMagick for img2xterm to work properly. | |
Instructions: | |
$ brew update | |
$ brew reinstall imagemagick | |
$ git clone https://github.com/rossy/img2xterm.git | |
$ cd img2xterm && make && make install |