View permute.py
This file contains 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
#!/usr/bin/env python3 | |
import string | |
import time | |
print('\033c') | |
x = string.ascii_uppercase | |
for a in x: |
View plus1.c
This file contains 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
#!/usr/bin/env python3 | |
def plusone(x): | |
y = x + 1 | |
return(y) | |
print(plusone(1)) |
View gitquick.sh
This file contains 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
#fork "$repo"; | |
git clone "https://github.com/$user/$fork.git"; | |
cd "$fork"; | |
#edit "$file"; | |
git add "$file"; | |
git status; | |
git commit -m "$message"; | |
git push origin master; | |
#pull "$fork" into "$repo" |
View fixbrewpy.sh
This file contains 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
#!/usr/bin/env bash | |
brew uninstall --force --ignore-dependencies python python2 python2.7 python3 python3.6 > /dev/null 2>&1; | |
brew install python@2 python@3 > /dev/null 2>&1; | |
echo; | |
for x in python python2 python3; | |
do | |
which $x; | |
readlink $(which $x); | |
$x --version; | |
echo; |
View unhide4.sh
This file contains 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
#!/usr/bin/env bash | |
if showall=$(defaults read com.apple.finder AppleShowAllFiles) && [[ $showall = TRUE ]]; | |
then defaults write com.apple.finder AppleShowAllFiles FALSE; | |
else defaults write com.apple.finder AppleShowAllFiles TRUE; | |
fi | |
killall Finder | |
#### |
View unhide.sh
This file contains 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
#!/usr/bin/env bash | |
switch="$(defaults read com.apple.finder AppleShowAllFiles)" | |
if [[ "${switch}" = "TRUE" ]]; then | |
defaults write com.apple.finder AppleShowAllFiles FALSE | |
elif [[ "${switch}" = "FALSE" ]]; then | |
defaults write com.apple.finder AppleShowAllFiles TRUE | |
fi |
View unhide2.sh
This file contains 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
#!/usr/bin/env bash | |
switch () | |
{ | |
defaults read com.apple.finder AppleShowAllFiles | |
} | |
switch="$(switch)" | |
if [[ "${switch}" = "TRUE" ]]; then |
View unhide3.sh
This file contains 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
#!/usr/bin/env bash | |
switch () | |
{ | |
defaults read com.apple.finder AppleShowAllFiles | |
} | |
switch="$(switch)" | |
if [[ "${switch}" = "TRUE" ]]; then |
View getopts.sh
This file contains 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
#!/usr/bin/env bash | |
while getopts abc opt | |
do | |
case $opt in | |
a) ...;; | |
b) ...;; | |
c) ...;; | |
esac | |
done |
View pwk_bash.txt
This file contains 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
1.3 - The Bash Environment | |
The GNU Bourne-Again SHell (Bash)4 provides a powerful environment to work in, | |
and a scripting engine that we can make use of to automate procedures using existing | |
Linux tools. Being able to quickly whip up a Bash script to automate a given task is an | |
essential requirement for any security professional. In this module, we will gently | |
introduce you to Bash scripting with a theoretical scenario. | |
1.4 - Intro to Bash Scripting | |
1.4.1 - Practical Bash Usage – Example 1 |
NewerOlder