Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
to infinity and beyond

Roman Niukhalov nyukhalov

🚀
to infinity and beyond
View GitHub Profile
@nyukhalov
nyukhalov / udacity-ros-vm-clipboard-fix.sh
Created Feb 9, 2019
Fixes shared clipboard between host MacOS and Udacity's ROS VM running in VirtualBox
View udacity-ros-vm-clipboard-fix.sh
sudo apt-get update
sudo apt-get install xserver-xorg-core
sudo apt-get install -f virtualbox-guest-x11
sudo VBoxClient --clipboard
@nyukhalov
nyukhalov / bruteforce_unzip.py
Created Jan 22, 2019
unzips an archive using a password generated from a dictionary
View bruteforce_unzip.py
from itertools import permutations
from zipfile import ZipFile
archive = 'archive.zip'
keywords = [
'foo',
'bar',
'buzz'
]
@nyukhalov
nyukhalov / homogenous_transformation.py
Created Dec 23, 2018
Homogenous Transformation for Particle Filter
View homogenous_transformation.py
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 / shdb.sh
Last active May 4, 2018
The simplest key-value db written in shell
View shdb.sh
#!/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 / subtitle-extract.txt
Created Aug 6, 2017 — forked from bmaeser/subtitle-extract.txt
extract subtitles from *.mkv-files on osx
View subtitle-extract.txt
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 / jenkins_copying_configuration.sh
Created Jan 12, 2017 — forked from mriddle/jenkins_copying_configuration.sh
Moving Jenkins server configuration from one server to another
View jenkins_copying_configuration.sh
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 / latency.txt
Created Dec 13, 2016 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
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