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 | |
# adapted from sonia 16-nov-05 ( www.snowfrog.net/2005/11/16/backup-multiple-databases-into-separate-files/ ) | |
# backup each mysql db into a different file, rather than one big file | |
# as with --all-databases - will make restores easier | |
# rotate daily, keep one week's long | |
USER="SQLSuperUserName" | |
PASSWORD="SQLSuperUserPasswordHere" | |
OUTPUTDIR="/path/to/backups/dbbackup" | |
MYSQLDUMP="/usr/bin/mysqldump" |
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
set timeout 18000 | |
spawn ssh [email protected] mysqldump --database db_name -u db_user -p --single-transaction >/path/to/backup | |
expect "*[email protected]'s password:*"; | |
send "superSecurePassword\r"; | |
expect "*?assword:*"; | |
send "superSecureDBpass\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
complete -W "$(echo $(grep '^ssh ' .bash_history | sort -u | sed 's/^ssh //'))" ssh |
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
#!/usr/bin/env python | |
import nltk | |
from nltk.stem.porter import PorterStemmer | |
def preprocessText(text): | |
# To lower case | |
text = text.lower(); | |
# Tokenize text |
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 | |
for line in $(rospack list-names) | |
do | |
for msg in $(rosmsg package $line) | |
do | |
echo 'Message ' $msg ' in ' $line | |
rosmsg show $msg | |
echo '-----------------------------------------------------' | |
done | |
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
#!/usr/bin/env python | |
def generateChars(char): | |
if char == u'\u03ac' or char == u'\u03b1': #alpha | |
return (u'\u03ac',u'\u03b1'); | |
elif char == u'\u03b5' or char == u'\u03ad': #epsilon | |
return (u'\u03b5', u'\u03ad'); | |
elif char == u'\u03b7' or char == u'\u03ae': #ita | |
return (u'\u03b7',u'\u03ae'); |
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
import encodings.idna | |
filename = '/path/to/names'; | |
filePointer = open(filename,'r'); | |
content = filePointer.read(); | |
content = content.split("\n"); | |
for line in content: | |
line = line.decode('utf-8'); |
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 | |
# Pre-commit hook to make a mysql dump right before committing and add it to the commit. | |
# | |
## Change the following values to suit your local setup. | |
# The name of a database user with read access to the database. | |
DBUSER=root | |
# The password associated with the above user. Leave commented if none. | |
DBPASS=seekrit | |
# The database associated with this repository. | |
DBNAME=dplay |
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
export PS1="\[\033[38m\]\u@\h\[\033[01;34m\] \w \[\033[31m\]\`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[37m\]$\[\033[00m\] " |
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 | |
mysqldump --all-databases --user="username" --password="password" --single-transaction >/destination/folder/all_databases.sql | |
cd /destination/folder/ | |
# Create new archive | |
ARCHIVE_NAME=DBs$(date '+%G%m%d%k').tar | |
tar -cvvf $ARCHIVE_NAME all_databases.sql |