This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls -lR | awk '{ print $1 }' | grep -v ^\./.* | grep -v ^$ | grep -v ^\.:$ | grep -v total | sort | uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REPO_LIST=$(find . -maxdepth 1 -type d | grep -v ^\.$ | cut -d/ -f2) | |
function action_prompt() { | |
is_done=0 | |
while [ $is_done == 0 ]; do | |
read -p "Would you like to: (s)tatus, (p)ull, p(u)sh, (n)ext? (s/p/u/n)?" answer | |
case $answer in | |
"S" | "s" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Moving /var/log from SSD on / to regular HDD on /home/var_log | |
## http://backdrift.org/how-to-use-bind-mounts-in-linux | |
## | |
sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d) | |
sudo mkdir /home/var_log | |
sudo chown root:root /home/var_log/ | |
sudo chmod 755 /home/var_log/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Get list of already white listed applications (separated by space) | |
SYSTRAY_WHITELIST=$(gsettings get com.canonical.Unity.Panel systray-whitelist | tr -d \',[]) | |
#Applications you wish to add (separated by space) | |
EXTRA_APPLICATIONS="Skype Shutter" | |
#Generate new white list | |
SYSTRAY_WHITELIST_NEW=$(echo "['$SYSTRAY_WHITELIST $EXTRA_APPLICATIONS']" | sed -e "s/\s/', '/g") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main () { | |
cout << "Hello World!" << endl; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Add Michael Gruz's Canon Driver Repository | |
echo "#Michael Gruz - Canon" | sudo tee /etc/apt/sources.list.d/cnijfilter.list | |
echo "deb http://ppa.launchpad.net/michael-gruz/canon/ubuntu quantal main" | sudo tee -a /etc/apt/sources.list.d/cnijfilter.list | |
echo "deb-src http://ppa.launchpad.net/michael-gruz/canon/ubuntu quantal main" | sudo tee -a /etc/apt/sources.list.d/cnijfilter.list | |
#Add Repository Keys | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3F7B4A1D #cnijfilter | |
#Update repositories and install driver | |
sudo apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MIRROR_LOCATION=$HOME/public_html/mirror/ | |
WEBSITE="" | |
# Mirror sir-lab & 585 Website | |
/usr/usc/bin/wget --mirror --no-parent --directory-prefix=$MIRROR_LOCATION --quiet $WEBSITE | |
# Fix permissions to make files available online | |
find $MIRROR_LOCATION -type f -exec chmod 644 {} \; | |
find $MIRROR_LOCATION -type d -exec chmod 755 {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## | |
## Import an existing git repository (A) into another (B) | |
## | |
## Reference: http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/ | |
## | |
REPO_A="<git repo A url>" | |
REPO_A_DIR="<directory 1>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PREFIX="/path/to/home/dir" | |
mkdir ~/bin | |
mkdir ~/lib | |
source /usr/usc/python/new/setup.sh | |
source /usr/usc/git/default/setup.sh | |
wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Force to run as root | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
SCRIPT_USERNAME=$SUDO_USER | |
DESKTOP_SETUP=0 |