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
mysqldump -u root --password='YOURPASSSORD' \ | |
--all-databases --add-drop-database \ | |
> /tmp/databases.sql |
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
mysql -u root -p | |
mysql> source /path/to/databases.sql |
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
s3cmd mb s3://yournewbucket #Create a new bucket | |
s3cmd ls s3://yournewbucket/ #List the contents of the bucket | |
s3cmd put databases.sql s3://yournewbucket/ #Upload the SQL file |
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/env bash | |
TMPFILE=/tmp/`hostname`.databases.`date '+%Y-%m-%d'`.sql | |
TMPGZFILE=$TMPFILE.gz | |
mysqldump -u root --password='PASSWORD' \ | |
--all-databases --add-drop-database \ | |
> $TMPFILE | |
gzip $TMPFILE #This will make a file with the $TMPGZFILE filename. | |
s3cmd put $TMPGZFILE s3://YOURBUCKET/ | |
rm -f $TMPFILE $TMPGZFILE |
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
function stardate() | |
{ | |
# There's apparently no cannon way to calculate the startdate | |
# but here goes. | |
# Add up all the minutes so far in the day, divide by minutes in 24 hours and format it nicely. | |
DECIMAL=$(echo $(( $(date -u '+%H') * 60 + $(date -u '+%M') )) | awk '{printf("%.2f", $1/1440)}' | sed 's/^0*//') | |
# Get the number of days since epoch. | |
DATE=$(( $(date -u '+%s') / 60 / 60 / 24 )) | |
echo "$DATE$DECIMAL" |
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
# Sync the time ninja style | |
0 0 * * * /bin/date `ssh -i /home/username/.ssh/id_rsa -p 443 [email protected] "date '+%m%d%H%M%Y.%S'"` |
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
su -c wget http://www.skype.com/go/getskype-linux-beta-fc10 | |
su -c yum install libXScrnSaver.i?86 libX11.i?86 \ | |
libv4l.i?86 alsa-plugins-pulseaudio.i?86 \ | |
qt-x11.i?86 | |
su -c yum localinstall skype-*.rpm --nogpgcheck |
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
sudo rpm --import http://commondatastorage.googleapis.com/xenodecdn/RPM-GPG-KEY-rpmfusion-free-fedora-15 | |
sudo rpm --import http://commondatastorage.googleapis.com/xenodecdn/RPM-GPG-KEY-rpmfusion-nonfree-fedora-15 | |
su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm' |
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
sqlite3 database.db "SELECT * FROM table_name;" | sed 's/|/,/g' |
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
for i in `seq 0 32`; do echo $i Processes; START=`date +%s.%N`; seq 2 10000 | xargs -n1 -P$i python is_prime.py >/dev/null; END=`date +%s.%N`; echo $(echo "scale=9; $END - $START" | bc) seconds; echo; done |
OlderNewer