Skip to content

Instantly share code, notes, and snippets.


Sergei Silnov kumekay

View GitHub Profile
kumekay /
Created Oct 18, 2017
Ubuntu 16.04 (including WSL) Erlang compilation rather minimal dependencies
sudo apt update
sudo apt install -y build-essential autoconf libncurses5-dev libssh-dev
kumekay / domains.js
Created Oct 1, 2017
Extract all domains through browser console
View domains.js
let links = document.querySelectorAll( "a" );
let hosts = []
links.forEach ( (l) => { hosts.push("www.", ""))})
const domains = new Set(hosts)
View apas_test_client.rb
require 'socket'
server ='APAS_TCP_SERVER', 'localhost'),
ENV.fetch('APAS_TCP_PORT', '4040'))
ready = server.gets(5)
puts ready
loop do
msg = rand > 0.1 ? "AT_pour_amb=#{100 + rand(200).to_i};" : 'AT_bottle_changed=1;'
puts msg
'''Neural style transfer with Keras.
Before running this script, download the weights for the VGG16 model at:
and make sure the variable `weights_path` in this script matches the location of the file.
Run the script with:
python path_to_your_base_image.jpg path_to_your_reference.jpg prefix_for_results
VIDEO_LENGTH="$(ffprobe -i input.mp4 -show_format | grep duration | sed 's/[A-Za-z=]*//g')"
ffmpeg -i $INPUT_VIDEO -vf fps=40/$VIDEO_LENGTH out/frame%02d.jpg
kumekay /
Last active Jul 25, 2016
Web camera on Intel Edison with uploads to s3
photo_timestamp=$(date +%Y-%m-%d_%H%M)
fswebcam -r 1280x720 --jpeg 100 -D 3 -S 13 "${photo_timestamp}.jpg"
aws s3 cp "$photo_timestamp.jpg" "s3://$s3_bucket" && \
aws s3 cp "$photo_timestamp.jpg" "s3://$s3_bucket/latest.jpg" --acl public-read && \
rm "$photo_timestamp.jpg"
kumekay / parser.ex
Last active Mar 29, 2016 — forked from cromwellryan/parser.ex
JSON Parser in Elixir
View parser.ex
defmodule JSON do
import String
def parse( content ) do
case parse_content(content) do
{ value, "" } -> value
{ _, _ } -> raise "crap"
kumekay / JoystickKeyboard.ino
Created Feb 23, 2016
Arduino micro sketch: using joystick as keyboard with arrows and enter
View JoystickKeyboard.ino
Written by Sergei Silnov @kumekay
Based on:
#include "HID-Project.h"
const int pinLed = LED_BUILTIN;
kumekay / autossh.conf
Last active Feb 8, 2016
Reverse SSH tunnel with autossh started with upstart for ubuntu. Allows to connect to computer hidden behind NAT over SSH. Good replacement for vpn in some cases
View autossh.conf
# File: /etc/init/autossh.conf
# Start ssh tunnel after network for specified user
description "Start autossh reverse tunnel"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on runlevel [016]
respawn limit 5 60
kumekay /
Last active Feb 7, 2016
Pushbullet snippet for python
# coding: utf-8
# ## Pushbullet routine
# usage:
# import sys
# sys.path.insert(0, '../tools')
# from tools.pushme import pushme
# pushme('anna', 'title', 'body')
# pushme('anna','accuracy', str(0.25))