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: |
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)) |
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" |
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; |
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 | |
#### |
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 |
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 |
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 |
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 |
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