Skip to content

Instantly share code, notes, and snippets.

View tuxdna's full-sized avatar

Saleem Ansari tuxdna

View GitHub Profile
@tuxdna
tuxdna / script.py
Last active January 27, 2019 08:45
Tensorflow example eval
import tensorflow as tf
tf.reset_default_graph()
s1 = tf.Session()
g = tf.get_default_graph()
foo_var = tf.Variable(42, name='foo')
assign_14 = foo_var.assign(14, name="assign_14")
assign_17 = foo_var.assign(17, name="assign_17")
@tuxdna
tuxdna / install-janusgraph.md
Last active January 30, 2019 18:55
Setup JanusGraph with HBASE backend

Setup JanusGraph with HBASE backend

Install following

  • hbase-1.2.9
  • janusgraph-0.2.2-hadoop2

HBASE Setup and inspection

@tuxdna
tuxdna / connect-vpn.sh
Last active March 31, 2019 06:27
IPSec VPN connection using Shrew VPN Client and OpenVPN Clinet on Linux
IFACE=wlo1
VPN_MTU=1380
WL_MTU=$(cat /sys/class/net/$IFACE/mtu)
ip a | grep 'state UP'
echo "Checking: $IFACE MTU=$WL_MTU and VPN requires MTU=$VPN_MTU"
if [ "$WL_MTU" -gt "$VPN_MTU" ]
then
@tuxdna
tuxdna / using_git-svn.md
Last active November 29, 2018 05:29 — forked from rickyah/using_git-svn.md
A simple guide to git-svn

Getting started with git-svn

git-svn is a git command that allows using git to interact with Subversion repositories.git-svn is part of git, meaning that is NOT a plugin but actually bundled with your git installation. SourceTree also happens to support this command so you can use it with your usual workflow.

Reference: http://git-scm.com/book/en/v1/Git-and-Other-Systems-Git-and-Subversion

Cloning the SVN repository

You need to create a new local copy of the repository with the command

@tuxdna
tuxdna / README.md
Last active October 10, 2018 07:47
Mointoring NVIDIA GPUs

Mointoring NVIDIA GPUs

List NVIDIA GPUs available

$ nvidia-smi --query-gpu=gpu_name --format=csv,noheader
GeForce GTX 1050

Monitor GPU stats ( temperature, utlilization, memory )

@tuxdna
tuxdna / README.md
Last active March 10, 2023 13:02
Git clone without deep history

Git references

Git clone without deep history

Git clone without deep history make cloning faster when we only need the latest code.

With full history

First run

@tuxdna
tuxdna / output.md
Created August 27, 2018 06:30
Pivot example - stackoverflow.com/questions/52033359
$ python3 pivot-pandas.py
        date stock_code  price
0 2018-08-27        001   10.0
1 2018-08-27        002   11.0
2 2018-08-27        003   12.0
3 2018-08-27        004   13.0
4 2018-08-26        001   14.0
5 2018-08-26 002 15.0
@tuxdna
tuxdna / readme.md
Last active May 28, 2018 12:27
Learn gradle

Groovy

//System.out.println("Hello World!")
//println("Hello World!")
//
//println "Hello World!"
//

class MyClass {
@tuxdna
tuxdna / gantt_charts.ipynb
Last active March 22, 2018 12:13
GraphImporter issue
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tuxdna
tuxdna / README.md
Last active February 13, 2018 21:34
Probability problem

Given a 6 sided dice, how many number of throws are required to guarantee a 6 as output?

This solution is basically finding expectation over 1 roll, 2 rolls, 3 rolls ... and so on until infinite rolls of dice. Basically SUM( k * P(rolls=k)) for k = 1 to infinity. Now probability we get a 6 in exactly kth roll is defined as P(rolls=k) = q^(k-1) * p, where p is probability we get a 6 in kth roll, and q^(k-1) is probability we do not get a 6 in all k-1 rolls. I guess it still cannot guarantee that we will always get a 6, rather that if we roll on average of 6 times in a row, we will get definitely get a 6. Quite interesting problem indeed.

References: