Skip to content

Instantly share code, notes, and snippets.

View nyukhalov's full-sized avatar
🚀
to infinity and beyond

Roman Niukhalov nyukhalov

🚀
to infinity and beyond
View GitHub Profile
@nyukhalov
nyukhalov / latency.txt
Created December 13, 2016 11:20 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@nyukhalov
nyukhalov / jenkins_copying_configuration.sh
Created January 12, 2017 07:30 — forked from mriddle/jenkins_copying_configuration.sh
Moving Jenkins server configuration from one server to another
ORIGINAL_JENKINS_SERVER=
ORIGINAL_SERVER_USER=
NEW_JENKINS_SERVER=
NEW_SERVER_USER=
# ON THE ORIGINAL JENKINS SERVER
ssh $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER
cd /var/lib/jenkins/
for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar
@nyukhalov
nyukhalov / subtitle-extract.txt
Created August 6, 2017 10:13 — forked from bmaeser/subtitle-extract.txt
extract subtitles from *.mkv-files on osx
lines with $ are commands
### install mkvtoolnix:
$ brew install mkvtoolnix
### list content of the mkv-file:
$ mkvmerge -i mymoviefile.mkv
### what will give you:
@nyukhalov
nyukhalov / shdb.sh
Last active May 4, 2018 05:03
The simplest key-value db written in shell
#!/bin/bash
# Usage
# > ./shdb.sh db_set foo 3
# > ./shdb.sh db_set bar 5
# > ./shdb.sh db_get foo
# 3
db_set() {
echo "$1,$2" >> database
@nyukhalov
nyukhalov / homogenous_transformation.py
Created December 23, 2018 08:33
Homogenous Transformation for Particle Filter
import numpy as np
import math
def h_transform(observation_coords, particle_coords, particle_heading):
mat = np.matrix([
[math.cos(particle_heading), -math.sin(particle_heading), particle_coords[0]],
[math.sin(particle_heading), math.cos(particle_heading), particle_coords[1]],
[0, 0, 1]
])
vec = np.matrix([
@nyukhalov
nyukhalov / bruteforce_unzip.py
Created January 22, 2019 04:37
unzips an archive using a password generated from a dictionary
from itertools import permutations
from zipfile import ZipFile
archive = 'archive.zip'
keywords = [
'foo',
'bar',
'buzz'
]
@nyukhalov
nyukhalov / udacity-ros-vm-clipboard-fix.sh
Created February 9, 2019 09:54
Fixes shared clipboard between host MacOS and Udacity's ROS VM running in VirtualBox
sudo apt-get update
sudo apt-get install xserver-xorg-core
sudo apt-get install -f virtualbox-guest-x11
sudo VBoxClient --clipboard