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
# make bash autocomplete with up arrow | |
bind '"\e[A":history-search-backward' | |
bind '"\e[B":history-search-forward' | |
alias cls="find . -name '*.pyc' -delete -print ; find -name '*~' -delete -print" | |
# git hightlight cmd line (and show branch name) | |
# export PS1='\u@\h\w$(__git_ps1 " @%s")$ ' | |
export PS1='\u@\h\w$(__git_ps1 " git:(%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== | |
// @name Ftp-Airnet-Kinopoisk helper | |
// @namespace http://airnet.lan/ | |
// @version 0.1 | |
// @description airnet helper for kinopoisk | |
// @include ftp://ftp.airnet.lan/Video/* | |
// ==/UserScript== | |
var list = document.getElementsByTagName('table'); | |
var el = list[0].getElementsByTagName('tr'); |
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
[user] | |
name = <SOME USERNAME> | |
email = <SOME EMAIL> | |
[github] | |
user = <SOME USERNAME> | |
token = <SOME TOKEN> | |
[core] | |
whitespace = trailing-space, space-before-tab, cr-at-eol |
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 django.db import connection | |
exclude_tables = ("example", ) | |
c = connection.cursor() | |
c.execute("SHOW TABLE STATUS WHERE ENGINE='MyISAM'") | |
for line in c.fetchall(): | |
table_name = line[0] | |
if table_name in exclude_tables: |
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
#!/bin/sh | |
# PROVIDE: supervisord | |
# REQUIRE: DAEMON | |
# KEYWORD: shutdown | |
# | |
# Add the following line to /etc/rc.conf.local or /etc/rc.conf | |
# to enable supervisord: | |
# | |
# supervisord_enable="YES" |
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 python | |
# | |
# Copyright 2012 Patrick Hetu <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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 python | |
""" | |
Simple sms-sender via LittleSMS | |
--------------------------------- | |
You must specify your ``USER_EMAIL`` and ``USER_APIKEY`` below. | |
Examples:: | |
$ sendsms.py --recipients=79117654321,79317654321 --message="Some message" |
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
function(url, params) { | |
var parser = document.createElement('a'); | |
parser.href = url; | |
var chunks = []; | |
for(var param in params) { | |
chunks.push(encodeURIComponent(param) + "=" + encodeURIComponent(params[param])); | |
} | |
parser.search = (parser.search ? parser.search + '&' : '?') + chunks.join("&"); | |
return parser.href; | |
} |
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
""" | |
Time-based One-time Password Algorithm | |
Based on the pyotp: https://github.com/nathforge/pyotp | |
""" | |
import base64 | |
import hashlib | |
import hmac | |
import datetime | |
import random |
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 totp_auth import TotpAuth | |
def main(secret=None): | |
if not secret: | |
# WHEN SIGN UP | |
ta = TotpAuth() | |
else: | |
# WHEN SIGN IN | |
ta = TotpAuth(secret) |
OlderNewer