Skip to content

Instantly share code, notes, and snippets.

View ranarag's full-sized avatar
:octocat:
hi

Anurag Roy ranarag

:octocat:
hi
  • India
View GitHub Profile
@ranarag
ranarag / class_mapping.txt
Last active June 24, 2023 11:56
ImageNet-R class mapping
0 ladybug
1 jeep
2 wood_rabbit
3 lighthouse
4 carousel
5 orangutan
6 collie
7 beagle
8 grey_whale
9 birdhouse
@ranarag
ranarag / openvpn_gen.py
Created March 1, 2018 13:59 — forked from Justasic/openvpn_gen.py
This is a python script to generate client OpenVPN configuration files. This is based mostly on the easyrsa script and is much simpler to understand.
import os
import socket
from OpenSSL import crypto, SSL
# OpenVPN is fairly simple since it works on OpenSSL. The OpenVPN server contains
# a root certificate authority that can sign sub-certificates. The certificates
# have very little or no information on who they belong to besides a filename
# and any required information. Everything else is omitted or blank.
# The client certificate and private key are inserted into the .ovpn file
# which contains some settins as well and the entire thing is then ready for
@ranarag
ranarag / README.md
Created March 1, 2018 13:58 — forked from Lazza/README.md
VPNGate Python script

vpngate.py

This script allows to use the free VPN service provided by VPNGate in an easy way. The user just needs to provide the desidered output country, and the script automatically chooses the best server.

After this step, OpenVPN is launched with the proper configuration. The VPN can be terminated by pressing Ctrl+C.

Usage

Run the script by providing the desired output country:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@ranarag
ranarag / gist:622df707a38dd4d1e7cf93f0871adaf0
Created December 9, 2017 18:29
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@ranarag
ranarag / remastersys
Created August 8, 2017 18:10 — forked from wagung/remastersys
remastersys customize
#!/bin/bash
# remastersys script to make an installable livecd/dvd from an (XK)Ubuntu installed
# and customized system
#
#
# Created by Tony "Fragadelic" Brijeski
#
# Copyright 2007,2008 Under the GNU GPL2 License
#
@ranarag
ranarag / Machine Learning Curriculum.md
Created August 7, 2017 12:20 — forked from offchan42/Machine Learning Curriculum.md
Machine learning resources and related artificial intelligence concepts.

ATTENTION PLEASE

Please see that repository instead because you can make pull requests there and later updates will be pushed there too.

===

# Machine Learning Curriculum Machine Learning is a branch of Artificial Intelligence dedicated at making machines learn from observational data without being explicitly programmed.
@ranarag
ranarag / tf_cosineSim.py
Created March 20, 2017 02:12
Function to calculate Cosine Similarity in Tensorflow
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-03-20 07:15:37
# @Author : Anurag Roy ([email protected])
# @Link : ranarag.github.io
# @Version : 1.0.0
import os
import tensorflow as tf
from sklearn.metrics.pairwise import cosine_similarity
@ranarag
ranarag / gmail_notifier.py
Created November 18, 2016 12:48
simple gmail notifier coded in python3
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Anurag Roy <[email protected]>
#
# Distributed under terms of the MIT license.
import email