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
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 / get-plex-toekn.sh
Created Aug 27, 2019
Obtain Permanent Plex Token
View get-plex-toekn.sh
curl -X POST \
-H 'X-Plex-Version: 0.3.0' \
-H 'X-Plex-Product: YOUR PRODUCT NAME' \
-H 'X-Plex-Client-Identifier: YOUR-PRODUCT-ID' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
--data-urlencode 'user[password]=PLEX_PASSWORD' \
--data-urlencode 'user[login]=PLEX_USERNAME' \
https://plex.tv/users/sign_in.json
@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 / 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 / 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 = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_compress",
"mod_expire",
@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 / 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: http://redmine.lighttpd.net/wiki/1/Mimetype.assignDetails
##
mimetype.use-xattr = "disable"
@alghanmi
alghanmi / import_git2git.sh
Last active Dec 21, 2018
Import an existing git repository (A) into another (B)
View import_git2git.sh
#!/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>"
@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 / google-authenticator.sh
Created Jul 28, 2013
Setup Google Authenticator on OpenVPN
View google-authenticator.sh
sudo aptitude install libpam0g-dev
git clone https://code.google.com/p/google-authenticator/
cd google-authenticator/libpam/
make
sudo make install
google-authenticator
sudo cp /etc/pam.d/common-account /etc/pam.d/openvpn
You can’t perform that action at this time.