Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

2011 clean up :)

  • Loading branch information...
commit 73baf4868166062899f4f5cb08194a6e46dc936f 1 parent 01c6d8f
@mxdpeep mxdpeep authored
View
73 README 100644 → 100755
@@ -1,56 +1,59 @@
-A collection of miscellaneous shell scripts:
+A collection of miscellaneous Linux shell scripts:
backup-home.sh
-==============
-* backup users's home folder to an external media made easy
-* EDIT THE PATH VARIABLE BEFORE USE!
-
+=============
+* backup user's home folder to an external media
+* useful for weekly backups
+* EDIT THE BACKUP PATH VARIABLE BEFORE USE!
backup-root.sh
-==============
-* backup root folder to an external media made easy
-* EDIT THE PATH VARIABLE BEFORE USE!
-
+============
+* backup root folder to an external media
+* useful for weekly backups
+* EDIT THE BACKUP PATH VARIABLE BEFORE USE!
detoxify.sh
-===========
+=========
* remove special chars from filenames recursively
+* rename to lower filenames recursively
+kill-chrome-profile.sh
+=================
+* kill current user's Chrome profile
pdfchecker.sh
-=============
-* check for PDF consistency recursively
-
-
-svncreate.sh
-============
-* create subversion repository
-* EDIT THE PATH VARIABLE BEFORE USE!
+===========
+* check PDF validity recursively
+* rename invalid files
+restore-home.sh
+==============
+* restore user's home folder from an external media
+* ATTENTION - destructive operation!
restore-root.sh
-===============
-* restore root folder from an external media made easy
-* ATTENTION - destructive operations!
-
-
-restore-home.sh
-===============
-* restore user's home folder from an external media made easy
-* ATTENTION - destructive operations!
+=============
+* restore root folder from an external media
+* ATTENTION - destructive operation!
sslcreate.sh
-============
+==========
* create and setup self-signed SSL certificate for Apache2
+svncreate.sh
+==========
+* create subversion repository
+* EDIT THE SVN PATH VARIABLE BEFORE USE!
-Distributed under the terms of the GNU General Public License v3
-These programs are distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY. YOU USE AT YOUR OWN RISK. THE AUTHOR
-WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY
-OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
-See the GNU General Public License for more details.
+# Distributed under the terms of the GNU General Public License v3
+#
+# Filip Oscadal <filip@mxd.cz> http://mxd.cz No Rights Reserved 2010.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY. YOU USE AT YOUR OWN RISK. THE AUTHOR
+# WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY
+# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
+# See the GNU General Public License for more details.
-Filip Oscadal <filip@mxd.cz> http://mxd.cz No Rights Reserved 2010.
View
6 backup-home.sh
@@ -10,8 +10,10 @@
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
# See the GNU General Public License for more details.
-# change to match your backup media location!
-P='/media/PET'
+
+# change this to match your backup media location!
+P='/media/backup'
+
if [ -d "$P" ]
then
View
6 backup-root.sh
@@ -9,11 +9,11 @@
# WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
# See the GNU General Public License for more details.
-#
-#Filip Oscadal <filip@mxd.cz> http://mxd.cz No Rights Reserved 2010.
+
# change to match your backup media location!
-P='/media/PET'
+P='/media/backup'
+
if [ -d "$P" ]
then
View
8 detoxify.sh
@@ -10,6 +10,7 @@
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
# See the GNU General Public License for more details.
+
# check syntax
if [ $# -eq 0 ]
then
@@ -28,6 +29,7 @@ else
fi
fi
+
# check installed app
which detox > /dev/null 2>&1
if [ $? -eq 1 ]
@@ -42,6 +44,7 @@ then
exit 1
fi
+
# recurse any folders and execute detox 1st round
for i in *
do
@@ -52,13 +55,12 @@ do
fi
if [ -f "$i" ]
then
-# You may uncomment the following line to be more verbose...
-# echo "Renaming: $i"
detox -s utf_8 "$i" >/dev/null 2>&1
fi
done
sync
+
# recurse any folders and execute detox 2nd round
for i in *
do
@@ -69,8 +71,6 @@ do
fi
if [ -f "$i" ]
then
-# You may uncomment the following line to be more verbose...
-# echo "Renaming: $i"
detox -s lower "$i" >/dev/null 2>&1
fi
done
View
14 kill-chrome-profile.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# Distributed under the terms of the GNU General Public License v3
+#
+# Filip Oscadal <filip@mxd.cz> http://mxd.cz No Rights Reserved 2010.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY. YOU USE AT YOUR OWN RISK. THE AUTHOR
+# WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY
+# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
+# See the GNU General Public License for more details.
+
+
+rm -rf ~/.config/google-chrome/Default
View
4 pdfchecker.sh
@@ -10,6 +10,7 @@
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
# See the GNU General Public License for more details.
+
# check syntax
if [ $# -eq 0 ]
then
@@ -27,6 +28,7 @@ then
fi
fi
+
# check installed app
which pdfinfo > /dev/null 2>&1
if [ $? -eq 1 ]
@@ -41,6 +43,7 @@ then
exit 1
fi
+
# recurse any directories first
for i in *
do
@@ -51,6 +54,7 @@ do
fi
done
+
# check pdf files (or recurse .pdf directories)
for i in *.pdf
do
View
3  restore-home.sh
@@ -10,11 +10,14 @@
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
# See the GNU General Public License for more details.
+
if [ -z "$1" ]
then
echo "\nRestores the home folder from backup. CAUTION - ALL CURRENT HOME FOLDER DATA WILL BE ERASED!\n\nSyntax: $(basename $0) <partition> <backup_file>\nExample: $(basename $0) home-backup-10.10.2010.tar.gz\n"
exit 1
fi
+
+
if [ -f "$1" ]
then
cd ~
View
3  restore-root.sh
@@ -10,11 +10,14 @@
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
# See the GNU General Public License for more details.
+
if [ -z "$2" ]
then
echo "\nRestores the partition from backup. CAUTION - ALL DATA WILL BE ERASED!\n\nSyntax: $(basename $0) <partition> <backup_file>\nExample: $(basename $0) sda1 root-backup-10.10.2010.tar.gz\n"
exit 1
fi
+
+
if [ -f "$2" ]
then
sudo mount -t ext4 "/dev/$1" "/mnt/$1"
View
3  sslcreate.sh
@@ -10,6 +10,7 @@
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
# See the GNU General Public License for more details.
+
cd
sudo openssl genrsa -des3 -out server.key 4096
sudo openssl rsa -in server.key -out server.key.insecure
@@ -20,4 +21,4 @@ sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.
sudo cp server.crt /etc/ssl/certs
sudo cp server.key /etc/ssl/private
sudo a2enmod ssl
-echo "\nmodify /etc/apache2/sites-available/default and restart Apache2:\n\nSSLEngine on\nSSLCertificateFile /etc/ssl/certs/server.crt\nSSLCertificateKeyFile /etc/ssl/private/server.key\n"
+echo "\nModify /etc/apache2/sites-available/default and restart Apache:\n\nSSLEngine on\nSSLCertificateFile /etc/ssl/certs/server.crt\nSSLCertificateKeyFile /etc/ssl/private/server.key\n"
View
6 svncreate.sh
@@ -10,9 +10,11 @@
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
# See the GNU General Public License for more details.
+
# change to match your SVN repositories location!
P='/home/svn'
+
# check syntax
if [ -z "$1" ]
then
@@ -20,6 +22,7 @@ then
exit 1
fi
+
# check install app
which svnadmin > /dev/null 2>&1
if [ $? -eq 1 ]
@@ -34,6 +37,7 @@ then
exit 1
fi
+
# check path and create folder
if [ -d "$P/$1" ]
then
@@ -48,6 +52,7 @@ else
exit 1
fi
+
# setup svn repository
sudo svnadmin create "$P/$1"
sudo chown -R www-data:subversion "$P/$1"
@@ -57,6 +62,7 @@ then
fi
sudo chmod -R g+rws "$P/$1"
+
# restart Apache
sudo /etc/init.d/apache2 force-reload 2>/dev/null
if [ $? -eq 1 ]
Please sign in to comment.
Something went wrong with that request. Please try again.