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

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 / 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 / clawbotiq_joystick.c
Last active April 12, 2018 20:11
Clawbot IQ Joystick sample program
#pragma config(Motor, port1, leftMotor, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port6, clawMotor, tmotorVex269, openLoop, reversed)
#pragma config(Motor, port7, armMotor, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port10, rightMotor, tmotorVex393, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main ()
{
@alghanmi
alghanmi / dirmngr.conf
Created August 1, 2017 02:42
GPG Config
keyserver hkps://hkps.pool.sks-keyservers.net
@alghanmi
alghanmi / vps_prep.sh
Last active April 8, 2018 01:55
Prepare a Debian VPS for Ansible Run
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
# Set User information
export _USER="rami"
export _NAME="Rami AlGhanmi"
#!/bin/bash
##
## Download the RSS feed of a podcast
## Args: $1 -- destination file
## $2 -- URL for podcast feed
## TODO:
## - validate parameters
## - ensure log location exists
@alghanmi
alghanmi / macos_iso_to_usb.sh
Created April 8, 2016 04:55
Create a USB drive from ISO image on Mac
# Convert ISO to IMG format
hdiutil convert -format UDRW -o iso-image.img iso-image.iso
# Find USB Drive number N
diskutil list
diskutil unmountDisk /dev/diskN
# Write image to drive /dev/diskN where N is the disk number
sudo dd if=iso-image.img.dmg of=/dev/diskN
$ st2 run core.remote hosts=100.73.114.124 whoami
.
id: 56847659a8479506930a36d7
status: failed
parameters:
cmd: whoami
hosts: 100.73.114.124
result:
error: "Unable to connect to any one of the hosts: [u'100.73.114.124'].
@alghanmi
alghanmi / ansible.cfg
Last active April 8, 2018 01:55
Ansible OpenStack Test
[defaults]
inventory = hosts
log_path = logs/ansible.log
host_key_checking = no
record_host_keys = no
ssh_args = -o ControlMaster=auto -o ControlPersist=30m
gather_facts = smart
library = /opt/ansible/lib:
@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