Skip to content

Instantly share code, notes, and snippets.

mike fettis ridingintraffic

Block or report user

Report or block ridingintraffic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ridingintraffic
ridingintraffic / FIRE
Created Dec 23, 2018
in case of fire
View FIRE
function FIRE()
{
find ~/git/github/$(whoami) -maxdepth 1 -mindepth 1 -type d -exec cd {} \; -exec git pull {} \; -exec git add --all {} \; -exec git commit -a -m "firesale" {} \; -exec git push origin `git rev-parse --abbrev-ref HEAD` {} \;
}
View setMeUp.sh
#!/bin/bash
function linkwork()
{
linkTocheck="$1"
sourceLink="$2"
if [ -f "$linkTocheck" ]; then
echo "$linkTocheck is a file - backing it up"
mv "$linkTocheck" "$sourceLink.bak"
fi
if [ ! -h "$linkTocheck" ]; then
View food?
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"
View lazy_function
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
}
View .common_profile_snippet
# 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"
@ridingintraffic
ridingintraffic / hashcat
Last active Dec 10, 2018
luks and hashcat
View hashcat
$ dd if=/dev/urandom of=test bs=1M count=100
$ cryptsetup luksFormat test #use password password
$ cryptsetup luksOpen test tmp
$ xxd -l 512 /dev/mapper/tmp # is random data at this point
$ mkfs.ext4 /dev/mapper/tmp # use the same file system that is used by your system/device
$ xxd -l 512 /dev/mapper/tmp # should no longer be random data
$ cryptsetup luksClose tmp
$ cryptsetup luksDump test | grep "Payload offset" # add 1 to the offset value that comes back
$ dd if=test of=luks-header bs=512 count=4097 # grabs header
$ echo "password" >>list
View ..setup.sh
#!/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
View _sudoers.d
root@discworld:~# cat /etc/sudoers.d/012_twoflower-nopasswd
twoflower discworld=(rincewind) /usr/bin/less /luggage/camera/picture
View _sudoers.d
root@discworld:~# cat /etc/sudoers.d/012_twoflower-nopasswd
twoflower discworld=(rincewind) /usr/bin/vi ""
View output
$ 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
You can’t perform that action at this time.