This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime as dt | |
import datetime | |
from time import mktime | |
import sys | |
from skipper.db import DB | |
from skipper.app import App | |
from skipper.package import Package | |
from skipper.packages import Packages | |
App.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
from threading import Thread | |
from Queue import Queue as Channel | |
import time | |
def threaded(callback): | |
time.sleep(1) | |
callback(True) | |
ch = Channel(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
rt_tables = '/etc/iproute2/rt_tables' | |
def get_tables(): | |
res = {} | |
state = {} | |
def line_filter(s): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @id vk_ads | |
// @name Ads blocker for vkontakte | |
// @version 1.0 | |
// @namespace corpix.ru | |
// @author Dmitry Moskowski | |
// @description | |
// @include https://vk.com/* | |
// @run-at window-load | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/capturer.cpp:63:52: error: no matching function for call to ‘Capturer::open(char*&, int, int)’ | |
fd = open(settings->device, O_RDWR | O_NONBLOCK, 0); | |
^ | |
# Resolved by prefixing C's open with `::` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mdadm -D /dev/md0 | tail -n 2 | grep -F removed | |
cat /proc/mdstat | grep '^md' | awk '{print $1}' | |
sudo lshw -class disk | |
sudo lshw -class disk | grep -F 'logical name' | awk '{print $3}' | tr '\n' ' ' | |
sudo mdadm -D /dev/md0 | grep -F /dev | awk '{print $NF}' | grep -v '^/dev/md' | tr '\n' ' ' | |
rsync | |
tar cz /path/to/repo | ssh vitya tar x -C /path/to/ | |
fuse (roma ----fuse---> vitya), rome reads vitya's packages index, install and download only what he needs | |
http://askubuntu.com/questions/974/how-can-i-install-software-or-packages-without-internet-offline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import codecs | |
import sys | |
sys.stdin = codecs.getreader('cp1251')(sys.stdin) | |
sys.stdout = codecs.getwriter('utf-8')(sys.stdout) | |
for l in sys.stdin: | |
sys.stdout.write(l) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# cat foo.svg | ./urlencode.py | |
import urllib | |
import codecs | |
import sys | |
sys.stdin = codecs.getreader('utf-8')(sys.stdin) | |
sys.stdout = codecs.getwriter('utf-8')(sys.stdout) | |
for l in sys.stdin: | |
sys.stdout.write(urllib.quote_plus(l)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals, print_function | |
import sys | |
import socket | |
import threading | |
host = '' | |
port = int(sys.argv[1]) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Каждая секция("*.css"...) == 1 проход инструмента. Соответственно можно запускать так для *.css, например: | |
porshik --handlers='["css", "freeze"]' --parameters='{}' /path/to/file.css |