Skip to content

Instantly share code, notes, and snippets.

@paitonic
paitonic / get chrome and firefox bookmarks
Created March 12, 2011 15:54
parses chrome+firefox bookmarks
from BeautifulSoup import BeautifulSoup
f = open("chrome-fav.html","r")
html = f.read()
f.close()
soup = BeautifulSoup(html)
bookmarks = soup.findAll('a')
# attributes: href, add_date, icon etc.
@paitonic
paitonic / unzip files
Created February 1, 2012 19:28
unzip all .zip files in directory
import os
import subprocess
import sys
path = sys.argv[1]
for fname in os.listdir(path):
(name, ext) = os.path.splitext(fname)
if ext == '.zip':
ret = subprocess.call("mkdir" + " {0}".format(name), shell=True)
@paitonic
paitonic / gist:c7e4669d143cb0779c66
Created October 25, 2014 17:38
i3 - i3status.conf
# /etc/i3status.conf
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
#
# This config file uses keycodes (bindsym) and was written for the QWERTY
# layout.
#
# To get a config file with the same key positions, but for your current
# layout, use the i3-config-wizard
#
@paitonic
paitonic / npy-btce-depth.py
Created December 27, 2014 12:24
npyscreen - btce depth
#!/usr/bin/env python
# encoding: utf-8
import npyscreen
import qbtce
import datetime
api = qbtce.API()
def parse_depth():
@paitonic
paitonic / ltc.conf
Created February 7, 2015 12:10
configuration for 7950 2x7850 mining litecoin setup
{
"pools" : [
{
"url" : "POOL_URL",
"user" : "USER",
"pass" : "PASS"
}
]
,
"intensity" : "18,17,17",
@paitonic
paitonic / radio-t-timestamps.py
Last active August 29, 2015 14:16
Script parses Radio T chat log and outputs each subject starting time
# -*- coding: utf-8 -*-
import lxml.html
import math
from datetime import datetime
radiot_nick = 'jc-radio-t'
podcast = 'http://chat.radio-t.com/logs/radio-t-{number}.html'.format(number=422)
# parsing
@paitonic
paitonic / websocket-example.py
Created March 27, 2015 20:14
Websockets using Tornado
import tornado.websocket
import json
class WebSocketHandler(tornado.websocket.WebSocketHandler):
clients = []
def open(self):
WebSocketHandler.clients.append(self)
print "WebSocket opened"
def on_message(self, message):
@paitonic
paitonic / arch-install-script
Created February 6, 2016 09:28
Arch installation script
#################################################################
############################## DRAFT ############################
#################################################################
# arch linux - stage_install
# update system clock
$ timedatectl set-ntp true
# PARTITIONING (EFI)
-s -- never prompt the user