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
/* Simple helper for creating DOM elements. Released into public domain. | |
* https://gist.github.com/stiletto/90c9826f1c50550fdccdb67105078631 | |
*/ | |
function make(tag, props, children) { | |
var element = document.createElement(tag); | |
if (props) for(let key of Object.keys(props)) { | |
let value = props[key]; | |
if (key=="style" && typeof(value)=="object") // you may throw out this branch if you don't care about inline styles | |
for(let style of Object.keys(value)) element.style[style] = value[style]; | |
else |
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 hashlib | |
nicknames = [ "greenbastad", | |
"ckorzhik", | |
"ruki", | |
"je", | |
"goren", | |
"manul", | |
"zhc", | |
"padavanchik", |
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
# | |
# Nagios syntax highlighting | |
# | |
# Author: Stiletto | |
# Version: 11 Oct, 2015 | |
# | |
wholechars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-*0123456789 | |
context default |
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
# cat dotheshit.sh | |
#!/bin/sh | |
NAME=bnw | |
SIZE=4096 | |
umask 0077 | |
test -f "$NAME.key" || openssl genrsa -out "$NAME.key" "$SIZE" | |
test -f "$NAME.csr" || ( yes "" | openssl req -new -sha256 -text -key "$NAME.key" -out "$NAME.csr" ) | |
test -f sub.class1.server.ca.pem || wget https://www.startssl.com/certs/sub.class1.server.ca.pem | |
test -f ca.pem || wget https://www.startssl.com/certs/ca.pem | |
test -f "$NAME.crt" && test '!' -f "$NAME.txt.crt" && openssl x509 -in "$NAME.crt" -text > "$NAME.txt.crt" |
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 | |
# coding: utf-8 | |
import feedparser | |
import hashlib | |
import re | |
import os | |
class RssAnimeProvider: | |
def __init__(self,feed_url,id_prefix='',name_regex=''): |
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 json, urllib, argparse, datetime, sys | |
def convertdate(date): | |
return datetime.datetime.utcfromtimestamp(date).strftime('%d.%m.%Y %H:%M:%S') | |
def main(): | |
import argparse | |
parser = argparse.ArgumentParser(description='Download BnW user blog.') |
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
2012-10-31 17:39:52+0400 [XmlStream,client] 1351690792.41 - SEND: | |
<presence to='syncro@jabber.ru/Psi+' from='bnw.im'> | |
<status>9600 0010 1110 0000 13 39 52</status> | |
</presence> | |
2012-10-31 17:39:52+0400 [XmlStream,client] 1351690792.47 - RECV: | |
<presence from='syncro@jabber.ru/Psi+' to='bnw.im' type='error'> | |
<status>9600 0010 1110 0000 13 39 52</status> | |
<error code='403' type='auth'><forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error> | |
</presence> |
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
1350212280.28 - RECV: <presence xmlns='jabber:client' from='soulthreads@jabber.ru/emacs' to='bnw.im' type='probe'/> | |
1350212280.28 - SEND: <presence to='soulthreads@jabber.ru/emacs' from='bnw.im'> | |
<status>9600 0010 1110 0000 10 58 00</status> | |
</presence> | |
1350212280.34 - RECV: <presence xmlns='jabber:client' from='soulthreads@jabber.ru/emacs' to='bnw.im' type='error'> | |
<status>9600 0010 1110 0000 10 58 00</status> | |
<error code='403' type='auth'> | |
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | |
</error> | |
</presence> |
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
$ mongo --eval 'db.comments.find().forEach(function (x) { print(x.user); });' --quiet bnw|sort|uniq -c|sort -n --reverse|cat -n | |
1 9643 matimatik | |
2 7199 goren | |
3 4100 l29ah | |
4 3099 stiletto | |
5 2499 ivanov | |
6 2391 o01eg | |
7 2067 failman | |
8 2041 plhk | |
9 1756 vrusha |
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
/* | |
* shitter.c | |
* | |
* % gcc -o shitter shitter.c -D_LARGEFILE64_SOURCE=1 | |
* | |
*/ | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> |
NewerOlder