Skip to content

Instantly share code, notes, and snippets.

@zachbrowne
Created September 29, 2011 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachbrowne/1251168 to your computer and use it in GitHub Desktop.
Save zachbrowne/1251168 to your computer and use it in GitHub Desktop.
A collection of commands and bash script functions for Ubuntu that just make life easier.
# Commands to backup a website from root access to ssh with mysql database
cd to directory of website
# Compress
tar czf filename.tar.gz *
mysqldump -u root -ppassword databasename | gzip -9 > filename.sql.gz
# Decompress
tar xzf filename.tar.gz
gunzip filename.sql.gz
# To add a repository to your sources.list file (Change the URL & Ubuntu version to the one you want.)
echo "deb http://packages.medibuntu.org/ natty free non-free" | sudo tee -a /etc/apt/sources.list
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update
# Add core apps for everything
aptitude install automake autoconf subversion-tools libtool help2man build-essential erlang erlang-manpages libmozjs-dev wget libicu-dev checkinstall python-software-properties git-core subversion
# Install Sun Java on Ubuntu
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java7-installer
# tar commands
# Decompress with tar (*.tar.gz & *.tar.bz2)
tar -xvf
# Compress the content within the directory you reside in
tar czf filename.tar.gz *
# Add zach to /etc/sudoers for no-password
zach ALL=(ALL) NOPASSWD: ALL
# Install latest version of mono (To run ASP & .NET 4)
wget --no-check-certificate https://github.com/nathanb/iws-snippets/raw/master/mono-install-scripts/ubuntu/install_mono-2.8.shchmod 755 install_mono-2.8.sh./install_mono-2.8.sh
# Install Ubuntu desktop and remote access <-- Run as user not root
sudo aptitude install --without-recommends ubuntu-desktop
sudo /etc/init.d/gdm start
sudo dpkg-reconfigure xserver-xorg
sudo apt-get install tightvncserver
vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565
ps aux #run to find id
sudo nano ~/.vnc/xstartup #Comment out "x-window-manager" and add "gnome-session &" to file w/o quotes
iptables -A INPUT -p tcp --destination-port 5901
sudo reboot
//Install X, LXDE, VPN programs
apt-get install xorg lxde-core tightvncserver
//Start VNC to create config file
tightvncserver :1
//Then stop VNC
tightvncserver -kill :1
//Edit config file to start session with LXDE:
nano ~/.vnc/xstartup
//Add this at the bottom of the file:
lxterminal &
/usr/bin/lxsession -s LXDE &
//Start VNC
vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565
# Kill processes
# find process
ps aux | grep "name of process" - no quotes
# stop process
kill "5555" - pid, no quotes
kill -9 "5555" - pid, no quotes
killall -9 "name of process" - no quotes
# Add PUBKEY to Ubuntu
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 68980A0EA10B4DE8
# Fix problem with Ubuntu 11.10 64bit not finding http://extras.ubuntu.com key with apt-get update
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3E5C1192
# Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
$ sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment