Skip to content

Instantly share code, notes, and snippets.

View adriantorrie's full-sized avatar

Adrian Torrie adriantorrie

View GitHub Profile
@adriantorrie
adriantorrie / mount-usb-automatically.sh
Last active August 29, 2015 14:09
Ubuntu 14.04 - Mount an external USB drive, and make it mount automatically at system startup.
sudo lshw -C disk
lsblk
sudo mount -l | grep sdb1
sudo umount /dev/sdb1
sudo mkfs.ext4 /dev/sdb1
sudo mkdir /media/$USER && sudo mkdir $_/usb-backup
sudo chown $USER:$USER /media/$USER
sudo cp /etc/fstab "/etc/fstab.bkup."$(date '+%Y%m%d_%H%M%S')""
echo -e "/dev/sdb1\t/media/$USER/usb-backup\text4\tdefaults\t0\t2" | sudo tee --append /etc/fstab
sudo mount /media/$USER/usb-backup
@adriantorrie
adriantorrie / install-pinta.sh
Created November 13, 2014 10:20
Ubuntu 14.04 - Install Pinta Image Editor from PPA
sudo add-apt-repository ppa:pinta-maintainers/pinta-daily
sudo apt-get update
sudo apt-cache show pinta
sudo apt-get install pinta -y
@adriantorrie
adriantorrie / rsync-archive.sh
Created November 15, 2014 02:50
Ubuntu 14.04 - Recursively sync folders, and sub-folders, using rsync
rsync -avz /local/source /local/destination
@adriantorrie
adriantorrie / cron-rsync-archive.sh
Created November 15, 2014 02:55
Ubuntu 14.04 - Set a root user cron job to run at 40 minutes past every hour, to sync folders and sub-folders with rsync, and log all output
sudo crontab -e
40 * * * * rsync -avz /local/source /local/destination >> /var/log/cron/name-of-local-source.log 2>&1
@adriantorrie
adriantorrie / network_interface.sh
Last active August 29, 2015 14:09
Ubuntu 14.04 - Get the NIC working immediately upon completion of installing Ubuntu Server
ifconfig -a | grep Ethernet
sudo cp /etc/network/interfaces /etc/network/interfaces.original
sudo vi /etc/network/interfaces
# insert new lines of configuration data to the file
# --------------------------------------------------
# eth0 is the typical NIC name. p3p1 is also another common one. Use the name
# found from line 1 above
# address: 192.168.0.99 is arbitrary
# netmask and broadcast: are patterns that will work for the address above
# gateway and dns-nameservers: assumes your router address is 192.168.0.1
@adriantorrie
adriantorrie / install-ubuntu-minimal-gui.sh
Last active August 29, 2015 14:09
Ubuintu 14.04 - Install the minimal requirements to have an interactive desktop GUI on an Ubuntu Server install
sudo apt-get update && sudo apt-get -y dist-upgrade
sudo apt-cache show ubuntu-desktop | grep "Depends"
sudo apt-get -y install --no-install-recommends ubuntu-desktop
sudo apt-get -y install unity-lens-applications unity-lens-files unity-lens-music unity-lens-video unity-scope-musicstores unity-scope-video-remote indicator-datetime indicator-messages indicator-power indicator-session nautilus-dropbox firefox git openssh-server powerwake rsync cups awscli
@adriantorrie
adriantorrie / install-unity-dash.sh
Created November 16, 2014 07:26
Ubuntu 14.04 - Install the necessary packages to make the Unity Dash functions work on a minimal Ubuntu Server GUI
sudo apt-get install unity-lens-applications unity-lens-files unity-lens-music unity-lens-video unity-scope-musicstores unity-scope-video-remote
@adriantorrie
adriantorrie / install-network-gui.sh
Last active August 29, 2015 14:09
Ubuntu 14.04 - Install network manager GUI, and reboot into our minimal desktop GUI we've just completed isntalling
sudo apt-get install network-manager
sudo mv -fv /etc/network/interfaces.original /etc/network/interfaces
sudo shutdown -r now
@adriantorrie
adriantorrie / install-system-tools.sh
Last active August 29, 2015 14:09
Ubuntu 14.04 - install system tools for a minimal desktop on a development machine
sudo apt-get -y install nautilus-dropbox firefox git openssh-server powerwake rsync cups awscli
# https://wiki.ubuntu.com/LibreOffice
sudo apt-get install libreoffice-calc libreoffice-math libreoffice-writer libreoffice-help-en-gb libreoffice-pdfimport