View find-photos-duplicates.sh
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 | |
# cleanup and revert to RAW only library after switching to lightroom after using digikam | |
# only prints results | |
PHOTOS_FOLDER="/home/photos" | |
while read RAWFILE; do | |
rawpath=$(dirname "$RAWFILE") | |
filename=$(basename "$RAWFILE") | |
extension="${filename##*.}" | |
filename="${filename%.*}" |
View migrate-innodb.sh
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 | |
mysql -B -N -e "SHOW DATABASES" | while read database; | |
do | |
mysql -B -N -e "SHOW TABLES" $database | while read table; \ | |
do \ | |
echo "+ Converting Table $table"; \ | |
mysql -B -N -e "alter table $table engine=myisam" $database; \ | |
done |
View optimize-mysql.sh
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 | |
mysqlcheck -Aao -auto-repair |
View optimize_firefox.sh
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 | |
for file in ~/.mozilla/firefox/*/*.sqlite; do | |
sqlite3 $file 'VACUUM;' | |
done |
View debug_record.sh
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 | |
# output folder | |
OUT="/var/log/debug-logs" | |
# date format | |
DATE="date +%Y-%m-%d_%H:%M:%S" | |
# set the log file to "" and no logs will be recorded for that | |
APACHE_LOG="apache_status.log" | |
TOP_LOG="top_status.log" | |
PS_LOG="ps_status.log" |
View n800-clone.sh
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
In short, this is what I did to get my N800 to boot OS2008 from MMC. My steps were: | |
1) upgraded my N800 to OS2008, http://europe.nokia.com/A4305010 | |
2) enabled the Maemo Extras repository in Application Manager and added http://repository.maemo.org, Distribution: (blank) Components: free non-free | |
3) installed openssh using Application Manager | |
4) defined a root password (openssh's installer prompted for this) | |
5) opened xterm and: | |
# ssh root@localhost | |
# visudo |
View screen-items.sh
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 | |
screen -dmS servers -T xterm -t "http" sh -c 'cd /servers/start/httpo;run.sh' | |
screen -T xterm -S "servers" -X screen screen -t "sql" sh -c 'cd /servers/start/sql;run.sh' | |
# The "-T xterm" switch isn't really necessary, unless you plan to use curses-based programs from inside the screen (mc, less, etc.). |
View sync-smartstatus.sh
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 | |
count=0 | |
for DISK in sda sdb sdc sdd sde sdf; do | |
/usr/sbin/smartctl --all /dev/$DISK > /var/www/htdocs/status/data/smart$count.txt | |
((count++)) | |
done |
View export-csv.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
SELECT order_id,product_name,qty | |
FROM orders | |
INTO OUTFILE '/tmp/orders.csv' | |
FIELDS TERMINATED BY ',' | |
ENCLOSED BY '"' | |
LINES TERMINATED BY '\n' |
View get-package-size.sh
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
grep "UNCOMPRESSED PACKAGE SIZE" /var/log/packages/* | sed 's/ *//g' | awk -F: '{ print $3" " $1 }' | sort -rh | head -n10 |
OlderNewer