Skip to content

Instantly share code, notes, and snippets.

Saleem Ansari tuxdna

Block or report user

Report or block tuxdna

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
@tuxdna
tuxdna / betareg.py
Created May 27, 2019 — forked from brentp/betareg.py
beta regression in statsmodels
View betareg.py
# -*- coding: utf-8 -*-
u"""
Beta regression for modeling rates and proportions.
References
----------
Grün, Bettina, Ioannis Kosmidis, and Achim Zeileis. Extended beta regression
in R: Shaken, stirred, mixed, and partitioned. No. 2011-22. Working Papers in
Economics and Statistics, 2011.
@tuxdna
tuxdna / README.md
Created Apr 30, 2019
Convert hex data ( binary array ) back to floats in Java
View README.md

Python Data:

Dimension: 2 x 768

[array([-7.3584e-01, -1.9531e-03, -6.8970e-03, -6.0303e-01, -2.1008e-01,
        -4.2114e-03,  2.0935e-02,  3.6157e-01, -1.7712e-01, -3.5449e-01,
        -4.4629e-01, -1.0791e-01,  2.7563e-01,  1.0791e-01, -3.0664e-01,
        -6.1676e-02, -2.9468e-01,  2.1594e-01, -1.3232e-01,  1.3171e-01,
        -4.1772e-01,  9.2346e-02, -4.5239e-01, -1.3147e-01,  2.9175e-01,
@tuxdna
tuxdna / crop-all.py
Created Feb 27, 2019
Python script to crop images
View crop-all.py
# find . -name "Screenshot*.png" -exec python3 crop-all.py "{}" \;
import sys
import os
import subprocess
top_left = (33, 213)
bot_right = (910, 780)
width = bot_right[0] - top_left[0]
@tuxdna
tuxdna / script.py
Last active Jan 27, 2019
Tensorflow example eval
View script.py
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 Jan 30, 2019
Setup JanusGraph with HBASE backend
View install-janusgraph.md

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 Mar 31, 2019
IPSec VPN connection using Shrew VPN Client and OpenVPN Clinet on Linux
View connect-vpn.sh
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 Nov 29, 2018 — forked from rickyah/using_git-svn.md
A simple guide to git-svn
View using_git-svn.md

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 Oct 10, 2018
Mointoring NVIDIA GPUs
View README.md

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 )

You can’t perform that action at this time.