Skip to content

Instantly share code, notes, and snippets.

Silviu Vulcan silviuvulcan

View GitHub Profile
@silviuvulcan
silviuvulcan / vlc-vod.sh
Created Aug 18, 2014
VLC VOD configuration
View vlc-vod.sh
#!/bin/bash
# start a vlc stream from command line
cvlc --ttl 12 -vvv --color -I telnet --telnet-password videolan --rtsp-host 0.0.0.0 --rtsp-port 554 >/dev/null 2>&1 &
echo "Ready to telnet localhost 4212"
echo "and create the vod object."
echo
echo "new Test vod enabled"
echo "setup Test input my_video.mpg"
echo
echo "Stream at rtsp://server:554/Test"
@silviuvulcan
silviuvulcan / backup-crontab.sh
Created Aug 18, 2014
Backup crontab to file
View backup-crontab.sh
#!/bin/bash
DST="/backups/crontab"
crontab -l > "$DST/$(date +"%Y-%m-%d-%a")_cronab.txt"
@silviuvulcan
silviuvulcan / check_debian_updates.sh
Created Aug 18, 2014
Check and email debian updates
View check_debian_updates.sh
#!/bin/bash
mailto="email@example.com"
# Download only; package files are only retrieved, not
# unpacked or installed.
apt-get -dqq update
apt-get -dyqq upgrade
has_upgrades=$(apt-get -s upgrade | grep ^Inst)
@silviuvulcan
silviuvulcan / find-photos-duplicates.sh
Created Aug 18, 2014
Search and clean duplicate phosts (useful if switching to lightroom from digikam)
View find-photos-duplicates.sh
#!/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%.*}"
@silviuvulcan
silviuvulcan / migrate-innodb.sh
Created Aug 18, 2014
Migrate innodb to myisam (low memory systems)
View migrate-innodb.sh
#!/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
@silviuvulcan
silviuvulcan / optimize-mysql.sh
Created Aug 18, 2014
Optimize all mysql tables
View optimize-mysql.sh
#!/bin/bash
mysqlcheck -Aao -auto-repair
@silviuvulcan
silviuvulcan / optimize_firefox.sh
Created Aug 18, 2014
Optimize firefox databases (or any other sqlite db)
View optimize_firefox.sh
#!/bin/bash
for file in ~/.mozilla/firefox/*/*.sqlite; do
sqlite3 $file 'VACUUM;'
done
@silviuvulcan
silviuvulcan / record_my_ip.sh
Created Aug 18, 2014
Simple script to log external IP
View record_my_ip.sh
#!/bin/bash
LOG='/var/log/my_ip.log'
IP=$(curl -s http://icanhazip.com/)
echo -e `date`"\t $IP" >> $LOG
@silviuvulcan
silviuvulcan / debug_record.sh
Created Aug 18, 2014
Simple script that collects some logs that can help in debugging server issues
View debug_record.sh
#!/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"
@silviuvulcan
silviuvulcan / virtuemart-export.php
Created Aug 18, 2014
Custom Virtuemart Export PHP script; I created this some time ago for a Joomla 1.5 installation
View virtuemart-export.php
<html>
<head>
</head>
<body>
<?php
// Please note this was developed for a Joomla 1.5 installation
// www.sgvulcan.com
$host = "localhost"; //database location
You can’t perform that action at this time.