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
alghanmi / wps_openwrt.sh
Last active Jul 16, 2019
WPS on OpenWRT -- Enabling Wi-Fi Protected Setup on OpenWRT
View wps_openwrt.sh
##
## WPS on OpenWRT
## This script enables Wi-Fi Protected Setup on OpenWRT.
##
## Resources
## http://wiki.openwrt.org/doc/uci/wireless#wps.options
##
#Install the full wpad package
opkg update
@alghanmi
alghanmi / Makefile
Created Jun 11, 2014
Sample Makefile for CS 104 homework question
View Makefile
IDIR =.
CC=g++
CFLAGS=-I$(IDIR) -std=c++11 -ggdb
ODIR=.
LDIR =../lib
LIBS=-lm
_DEPS = shape.h
View curl_example.cpp
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
@alghanmi
alghanmi / OverDriveMediaConsole.md
Last active Aug 11, 2019
Install OverDrive Media Console on Linux
View OverDriveMediaConsole.md

##OverDrive Media Console OverDrive is a very common provider for eBooks and Audiobooks for the many public libraries. The ODMC is the application used to download resources.

OD now supports MP3 for all its audio-books and epub for their ebooks. This allows you to use it on Linux.

##Install and Setup ###Step 1. Dependencies To use ODMC on Linux, you need to install wine and winetricks. On a debian-based system, you can do:

sudo aptitude install wine winetricks
@alghanmi
alghanmi / podcastgen.py
Last active Aug 24, 2019
Podcast Feed Generator -- Generate an podcast RSS feed for a set of media in a directory.
View podcastgen.py
"""Podcast Feed Generator
Generate an podcast RSS feed for a set of media in a directory.
Use the list-extensions argument to see the list of supported extensions. You can add custom extensions using
Usage:
podcastgen.py gen <directory> --title=<podcast-title> --link=<podcast-link> --desc=<description> [--output=<rss-feed-file>] [--feed-link=<feed-url>] [--id=<podcast-id>] [--logo=<image_file>] [--category=<itunes-category> [--subcategory=<itunes-category>]] [--language=<language>] [--use-extension=<ext>]
podcastgen.py list-categories
podcastgen.py list-extensions
podcastgen.py -h | --help
@alghanmi
alghanmi / gtest_install.sh
Last active Mar 6, 2017
Install Google C++ Testing Framework. This script works for both MacOS and Linux
View gtest_install.sh
##
## Install Google C++ Testing Framework
##
##Remove Libraries that are already installed
# Linux:
# sudo rm -rf /usr/local/opt/gtest*
# sudo libtool --mode=uninstall rm /usr/local/lib/libgtest.a
# sudo libtool --mode=uninstall rm /usr/local/lib/libgtest_main.a
@alghanmi
alghanmi / usclug-vm.sh
Last active Aug 29, 2015
USCLUG VM Generation Script for Workshops
View usclug-vm.sh
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
@alghanmi
alghanmi / bitlbee-init.sh
Last active Nov 27, 2018
init scripts for IRC services as daemon -- znc and Bitlbee
View bitlbee-init.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: bitlbee
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Bitlbee IRC to other chat networks gateway
### END INIT INFO
@alghanmi
alghanmi / batch-rename.sh
Created Feb 9, 2014
Rename a set of files in a directory
View batch-rename.sh
#!/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.
@alghanmi
alghanmi / gcc-default-fix.sh
Last active May 11, 2017
Change the default g++ compiler on MacOS to be the brew version
View gcc-default-fix.sh
#
# Make gcc-4.8 the default compiler
# brew installs gcc-4.8, but does not create symlinks for it to be used
# without the version number.
# This script:
# 1. Generate symlinks for all gcc tools installed by brew
# 2. Make brew-installed software the first in path
#
BREW_CMD="brew"
You can’t perform that action at this time.