Skip to content

Instantly share code, notes, and snippets.

@eirenik0
eirenik0 / minions-800x500.jpg
Last active March 4, 2020 14:54
Applitools background test
minions-800x500.jpg
def css_selector_from_(by, value):
if by == By.ID:
value = "#%s" % value
elif by == By.CLASS_NAME:
value = ".%s" % value
elif by == By.NAME:
value = '[name="%s"]' % value
elif by in [By.XPATH, By.CSS_SELECTOR, By.TAG_NAME]:
value = value
else:
@eirenik0
eirenik0 / get_ip.py
Created January 1, 2020 13:22
Get IP address
import requests
def get_public_ip():
try:
r = requests.get('http://ip.o11.net', timeout=(2.0, 2.0))
if r.status_code == 200:
return r.text.rstrip()
except requests.RequestException:
warnings.warn(f'Cannot fetch public ip')
return None
MENHIR lang/lang_parser.mly
OCAMLDEP
OCAMLOPT -c tools/log.mli
OCAMLOPT -c tools/log.ml
OCAMLOPT -c tools/extralib.ml
OCAMLOPT -c tools/JSON.mli
OCAMLOPT -c tools/JSON.ml
OCAMLOPT -c tools/utils.ml
OCAMLOPT -c tools/doc.ml
OCAMLOPT -c tools/plug.ml

Keybase proof

I hereby claim:

  • I am infernion on github.
  • I am infernion (https://keybase.io/infernion) on keybase.
  • I have a public key ASAcms7iPQcbnC8O3K2zDOCBt6alcofbiY_5Y9ue8rw1fAo

To claim this, I am signing this object:

@eirenik0
eirenik0 / deb.yml
Last active October 2, 2019 20:34
Ansible role for install Liquidsoap from OPAM
- apt_key:
keyserver: keyserver.ubuntu.com
id: 20D63CCDDD0F62C2
state: present
- apt_repository:
repo: deb http://deb.liquidsoap.info/ubuntu disco main
state: present
filename: liquidsoap.list
@eirenik0
eirenik0 / install_liquidsoap_latest.sh
Last active September 29, 2019 19:54 — forked from dtcooper/install_liquidsoap_latest.sh
Various Liquidsoap Install Scripts for Ubuntu 16.04 LTS
#!/bin/sh
sudo apt-get install -y build-essential git automake ocamlbuild
mkdir -p "$HOME/liquidsoap-build"
cd "$HOME/liquidsoap-build"
wget https://github.com/savonet/liquidsoap/releases/download/1.3.7/liquidsoap-1.3.7-full.tar.gz
tar xvzf liquidsoap-1.3.7-full.tar.gz
@eirenik0
eirenik0 / restream_to.sh
Last active March 22, 2020 10:49
Get youtube video and restrem to the local rtmp
#!/bin/bash
on_die ()
{
# kill all children
pkill -KILL -P $$
}
trap 'on_die' TERM
youtube-dl -f best "$1" -o - | ffmpeg -re -i pipe:0 -c:v copy -c:a aac -bsf:a aac_adtstoasc -ar 44100 -f flv "$1" &
@eirenik0
eirenik0 / merge_sort.py
Created August 28, 2019 08:12
Python implementation of merge sort
def ordered_combine(lhs, rhs):
lst = []
l_i = r_i = 0
while l_i < len(lhs) and r_i < len(rhs):
if lhs[l_i] < rhs[r_i]:
lst.append(lhs[l_i])
l_i += 1
else:
lst.append(rhs[r_i])
r_i += 1
@eirenik0
eirenik0 / icecast_test.sh
Last active May 3, 2019 21:36
This script was run on each of the 2 load driving nodes. This script will incrementally add listeners to the icecast server at regular intervals; 10 listeners would be added every 10 seconds (with 2 machines, that’s a total of 20 listeners every 10 seconds). http://icecast.org/loadtest/1/
#!/bin/sh
#
# run concurrent curls which download from URL to /dev/null. output total
# and average counts to results directory.
#
# max concurrent curls to kick off
max=600
# how long to stay connected (in seconds)
duration=99999999