Skip to content

Instantly share code, notes, and snippets.

@abijith-kp
abijith-kp / monitor.py
Created November 8, 2016 17:11
Monitor file change for a python script and restart the script automatically.
import pyinotify
import sys
import subprocess
import os
import click
def restart(filename):
p = subprocess.Popen(['python', filename])
print("Process ID of subprocess %s" % p.pid)
return p
@abijith-kp
abijith-kp / gist:373b8fecad11a4ef6bbe
Created August 27, 2014 02:43
give a video link as input to download mp3 from all sites supported by youtube-dl
#!/bin/bash
youtube-dl --extract-audio --audio-format mp3 "$1"
@abijith-kp
abijith-kp / merge_list.py
Created July 25, 2014 07:52
Merges a list of lists, in such a way that if any of the inner lists have same elements.
from timeit import Timer
def uniq(a):
l = []
[l.append(i) for i in a if i not in l]
return l
def intersect(a, b):
return [i for i in a if i in b]
import jellyfish
def fuzzy_set(string_list, similarity_ratio):
'''
Input : List of strings
Output : Set of strings. All similar kinds of strings are merged together
and the most
'''
string_list = list(set(string_list))
string_list.sort()
@epixoip
epixoip / cloudflare_challenge
Last active December 2, 2023 11:53
How I obtained the private key for www.cloudflarechallenge.com
I wasn't first to get the key. Nor was I second, third, or even fourth. I'm probably not even the
10th to get it (ok, looks like I was the 8th.) But I'm happy that I was able to prove to myself
that I too could do it.
First, I have to admit I was a skeptic. Like the handful of other dissenters, I had initially
believed that it would be highly improbable under normal conditions to obtain the private key
through exploiting Heartbleed. So this was my motivation for participating in Cloudflare's
challenge. I had extracted a lot of other things with Heartbleed, but I hadn't actually set out to
extract private keys. So I wanted to see first-hand if it was possible or not.
@MicahElliott
MicahElliott / arch-augment-vim-for-python.md
Created July 4, 2012 18:01
Configure vim in arch linux for python runtime support

Steps to upgrade vim in arch linux for python runtime support

Python support is needed by vim in order to run things like Conque and Slimv. Arch keeps vim slim by only providing Python support in gvim. But you may prefer vim to gvim, so here's what's needed.

More ABS info.

# Install and run abs (sync)

sudo pacman -S abs