Bing Wallpaper and Lockscreen script

Here is a simple script to update your wallpaper and your lockscreen every two hours!
Enjoy!

#!/bin/bash

# Bing wallpapers
# Cesário Garcia Mil-Homens
# cesario@cesariogarcia.com
# https://www.cesariogarcia.com

# 1. Execute this script the first time and set "bingwallpaper.jpg" as wallpaper and lockscreen
# 2. Config $wallpaperPath (line 13 of this script) for the full path of where you want "bingwallpaper.jpg" to be (it should be on the user Pictures folder)
# 3. On the terminal execute the following script, this will check for new updates every two hours
# crontab -l | { cat; echo "0 */2 * * * /bin/bash /home/cesario/Programs/bingwallpapers.sh >/dev/null 2>&1"; } | crontab -

wallpaperPath="/home/cesario/Pictures"

wget -q --spider http://google.com

if [ $? -eq 0 ]; then
    echo "Online"
	imageName=$(curl -s "https://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=en-US" | grep -o -m 1 "/az/hprichbg/rb/.*._1366x768.jpg")
    prefix="/az/hprichbg/rb/";
	imageName=${imageName#$prefix};
	suffix="_1366x768.jpg";
	imageName=${imageName%$suffix};
		if [ -e $wallpaperPath"/"$imageName"_1366x768.jpg" ]
		then
			echo "$imageName found."
		else
			echo "$imageName not found."
			wget "https://www.bing.com/az/hprichbg/rb/"$imageName"_1366x768.jpg" -P $wallpaperPath
			cp $wallpaperPath"/"$imageName"_1366x768.jpg" $wallpaperPath"/"bingwallpaper.jpg
		fi
else
    echo "Offline"
fi

Share WiFi via Ethernet on Ubuntu 17.10

There is a hidden method to share your WiFi over Ethernet in the latest Gnome.

  1. Type nm-connection-editor in your terminal.
  2. Add a shared network connection by pressing the Add button.
  3. Choose Ethernet from the list and press Create.
  4. Click IPv4 Settings in the left.
  5. Choose Shared to other computers by clicking the Method drop-down menu.
  6. Enter a new name like Shared WiFi LAN as the Connection name at the top

Dislocker script

This script aims to mount a Bitlocker encrypted drive in linux.
The binaries can be downloaded at https://pkgs.org/download/dislocker.

#!/bin/bash

# Dislocker binary can be downloaded from https://pkgs.org/download/dislocker
# All credits to Cesário Garcia Mil-Homens - www.cesariogarcia.com

if [ ! -d "/media/mount" ] && [ ! -d "/media/bitlocker" ]; then
        sudo mkdir /media/bitlocker
        sudo mkdir /media/mount
    else
        sudo fdisk -l
        read -n1 -r -p "Press any key to continue..." key
        echo "Insert volume and partition eg. sdaX"
        read volume
        echo "Enter password"
        read -s password
        sudo dislocker -V /dev/$volume -u$password -- /media/bitlocker
        sudo mount /media/bitlocker/dislocker-file /media/mount/ -o loop
        echo "Press u to umount device"
        read key
        if echo "$key" | grep -iq "^u" ;then
                sudo umount /media/mount
                sudo umount /media/bitlocker
        fi
fi

Ubuntu Linux 12.04 LTS – World Wide VPN’s

In Windows you can get free VPN software like Anchor Free, SoftFlux and Expat Shield.
But what about Linux?

US – http://www.anchorfree.com/
US – http://www.spotflux.com/
UK – http://www.expatshield.com/

So how can we create a VPN that gives us the country IP we want?

So things we will install

  • Vidalia – Vidalia offers a graphical user interface to start and stop Tor, view its status at a glance, and monitor its bandwidth usage.
  • Tor – Tor is a connection-based low-latency anonymous communication system which addresses many flaws in the original onion routing design.
  • Privoxy – Privoxy is a non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data and HTTP headers, controlling access, and removing ads and other obnoxious Internet junk.

Let’s install them on terminal (Ctrl + Alt + t)

sudo apt-add-repository ppa:ubun-tor/ppa
sudo apt-get update
sudo apt-get install tor privoxy vidalia

If you want a UK ip everytime you start Tor open Vidalia and go to “View the network”. Here you will see a bunch of relays, sort them by country and copy the nicknames of wich you want to look like the ones below.

ExitNodes TorLand2, TorLand1, TorLand5, st0nerhenge, c00psTOR, EnfluraneNode, microlah, YoureOnCCTV, hamtor
StrictExitNodes 1

Go to terminal

sudo gedit /etc/tor/torrc

Insert the lines you created save and exit.

Start tor

tor &

Go to Network GUI -> Proxy

Socks Server: 127.0.0.1
Port: 9050

If you want to logoff the VPN set proxy to none and stop tor

sudo killall tor

PBLS4Lin v1.0 – Peerblock for Linux and Transmission

Um script para linux que permite utilizar as listas do Peerblock.
Estas listas podem ser utilizadas no Transmission.

#!/bin/bash

#This script creates the same lists as peerblock http://www.peerblock.com/, it outputs a file that you
#can use on Transmission under Edit -> Preferences -> Privacy -> Blocklist. In the first time copy the
#http link and use it. All lists are from http://www.iblocklist.com
#This script was created by Cesário Garcia Mil-Homens - http://www.cesariogarcia.com just for the fun.
#PBLS4Lin - v1.0

#CONFIGURATION - WARNING THE DIRECTORIES SHOULD ALREADY EXIST.

#Insert here the dir where is your Dropbox/Google Drive/etc public folders or you local server with apache
#Using Dropbox
#destination_folder="$HOME/Dropbox/Public"
#Using localhost
destination_folder="/var/www/peerblock"

#Insert here your own temporary download folder, do not use /tmp
temp="$HOME/tmp"

#DO NOT EDIT BELOW THIS LINE

clear
echo "Peerblock Lists - Automatic Uptades for Transmission"
echo "My destination folder is $destination_folder and my temporary download folder is $temp is this correct? (y/n)"

function download() {
	sudo cd $temp
	sudo wget -O - "http://list.iblocklist.com/?list=bt_ads&fileformat=p2p&archiveformat=gz" > bt_ads.txt.gz
	sudo wget -O - "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz" > bt_level1.txt.gz
	sudo wget -O - "http://list.iblocklist.com/?list=bt_spyware&fileformat=p2p&archiveformat=gz" > bt_spyware.txt.gz
	sudo gunzip *.gz
	}

function combine() {
	sudo cat bt_ads.txt bt_level1.txt bt_spyware.txt > peerblock.txt
	sudo rm bt_ads.txt
	sudo rm bt_level1.txt
	sudo rm bt_spyware.txt
	 }

function upload() {
	sudo mv -f peerblock.txt $destination_folder
	}

read op

case $op in
	y) download; combine; upload;;
	*) exit;;
esac