Skip to content

Instantly share code, notes, and snippets.

View alghanmi's full-sized avatar

Rami AlGhanmi alghanmi

  • University of Southern California
  • Los Angeles, CA
View GitHub Profile
@alghanmi
alghanmi / get-plex-toekn.sh
Created August 27, 2019 16:34
Obtain Permanent Plex Token
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 / curl_example.cpp
Created May 5, 2014 20:12
cURL C++ Example
#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 / podcastgen.py
Last active October 18, 2023 21:49
Podcast Feed Generator -- Generate an podcast RSS feed for a set of media in a directory.
"""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 October 17, 2023 00:02
Install OverDrive Media Console on Linux

##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 March 2, 2022 19:21
Lighttpd Default Configuration File
server.port = 80
#server.bind = ""
server.tag ="lighttpd"
server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_compress",
"mod_expire",
@alghanmi
alghanmi / render-md.py
Created January 25, 2013 08:43
Render a Markdown document using the GitHub markdown API
import argparse
import requests
import simplejson
def gitHubPost(text, mode, context):
"""Send a POST request to GitHub via API """
payload = {'text': text, 'mode':mode}
if context != None:
payload['context'] = context
@alghanmi
alghanmi / wps_openwrt.sh
Last active January 28, 2021 00:47
WPS on OpenWRT -- Enabling Wi-Fi Protected Setup on OpenWRT
##
## 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 July 4, 2012 06:36
Lighttpd MimeType Configuration File
## 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"

Keybase proof

I hereby claim:

  • I am alghanmi on github.
  • I am alghanmi (https://keybase.io/alghanmi) on keybase.
  • I have a public key whose fingerprint is 6C49 280A 93B7 86C8 AFA5 7005 F51C B834 873A C720

To claim this, I am signing this object:

@alghanmi
alghanmi / dokuwiki-setup.sh
Created September 20, 2014 03:36
Dokuwiki Setup
#!/bin/bash
##Install some extra packages for FPM
sudo aptitude install php5-fpm php5-gd php5-mcrypt
##Tigten PHP security
#Disable path info
sudo cp /etc/php5/fpm/php.ini /etc/php5/fpm/php.ini.default
sudo sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php5/fpm/php.ini
#Change PHP to use sockets instead of ports --already done by default in Debian & Ubuntu