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 | |
| $@ &>/dev/null | |
| echo "Exit status:" $? | |
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
| # | |
| # ~/.xprofile | |
| # | |
| # sourced by /etc/lxdm/Xsession | |
| # | |
| if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then | |
| eval "$(dbus-launch --sh-syntax --exit-with-session)" | |
| 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 | |
| # | |
| # Usage: | |
| # 1. Change the values in Config | |
| # 2. $ sudo chmod 700 backup-mysql | |
| # 3. $ sudo mv backup-mysql /etc/cron.daily/ | |
| ## Config | |
| MYSQL=/usr/bin/mysql |
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 | |
| if [ $# -lt 1 ]; then | |
| echo "No destination defined. Usage: $0 destination" >&2 | |
| exit 1 | |
| elif [ $# -gt 1 ]; then | |
| echo "Too many arguments. Usage: $0 destination" >&2 | |
| exit 1 | |
| elif [ ! -d "$1" ]; then | |
| echo "Invalid path: $1" >&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 | |
| # Add the path of this file to /etc/crontab | |
| # e.g. | |
| # $ chmod 700 dumpdb; mv dumpdb /etc/cron.daily/ | |
| today=$(date +%Y%m%d) | |
| basedir=/var/backups | |
| mysql_password= | |
| if [[ -x /usr/bin/mysqldump ]]; then |
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 | |
| # Usage: ./wmv2flv.sh <intput.wmv> <output.flv> | |
| if [ $# -eq 0 ]; then | |
| echo "Usage: ./wmv2flv.sh <intput.wmv> <output.flv>" | |
| exit 1 | |
| fi | |
| ffmpeg -i $1 -acodec libmp3lame -ar 22050 -ab 96000 -deinterlace \ | |
| -nr 500 -aspect 4:3 -r 20 -g 500 -me_range 20 -b 270k -deinterlace \ |
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
| # Rollcode.com | |
| import sys, subprocess, urllib | |
| def getSpeech(phrase): | |
| googleAPIurl = "http://translate.google.com/translate_tts?tl=en&" | |
| param = {'q': phrase} | |
| data = urllib.urlencode(param) | |
| googleAPIurl += data # Append the parameters | |
| return googleAPIurl |
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
| #include <stdio.h> | |
| #include <time.h> | |
| #include <stdlib.h> | |
| int main() | |
| { | |
| srand(time(NULL)); | |
| int r = rand(); | |
| printf("%d\n", r); |
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
| unsigned long long | |
| choose(unsigned long long n, unsigned long long k) { | |
| if (k > n) { | |
| return 0; | |
| } | |
| unsigned long long r = 1; | |
| for (unsigned long long d = 1; d <= k; ++d) { | |
| r *= n--; | |
| r /= d; | |
| } |
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 | |
| # Convert ANSI (terminal) colours and attributes to HTML | |
| # Licence: LGPLv2 | |
| # Author: | |
| # http://www.pixelbeat.org/docs/terminal_colours/ | |
| # Examples: | |
| # ls -l --color=always | ansi2html.sh > ls.html | |
| # git show --color | ansi2html.sh > last_change.html |