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 | |
LATLNG="(53.3096,-6.28396)" | |
LAT=$(echo "$LATLNG" | sed -e "s/(\(.*\),\(.*\))/\1/g" ) | |
LON=$(echo "$LATLNG" | sed -e "s/(\(.*\),\(.*\))/\2/g") | |
echo "Lat : $LAT" | |
echo "Lng : $LON" |
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 | |
svn merge --dry-run -r BASE:HEAD . |
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 | |
svn diff -rBASE:HEAD myfilename |
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
#!/usr/bin/env python | |
# Clone or update all a user's gists | |
# curl -ks https://raw.github.com/gist/5466075/gist-backup.py | USER=fedir python | |
# USER=fedir python gist-backup.py | |
import json | |
import urllib | |
from subprocess import call | |
from urllib import urlopen | |
import os |
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
while ! curl -m 10 http://www.example.com/ ; do echo still down ; sleep 10 ; done ; play alarm.wav # Play alarm.wav once site is back. |
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 | |
echo "Hello ! I'm the robot" | ( espeak || say -v F ) > /dev/null 2>&1 |
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 | |
du -h --exclude=".svn" --max-depth=0 "/home/www/path/" 2>"/dev/null" |
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 | |
# shows a dB tables size in MB | |
# usage : checkDatabaseTablesSize.sh databasename | |
# mysql : SELECT TABLE_NAME,(DATA_LENGTH+INDEX_LENGTH)/1024/1024 FROM information_schema.TABLES WHERE table_schema="dbname"; | |
DATABASE=$1 | |
mysql -e "SELECT TABLE_NAME,(DATA_LENGTH+INDEX_LENGTH)/1024/1024 FROM information_schema.TABLES WHERE table_schema=\"${DATABASE}\";" |
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 | |
find $1 -name .svn -exec echo {} \; | |
read -p "These files are near to be removed. Continue (y/n)?" choice | |
case "$choice" in | |
y|Y ) | |
find $1 -name .svn -exec rm -rf {} \; | |
;; | |
* ) | |
echo "No files removed" |
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
/** | |
* | |
* An example of advanced import into MySQL database using LOAD DATA INFILE | |
* | |
* import of first and second column from the file directly | |
* third column is equal to current datetime | |
* fourth column is transformed value of third column of csv file | |
* ref. : http://dev.mysql.com/doc/refman/5.1/en/load-data.html | |
*/ |