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 | |
## Check if g++-4.8 is installed | |
_GPP_PREF_VER="4.8" | |
_GPP_LOC="$(readlink -f $(which g++))" | |
_GPP_VER="$(g++ --version | head -1 | sed 's/g++ \(.*\) \(.*\)/\2/' - | cut -d. -f1,2)" | |
if [ "$_GPP_LOC" == "/usr/bin/g++-$_GPP_PREF_VER" ]; then | |
if [ "$_GPP_VER" != "$_GPP_PREF_VER" ]; then | |
echo "Please contact your TA and inform them that you have g++-$_GPP_PREF_VER installed, but it is not the default g++ on your system" |
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
#Setup spf13-vim | |
# Assumes MacOS has homebrew install | |
# Assumes Linux is Debian based | |
#Install spf13-vim | |
curl http://j.mp/spf13-vim3 -L -o - | sh | |
if [ "$(uname)" = "Darwin" ]; then | |
brew install ctags | |
elif [ "$(uname)" = "Linux" ]; then |
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 | |
# | |
# Batch rename assignment submission files. | |
# Input format: PA1 Submission_username_attempt_2014-02-06-14-05-19_tp.cpp.zip | |
# Output format: pa1_username.zip | |
# Accepted file formats: zip and gz | |
# | |
USAGE_MESSAGE="Perform a batch rename or all submission files in a directory. |
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
SCRIPT_USERNAME="usclug" | |
SCRIPT_USERHOME="/home/$SCRIPT_USERNAME" | |
echo "**" | |
echo "** System Setup" | |
echo "**" | |
cp /etc/apt/sources.list /etc/apt/sources.list.default | |
echo "deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free" | tee /etc/apt/sources.list | |
echo "deb-src http://ftp.us.debian.org/debian/ wheezy main contrib non-free" | tee -a /etc/apt/sources.list | |
echo "" | tee -a /etc/apt/sources.list |
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
#Replace the information in double quotes with your info | |
export USER_EMAIL="myemail@mydomain.tld" | |
export USER_NAME="myFirstName myLastName" | |
export HW5_LOCATION="~/hw5" | |
#Generate public/private key-pair on aludra | |
ssh-keygen -t rsa -b 4096 -C "$USER_EMAIL" | |
#Setup git in PATH | |
echo "source /usr/usc/git/default/setup.csh" >> ~/.cshrc |
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
export PS1='\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[00m\]: ' | |
export PS1='\[\033[0;32m\]\h\[\033[0;36m\] \w\[\033[00m\]: ' |
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 | |
# Some text available in the file | |
SAMPLE_TEXT=$1 | |
# The dev path for the media with the deleted file, e.g. /dev/sda2 | |
HDD=$2 | |
# The file used to store the output | |
RECOVERY_FILE=$3 |
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 | |
WEB_PAGE=$1 | |
ADMIN_EMAIL=$2 | |
EMAIL_SIGNATURE="Sent by $USER@$(hostname) on $(date)" | |
# Get HTTP server response code | |
result=$(curl -s -I $WEB_PAGE | grep HTTP/1.1 | awk {'print $2'}) | |
# Report a non-responsive server | |
if [ ! -n "$result" ] |
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
dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync |
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
-- Calculate Database Size | |
SELECT table_schema "Database_Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", sum( data_free )/ 1024 / 1024 "Free Space in MB" | |
FROM information_schema.TABLES | |
GROUP BY table_schema; |
OlderNewer