Skip to content

Instantly share code, notes, and snippets.


Mohamed Taher Alrefaie mohataher

View GitHub Profile
mohataher /
Last active Aug 2, 2016 — forked from rtfpessoa/
[Guide] Install Sun Java 8 on Amazon EC2 Ami

First verify the version of Java being used is not Sun Java 8 SDK

java -version

Get the Sun Java 8 SDK from Oracle

wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" ""

Install Sun Java 8

sudo rpm -i jdk-8u73-linux-x64.rpm

Check if the default java version is set to Sun Java 8 SDK

mohataher /
Last active Mar 27, 2016
Gremlin query to close all management instances in Titan database.
mgmt = graph.openManagement()
it=mgmt.getOpenInstances().iterator(); while (it.hasNext()){; if(!nxt.contains("current"))  mgmt.forceCloseInstance(nxt)}
mohataher /
Created Apr 5, 2016
Set up a new Ubuntu instance on EC2
# install oracle 8
# source:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
# install maven and git
sudo apt-get install git maven
mohataher /
Created Jun 1, 2016
How to install printers on Ubuntu at Loughborough University

How to install printers on Ubuntu at Loughborough University

Install SMB Client

The university use SMB client to communicate; it doesn't come prepacked so you need to install it.

sudo apt-get install smbclient
mohataher / hr.csv
Created Jan 24, 2018
View hr.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 26 columns, instead of 12. in line 2.
Name,Sport,Date,Start time,Duration,Total distance (km),Average heart rate (bpm),Average speed (km/h),Max speed (km/h),Average pace (min/km),Max pace (min/km),Calories,Fat percentage of calories(%),Average cadence (rpm),Average stride length (cm),Running index,Training load,Ascent (m),Descent (m),Notes,Height (cm),Weight (kg),HR max,HR sit,VO2max,
Sample rate,Time,HR (bpm),Speed (km/h),Pace (min/km),Cadence,Altitude (m),Stride length (m),Distances (m),Temperatures (C),Power (W),
import pandas as pd
import datetime
import time
with open("hr.csv") as fp:
for i, line in enumerate(fp):
if i == 1:
View english-pronouns-list
You can’t perform that action at this time.