Skip to content

Instantly share code, notes, and snippets.

Rami Al-Ghanmi alghanmi

  • University of Southern California
  • Los Angeles, CA
Block or report user

Report or block alghanmi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alghanmi /
Created Apr 25, 2012 — forked from ad510/
shell script to install Git on USC parallel computers without root permissions
# note that this file needs execute permissions to run, which can be done by running "chmod u+rwx ./" (without quotes)
# this script based on:
# update $PATH
echo "# the following two lines added by" >> ~/.bashrc
echo "export PATH=$HOME/opt/bin:$PATH" >> ~/.bashrc
echo ". $HOME/opt/contrib/completion/git-completion.bash" >> ~/.bashrc
. ~/.bashrc
alghanmi /
Created Apr 29, 2012
Showing Your Code to The World
#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
alghanmi /
Created May 3, 2012
Shell Prompts for Bash
export PS1='\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[00m\]: '
export PS1='\[\033[0;32m\]\h\[\033[0;36m\] \w\[\033[00m\]: '
alghanmi /
Created May 13, 2012
Recover an Accidentally Deleted Text File
# Some text available in the file
# The dev path for the media with the deleted file, e.g. /dev/sda2
# The file used to store the output
alghanmi /
Created May 24, 2012
HTTP Status Check - Report any non-200 response to given email address
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" ]
alghanmi /
Created Jun 10, 2012
Test Connection Speed
echo "Network speed testing..."
cachefly=$( wget -O /dev/null 2>&1 | awk '/\/dev\/null/ {if ($4=="-") speed=$2 $3; else speed=$3 $4;} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from CacheFly: $cachefly "
linodeatl=$( wget -O /dev/null 2>&1 | awk '/\/dev\/null/ {if ($4=="-") speed=$2 $3; else speed=$3 $4;} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Linode, Atlanta GA: $linodeatl "
linodedltx=$( wget -O /dev/null 2>&1 | awk '/\/dev\/null/ {if ($4=="-") speed=$2 $3; else speed=$3 $4;} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Linode, Dallas, TX: $linodedltx "
linodejp=$( wget -O /dev/null 2>&1 | awk '/\/dev\/null/ {if ($4=="-") speed=$2 $3; else speed=$3 $4;} END {gsub(/\(|\)/,"",speed); print speed}' )
dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync
alghanmi / mysql_db-size-calculator.sql
Created Jun 26, 2012
Calculate Table Size in MySQL
View mysql_db-size-calculator.sql
-- 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;
alghanmi / 20-mimetype.conf
Created Jul 4, 2012
Lighttpd MimeType Configuration File
View 20-mimetype.conf
## MimeType handling
## -------------------
## Use the "Content-Type" extended attribute to obtain mime type if
## possible
## Source:
mimetype.use-xattr = "disable"
alghanmi / lighttpd.default.conf
Last active Jul 31, 2019
Lighttpd Default Configuration File
View lighttpd.default.conf
server.port = 80
#server.bind = ""
server.tag ="lighttpd"
server.modules = (
You can’t perform that action at this time.