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
#!/bin/bash | |
#one hour (in seconds) | |
wait=$((60 * 60)) | |
while true | |
do | |
dns=$(dig andykais.com +nostats +nocomments +nocmd) | |
if [[ $dns == *"github"* ]] | |
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
#!/bin/sh | |
FORMAT=$(echo -e "\033[1;33m%w%f\033[0m written at $(date +'%r')") | |
"$@" | |
while inotifywait -qre close_write --format "$FORMAT" . | |
do | |
"$@" | |
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
#!/bin/bash | |
xdotool search --name firefox key --window %@ F5 |
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
#!/bin/bash | |
# the current version of chrome in linux requires focus on the window for xdotool | |
#this is a workaround to focus back to the editor after reloading the page | |
editor=`xdotool getwindowfocus` | |
xdotool search --onlyvisible --class "Chrome" windowfocus key 'ctrl+r' | |
xdotool windowfocus $editor |
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
#!/bin/bash | |
i="0" | |
FILE="/home/andrew/Pictures/screenshots/screenshot($i).png" | |
while [ -f $FILE ]; | |
do | |
i=$[$i+1] | |
FILE="/home/andrew/Pictures/screenshots/screenshot($i).png" | |
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
ranger() { | |
tempfile='/tmp/chosendir' | |
/usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}" | |
test -f "$tempfile" && | |
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then | |
cd -- "$(cat "$tempfile")" | |
fi | |
rm -f -- "$tempfile" | |
} |
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
#!/bin/bash | |
sudo blkid | grep sda | while read -r line | |
do | |
USB=$(echo $line | perl -pe 's/\:(.*)//') | |
TYPE=$(echo $line | perl -pe 's/(.*)TYPE=// and s/"//g') | |
DIR=$(echo $line | perl -pe 's/(.*)\/// and s/\:(.*)//') |
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
PS1='$(if [ $? -eq 0 ]; then echo "\[\033[32m\]:)"; else echo "\[\033[31m\]:("; fi) ${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u : \[\033[01;34m\]$(echo $(pwd) | grep -o "/" | wc -l)/$(basename $(pwd))\[\033[00m\] - ' |
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
syntax enable | |
set background=dark | |
colorscheme solarized | |
if $COLORTERM == 'gnome-terminal' | |
set t_Co=256 | |
endif |
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
#!/bin/bash | |
xrandr -q | grep 'connected' | awk '{print $1}' | while read line | |
do | |
if [ "$line" != "LVDS1" ] | |
then | |
xrandr --output $line --left-of LVDS1 --auto | |
fi | |
OlderNewer