fix_public_keys.sh - This takes a perl script that was released here to find and import public key's for repositories, i just made it all into a bash script that could be automated.
Code: Select all
#!/bin/bash
#fix gg errors with missing public keys
#http://forums.linuxmint.com/viewtopic.php?f=42&t=31980
#variables
dir="$HOME/gpg-fix"
#step 1. if folder does not exist create it
if [ ! -d "$dir" ]; then
#go to home folder
cd $HOME
#create folder
mkdir gpg-fix
fi
#step 2. Download a new copy of the perl script
#change to the fix folder
cd gpg-fix
#download the perl script in compressed tar.gz format
wget http://savvas.radevic.com/launchpad/change.tar.gz -O change.tar.gz
#untar the file to the current folder
tar xzvf change.tar.gz
#step 3. run perl script
perl ./*.pl
#step 4. return to home folder
cd $HOME
#step 5. exit
exit
Code: Select all
#!/bin/bash
#setup variables
tempfolder=$HOME/Downloads
httpsite=http://www.bluetack.co.uk/config
httpfile=nipfilter.dat.gz
httpfileuncompressed=nipfilter.dat
blocklist=ipfilter.dat
echo.
echo -------------------------------------
echo qBittorrent Blocklist Updater
echo
echo version 1.0
echo Written by Craig M. Rosenblum
echo -------------------------------------
echo .
echo ::**:: Creating temp folder and removing files
#check if tempfolder exists if not create it
if [ ! -d "$tempfolder" ]; then
mkdir $tempfolder
fi
#delete existing httpfile and blocklist files
if [ -d "$tempfolder/$httpfile" ]; then
rm "$tempfolder/$httpfile"
fi
if [ -d "$tempfolder/$blocklist" ]; then
rm "$tempfolder/$blocklist"
fi
#download the ipfilter to a local folder
echo ::**:: Downloading the blocklist
wget --no-verbose --quiet "$httpsite/$httpfile" --no-cache -O "$tempfolder/$httpfile">/dev/null
#check for wget errors
if [ $? -ne 0 ]; then
echo ::**:: wget returned errorlevel: $?
echo ::**:: An error occured!
exit 1
fi
#delete previously unzipped ipfilter file
if [ -d "$tempfolder/nipfilter.dat" ]; then
rm "$tempfolder/nipfilter.dat"
fi
#unzip the downloaded file
echo ::**:: Uncompressing "$httpfile" to "$httpfileuncompressed"
gunzip -f "$tempfolder/$httpfile"
if [ $? -ne 0 ]; then
echo ::**:: gunzip returned errorlevel: $?
echo ::**:: An error occured!
exit 1
fi
#rename the downloaded blocklist file
echo ::**:: Moving and renaming the blocklist from "$httpfileuncompressed" to "$blocklist"
mv -f "$tempfolder/$httpfileuncompressed" "$HOME/.config/qBittorrent/$blocklist"
if [ $? -ne 0 ]; then
echo ::**:: rename returned errorlevel: $?
echo ::**:: An error occured!
exit 1
fi
echo ::**:: Update Complete!
exit 0
Code: Select all
#!/bin/bash
#setup wget variables
URL="https://www.google.com/calendar/ical/youraccount/basic.ics"
dir1="$HOME/Downloads"
dir2="$HOME/Scripts"
echo .
echo -------------------------------------
echo Google Calendar Updater
echo
echo version 1.0
echo Written by Craig M. Rosenblum
echo -------------------------------------
echo .
#download the ipfilter to a local folder
echo ::**:: Downloading the google calendar to $dir2/basic.ics
wget -c -N --no-check-certificate $URL -o "$dir1/basic.ics" >/dev/null
#mv file to new destination
echo ::**:: Moving basic.ics to downloads folder
mv -f "$dir2/basic.ics" "$dir1/basic.ics"
echo ::**:: Download Complete!
exit 0
Code: Select all
#!/bin/bash
# Script to randomly set Background from files in a directory
# Directory Containing Pictures
DIR="your wallpaper folder"
# Command to Select a random jpg file from directory
# Delete the *.jpg to select any file but it may return a folder
PIC=$(ls "$DIR"/*.jpg | shuf -n1)
# Command to set Background Image
mateconftool-2 -t string -s /desktop/mate/background/picture_filename "$PIC"
#send notification message that a wallpaper changed
notify-send -i 'dialog-information' 'Changing Wallpaper' "$PIC";
exit
I really loved automating things, via window's batch scripts, and now am learning to love to do the same in linux.
I hope you enjoy any of these...
Craig