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 | |
| # | |
| # While working with webapps I found myself creating the database credentials | |
| # as well as the databases over and over. For me the username to connect to | |
| # database was always same as the database name, almost always. So I created | |
| # the following script to help me quickly setup the credentials | |
| # | |
| # Ways you can use it: | |
| # $0 secret | |
| # In this case database's name, user's name and password |
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 | |
| origBranch=$(git rev-parse --abbrev-ref HEAD) | |
| upstreamBranch="$origBranch" | |
| E_BADARGS=65 | |
| if [ $# -ne 2 -o $# -ne 1 ]; then | |
| echo "Usage: $0 {new_origin} [{upstreamBranch}]" | |
| exit $E_BADARGS | |
| elif [ "x$2" != "x" ]; then | |
| upstreamBranch="$2" |
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 | |
| origBranch=$(git rev-parse --abbrev-ref HEAD) | |
| delBranch="$1" | |
| E_BADARGS=65 | |
| if [ $# -ne 1 ]; then | |
| echo "Usage: $0 {branch_name}" | |
| exit $E_BADARGS | |
| fi |
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 | |
| E_BADARGS=65 | |
| if [ $# -ne 2 ]; then | |
| echo "Usage: $0 {old_branch_name} {new_branch_name}" | |
| exit $E_BADARGS | |
| fi | |
| old_branch="$1" | |
| new_branch="$2" |
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 | |
| # Must run as root. | |
| echo "Stopping firewall and allowing everyone..." | |
| iptables -F | |
| iptables -X | |
| iptables -t nat -F | |
| iptables -t nat -X | |
| iptables -t mangle -F | |
| iptables -t mangle -X | |
| iptables -P INPUT ACCEPT |
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 | |
| E_BADARGS=65 | |
| if [ $# -ne 2 -a $# -ne 1 ] | |
| then | |
| echo "Usage: $0 {processNameWithoutSpaces} [{signal}]" | |
| exit $E_BADARGS | |
| fi | |
| process_name="$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
| #!/bin/bash | |
| # | |
| # I am mostly working in either of 2 modes: | |
| # 1- work [ pass 'work' as first argument ] | |
| # 2- not-work [ default] | |
| # | |
| # And over the years I have found it to be a pain to have to | |
| # manually start the same 5-6 prorgams everytime my laptop | |
| # got rebooted so I created a script with those presets | |
| # and then set openbox to start the relevant workspace |
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 | |
| # Most of the code below has been adapted from several different scripts | |
| mkdir -p /tmp/adblock &> /dev/null | |
| temphosts1=`mktemp` | |
| temphosts2=`mktemp` | |
| # I prefer to separate adblock entries from my vanilla hosts file. | |
| # I also use dnsmasq, which allows me to chain-load an additional | |
| # hosts file, which is what i have done here. | |
| target_file=/etc/hosts.dnsmasq |
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 | |
| if [ $# -ne 3 ] | |
| then | |
| echo "Usage: $0 sourceExtension /path/to/source/files /path/to/save/converted/files" | |
| exit 65 | |
| fi | |
| cd "$2" |
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
| <?php | |
| echo substr(str_replace('+', '.', base64_encode(pack('N4', mt_rand(), mt_rand(), mt_rand(), mt_rand()))), 0, 22) . PHP_EOL; |