Skip to content

Instantly share code, notes, and snippets.

Sergey Silaev ssilaev

  • Russia, Moscow
Block or report user

Report or block ssilaev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ssilaev
ssilaev / .vimrc
Last active Jul 7, 2017
vim/macvim (solarized dark)
View .vimrc
" https://github.com/VundleVim/Vundle.vim
" https://valloric.github.io/YouCompleteMe/
"
let $PATH = '/usr/local/bin:'.$PATH
set nocompatible " be iMproved, required
filetype off " required
if has("multi_byte")
if &termencoding == ""
let &termencoding = &encoding
@ssilaev
ssilaev / views.py
Created Nov 24, 2016
CBV with Multiple forms. Based on UpdateView.
View views.py
class MultipleFormsView(ItemUpdate):
model = MyModel
template_name = ''
success_url = reverse_lazy('')
form_class = Form1
second_form_class = Form2
third_form_class = Form3
@ssilaev
ssilaev / memReport.py
Created Dec 20, 2014
ctl memory report for yosemite
View memReport.py
#!/usr/bin/python
import subprocess
import re
ps = subprocess.Popen(['ps', '-caxm', '-orss,comm'], stdout=subprocess.PIPE).communicate()[0]
vm = subprocess.Popen(['vm_stat'], stdout=subprocess.PIPE).communicate()[0]
processLines = ps.split('\n')
sep = re.compile('[\s]+')
rssTotal = 0 # kB
@ssilaev
ssilaev / decrypt_md5.py
Created Dec 20, 2014
Simple example of decrypt md5 (slowly)
View decrypt_md5.py
#!/usr/bin/python
import hashlib
import sys
def decryptMD5(testHash):
s = []
while True:
m = hashlib.md5()
for c in s:
@ssilaev
ssilaev / get_stats.py
Created Dec 20, 2014
Getting current status (ISP netorn.ru)
View get_stats.py
#!/usr/bin/env python
# coding=utf-8
import os, mechanize, cookielib, re
CURRENT_DIR = os.path.dirname(__file__)
br = mechanize.Browser()
cj = cookielib.LWPCookieJar()
br.set_cookiejar(cj)
You can’t perform that action at this time.