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
function food() | |
{ | |
arr[0]="Jimmy Johns" | |
arr[1]="Pita Inn" | |
arr[2]="Noodle and company" | |
arr[3]="Potbelly" | |
arr[4]="Chipotle" | |
arr[5]="portillos" | |
arr[6]="Wendy's" | |
arr[7]="Josh's" |
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
function traffic-update() | |
{ | |
currentDir=$(pwd) | |
cd ~/git/github/<someuser>/traffic/ | |
git pull | |
git add --all | |
git co -a -m "autoupdate script" | |
git push origin `git rev-parse --abbrev-ref HEAD` # push to origin/master | |
cd $currentDir | |
} |
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
# loading the system speicfic profiles | |
if [ "Linux" = "$(uname -a | awk '{printf $1}')" ]; then | |
if [ "raspbian" = "$(cat /etc/os-release | grep ^ID= |sed 's/ID=//')" ]; then | |
echo "raspbian" | |
source "$HOME/.rpi_profile" | |
elif [ "ubuntu" = "$(cat /etc/os-release | grep ^ID= |sed 's/ID=//')" ]; then | |
echo "ubuntu" | |
source "$HOME/.ubu_profile" | |
elif [ "centos" = "$(cat /etc/os-release | grep ^ID= |sed 's/ID=//')" ]; then | |
echo "centos" |
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
PI install (scroll down for docker) | |
1. install raspbian lite | |
2. setup ssh | |
3. change hostname | |
4. set static ip on router, see why you changed the hostname now ;) | |
5. $ curl -sSL https://install.pi-hole.net | bash | |
6. follow the prompts and get everything turned on. | |
- set upstream DNS, google 8.8.8.8 or cloudflare 1.1.1.1 | |
- use ipv4, ipv6 comes later | |
- enable the webinterface, we can script later |
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
root@discworld:~# cat /etc/sudoers.d/012_twoflower-nopasswd | |
twoflower discworld=(rincewind) /usr/bin/less /luggage/camera/picture |
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
root@discworld:~# cat /etc/sudoers.d/012_twoflower-nopasswd | |
twoflower discworld=(rincewind) /usr/bin/vi "" | |
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
$ twoflower@discworld:/luggage$ sudo -l | |
Matching Defaults entries for twoflower on discworld: | |
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin | |
User twoflower may run the following commands on discworld: | |
(rincewind) /bin/cat /luggage/camera/* | |
$ twoflower@discworld:/luggage$ sudo -u rincewind cat /luggage/octavo/spell | |
Sorry, user twoflower is not allowed to execute '/bin/cat /luggage/octavo/spell' as rincewind on discworld. | |
$ twoflower@discworld:/luggage$ sudo -u rincewind cat /luggage/camera/../octavo/spell |
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
#/etc/sudoers.d/012-twoflower | |
twoflower discworld=(rincewind) /bin/cat /luggage/camera/* |
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 | |
#..setup.sh . double dots because gist, gets auto sorted (ugh) | |
# Hi im a penguin | |
if [ "Linux" = "$(uname -a | awk '{printf $1}')" ] | |
then | |
# this is handled is submodoules | |
#git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1 | |
#create symlinks |
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 | |
# Hi im a penguin | |
if [ "Linux" = "$(uname -a | awk '{printf $1}')" ] | |
then | |
#create symlinks | |
#root because kali | |
if [ "root" = "$(whoami)" ] | |
then |