This file contains hidden or 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 python3 | |
| from base64 import b64decode | |
| from functools import reduce | |
| from hashlib import md5 | |
| from io import BytesIO | |
| import struct | |
| BEUInt32 = struct.Struct(">I") |
This file contains hidden or 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
| def parse_line(line): | |
| return dict(i.split('=', 1) for i in line.split('\t') if i) | |
| def loads(s): | |
| cur, prev = 0, 0 | |
| while True: | |
| cur = s.find("\n", prev) | |
| if cur == -1: | |
| d = parse_line(s[prev:cur]) |
This file contains hidden or 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
| select * into temporary table tmp_camp50 from campaigns where id = 50; | |
| update tmp_camp50 set id = nextval(campaigns_id_seq), uuid = uuid_generate_v4(); | |
| insert into campaigns (select * from tmp_camp50); |
This file contains hidden or 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
| zmq: 2.904726 | |
| queue: 12.812472 |
This file contains hidden or 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
| var system = require('system'); | |
| var webPage = require('webpage'); | |
| var page = webPage.create(); | |
| page.open(system.args[1], function (status) { | |
| console.log(page.plainText); | |
| phantom.exit(); | |
| }); |
This file contains hidden or 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
| # taken from https://gist.github.com/chris-belcher/1f1fee0b39f023d7bd04dc6e5b722359 | |
| # taken from https://stackoverflow.com/questions/13305290/is-there-a-pure-python-implementation-of-murmurhash | |
| def murmur(data): | |
| seed = 0 | |
| c1 = 0xcc9e2d51 | |
| c2 = 0x1b873593 |
This file contains hidden or 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
| set -e | |
| set -x | |
| apt-get update | |
| apt-get install locales | |
| echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8, ru_RU.UTF-8 UTF-8" | debconf-set-selections | |
| echo "locales locales/default_environment_locale select ru_RU.UTF-8" | debconf-set-selections | |
| sed -i 's/^# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen | |
| dpkg-reconfigure --frontend=noninteractive locales |
This file contains hidden or 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 = Andrew Grigorev | |
| email = [email protected] | |
| [alias] | |
| st = status | |
| ci = commit | |
| co = checkout | |
| br = branch | |
| d = diff | |
| dc = diff --cached |
This file contains hidden or 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
| mysql -B -N -e "SELECT DISTINCT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') AS query FROM user ORDER BY user, host" mysql | mysql | grep -v 'Grants for' |
This file contains hidden or 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
| set ai si smarttab et sw=4 ts=4 | |
| filetype plugin indent on | |
| execute pathogen#infect() |