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 time | |
import random | |
import select | |
import socket | |
def chk(data): | |
x = sum(a + b * 256 for a, b in zip(data[::2], data[1::2] + b'\x00')) & 0xFFFFFFFF | |
x = (x >> 16) + (x & 0xFFFF) | |
x = (x >> 16) + (x & 0xFFFF) |
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 bs4 | |
import requests | |
import argparse | |
import re | |
from multiprocessing import Pool | |
root_url = 'http://pyvideo.org' | |
index_url = root_url + '/category/50/pycon-us-2014' |
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
telnet coursify.ru 80 | |
Trying 95.85.32.220... | |
Connected to coursify.ru. | |
Escape character is. | |
POST /login HTTP/1.1 | |
Host: coursify.ru | |
Content-Type: application/x-www-form-urlencoded | |
Content-Length: 0 | |
Content-Disposition: form-data; login="user"; password="12345678" |
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 bottle import route, run, install | |
from bottle_sqlite import SQLitePlugin | |
install(SQLitePlugin(dbfile='bottle.db')) | |
@route('/db/') | |
def database(db): | |
data = db.execute('SELECT SQLITE_VERSION()').fetchone() | |
print "SQLite version: %s" % data |
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
create table medal_scd ( | |
id number(20), | |
quantity number(20), | |
start_date date, | |
end_date date, | |
status char (1 byte) | |
); | |
create table medal_src ( | |
id number(20), |
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 bs4 | |
from requests import Session | |
vk_url = 'http://vk.com' | |
def get_events_urls(group_id, oid): | |
group_url = ''.join([vk_url, '/', group_id]) | |
session = Session() | |
session.head(group_url) | |
response = session.post( |
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
Oracle snippets, patterns and other stuff. |
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 bash | |
size=1024 # MB | |
mount_point=$HOME/tmp | |
name=$(basename "$mount_point") | |
usage() { | |
echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \ | |
"(default: mount)" >&2 | |
} |
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
SQL> select * from nc_objects2; | |
OBJECT_ID PARENT_ID | |
---------- ---------- | |
0 | |
2 1 | |
1 | |
3 2 | |
SQL> select |
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
SQL> create table test_ins (x number(1)); | |
Table created. | |
SQL> insert into test_ins (x, x) values (1, 2); | |
insert into test_ins (x, x) values (1, 2) | |
* | |
ERROR at line 1: | |
ORA-00957: duplicate column name |