Skip to content

Instantly share code, notes, and snippets.

@kisel
kisel / .gitignore
Last active January 11, 2018 18:11
Tap interface test
tun

ANS TCP STACK

echo 0 | sudo tee /proc/sys/kernel/randomize_va_space

cd $DPDK modprobe uio insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko

./usertools/dpdk-devbind.py --bind=igb_uio 00:08.0 ./usertools/dpdk-devbind.py --bind=igb_uio 00:09.0

@kisel
kisel / zeromq_demo_publisher.py
Created November 3, 2017 11:25 — forked from ramn/zeromq_demo_publisher.py
Python ZeroMQ pub/sub example
import time.sleep
import zmq
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind('tcp://127.0.0.1:2000')
# Allow clients to connect before sending data
sleep(10)
socket.send_pyobj({1:[1,2,3]})
@kisel
kisel / runtastic-export-all-activities.md
Last active July 5, 2016 17:55
Download all activities from Runtastic.com (as .gpx)

Download all activities from Runtastic 🏃

With this script you can download all your activities from www.runtastic.com in .tcx format. Runtastic removed this feature wich makes it very difficult to change your tracking service, thanks for that.

Fork changes: it downloads .tcx instead of .gpx and supports large files(original implementation fails with Netowork error and the Downloads page crashes due to huge size of a.href)

How does it work

Login to your runtastic account and go to the page where all your activities are listed. Then open the developer tools of Chrome with CMD + OPTION + I and go to the console tab. Now copy and paste the following script in the console line and press enter. The usually content should disapear and the downloads should start. I used it to export around 290 activities and it worked fine.

@kisel
kisel / killcx
Last active March 7, 2024 12:30
killcx
#!/usr/bin/perl
######################################################################
# killcx :
#
# Close a TCP connection under Linux.
#
# (c) Jerome Bruandet - <floodmon@spamcleaner.org>
#
# version 1.0.3 - 18-May-2011
#
// gcc -I . -L./.libs -lcares ares-custom-dns-test.c;
#include <ares.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdarg.h>
#include <string.h>
/*
usage:
gcc -o show_c_sizeof show_c_sizeof.c && ./show_c_sizeof
*/
#include <stdio.h>
#define S(type) \
printf("sizeof(" #type ") = %d\n", (int)(sizeof(type)))
@kisel
kisel / install_vim_vundle.sh
Created May 1, 2014 10:46
vimrc with vundle
#!/bin/sh
# curl -L https://gist.githubusercontent.com/kisel/11449026/raw/install_vim_vundle.sh | sh
sudo apt-get install -y git
mkdir -p $HOME/.vim
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
curl -L --output ~/.vimrc https://gist.githubusercontent.com/kisel/11449026/raw/vimrc
cat <<END > ~/.tmux.conf
set -g default-terminal "screen-256color"
END
@kisel
kisel / jenkins_on_docker.sh
Created February 22, 2014 14:51
Installs Jenkins on Ubuntu
#!/bin/sh
apt-get update
apt-get install -y wget
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
apt-get update
apt-get install -y jenkins
service jenkins start
echo "Jenkins is available at 8080 port"
@kisel
kisel / install_opencart.sh
Created January 5, 2014 20:18
Install Opencart on docker container
#!/bin/sh
echo 'deb http://archive.ubuntu.com/ubuntu precise main universe' > /etc/apt/sources.list
apt-get update
apt-get install -y mysql-server curl apache2 git-core php5 php5-mysql php5-curl php5-gd php5-mcrypt
#dpkg-divert --local --rename --add /sbin/initctl
#ln -s /bin/true /sbin/initctl