Skip to content

Instantly share code, notes, and snippets.

View kumekay's full-sized avatar

Sergei Silnov kumekay

View GitHub Profile
@kumekay
kumekay / prepare_image.sh
Last active August 29, 2015 14:22
Proxmox ubuntu 14.04 OpenVZ
# List of images
# https://openvz.org/Download/template/precreated
cd /var/lib/vz/template/cache/
wget http://download.openvz.org/template/precreated/ubuntu-14.04-x86_64.tar.gz
wget http://download.openvz.org/template/precreated/ubuntu-14.04-x86_64.tar.gz.asc
# Show key
gpg ubuntu-14.04-x86_64.tar.gz.asc
# Example: gpg: Signature made Sat May 16 00:57:35 2015 CEST using DSA key ID A7A1D4B6
gpg --keyserver pgpkeys.mit.edu --recv-key A7A1D4B6
@kumekay
kumekay / note.txt
Created June 13, 2015 07:11
ubuntu locale
# add to /etc/default/locale
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
@kumekay
kumekay / GalileoBMP085.ino
Last active August 29, 2015 14:23
Galileo sketches
#include <Wire.h>
#include <Adafruit_BMP085.h>
//
Adafruit_BMP085 bmp;
void setup() {
Serial.begin(9600);
if (!bmp.begin()) {
Serial.println("Could not find BMP085 sensor");
@kumekay
kumekay / mindwave.ino
Created June 27, 2015 10:22
MindWave
////////////////////////////////////////////////////////////////////////
// Arduino Bluetooth Interface with Mindwave
//
// This is example code provided by NeuroSky, Inc. and is provided
// license free.
////////////////////////////////////////////////////////////////////////
#define LED 13
#define BAUDRATE 57600
#define DEBUGOUTPUT 0
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kumekay
kumekay / download.md
Last active January 13, 2016 08:48 — forked from anonymous/download.sh
Wget download data in background with cookies

Download large files in background with cookies for auth using wget

Sometimes it is necessary to dowload large files to remote server (for example datasets for Kaggle competitions), but download is available only for authenticated users. You can do it in backround task using cookies from your browser for authentication. This note generally copy wget manual https://www.gnu.org/software/wget/manual/wget.html

Cookies

First you have to create cookies.txt file with copy of all your cookies for required site If you use chrome, this extension is useful https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg

Example:

@kumekay
kumekay / pushme.py
Last active February 7, 2016 20:47
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))
@kumekay
kumekay / autossh.conf
Last active February 8, 2016 14:30
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
# 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
respawn limit 5 60
@kumekay
kumekay / JoystickKeyboard.ino
Created February 23, 2016 10:26
Arduino micro sketch: using joystick as keyboard with arrows and enter
/*
Written by Sergei Silnov @kumekay po@kumekay.com
Based on:
https://github.com/NicoHood/HID/wiki/Keyboard-API#boot-keyboard
*/
#include "HID-Project.h"
const int pinLed = LED_BUILTIN;