Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀

Sergei Silnov kumekay

🦀
View GitHub Profile
@kumekay
kumekay / download.md
Last active Jan 13, 2016 — forked from anonymous/download.sh
Wget download data in background with cookies
View download.md

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:

View geonames.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View geonames.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View mindwave.ino
////////////////////////////////////////////////////////////////////////
// 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 Aug 29, 2015
Galileo sketches
View GalileoBMP085.ino
#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 Jun 13, 2015
ubuntu locale
View note.txt
# add to /etc/default/locale
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
@kumekay
kumekay / prepare_image.sh
Last active Aug 29, 2015
Proxmox ubuntu 14.04 OpenVZ
View prepare_image.sh
# 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 Jun 10, 2015
Sudo without password
View sudo_without_password
RUN:
sudo visudo
ADD LINE:
user_name ALL=(ALL) NOPASSWD: ALL
@kumekay
kumekay / dokku.sh
Last active Aug 29, 2015
Dokku with plugins installer
View dokku.sh
# 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
@kumekay
kumekay / kimsufi_notify.py
Created Jun 8, 2015
Kimsufi server Availability checker and notifier (via PushBullet)
View kimsufi_notify.py
import json
import codecs
import requests
import random
def get_states(reference = ["150sk30", "150sk40"]):
states = {}
anyAvailable = False
body = requests.get('https://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2').json()
for r in reference: