Skip to content

Instantly share code, notes, and snippets.

View kumekay's full-sized avatar

Sergei Silnov kumekay

View GitHub Profile
@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 / 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:

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 / 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
@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 / 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 / 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 / sudo_without_password
Created June 10, 2015 13:38
Sudo without password
RUN:
sudo visudo
ADD LINE:
user_name ALL=(ALL) NOPASSWD: ALL
@kumekay
kumekay / dokku.sh
Last active August 29, 2015 14:22
Dokku with plugins installer
# Tested on Online.net Ubuntu 14.04-2 x64
sudo apt-get install curl
sudo ssh-keygen -t rsa -b 4096 -C "test@test.test"
wget https://raw.github.com/progrium/dokku/v0.3.18/bootstrap.sh
sudo DOKKU_TAG=v0.3.18 bash bootstrap.sh
# setup dokku plugins
cd /var/lib/dokku/plugins/
sudo git clone https://github.com/ribot/dokku-slack slack
sudo git clone https://github.com/bigboxsoftware/dokku-sidekiq sidekiq