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/sh | |
| # Usage: $0 {hostname} {port} {pathToScriptToExecuteIfPortIsNotAccessibleSayRestartApacheScript} | |
| echo "" | nc $1 $2 && echo $? &>> /dev/null || $3 |
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
| # find partition name for a given filename | |
| findpart() { [ -e "$1" ] && df -P "$1" | awk '/^\/dev/ {print $1}' || echo "$1 not found"; } | |
| # Verbose version of sleep | |
| countdown() | |
| { | |
| secs=$1 | |
| while [ $secs -gt 0 ]; do | |
| echo -ne "$secs\033[0K\r" | |
| sleep 1 |
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
| ~/.bash/aliases/apt | |
| ################## | |
| # APT | |
| ################## | |
| #alias apt-fast='~/scripts/apt-fast.sh' | |
| #alias sagif='sudo apt-fast install -f' | |
| #alias sagi='sudo apt-fast install' | |
| #alias sagur='sudo apt-fast upgrade' | |
| #alias sacs='sudo apt-cache search' |
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 | |
| # Keep retrying some job till it executes successfully | |
| # | |
| # I primarily use this script to download files from servers | |
| # that break the connection after certain minutes. Combining | |
| # this with aria2c makes a really awesome sure-fire way to | |
| # download your files. | |
| # | |
| carryOutJob() |
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/sh | |
| # Block Steam's internet access using iptables | |
| # Script must be run as a user with root (or one that has | |
| # permissions to play with iptables) | |
| # | |
| # | |
| # Why did i need it? Even when running in offline mode | |
| # steam would keep trying to login and then once every | |
| # while it'd end my dota bota match saying "Connection | |
| # Lost". |
NewerOlder