Skip to content

Instantly share code, notes, and snippets.

View aleksandr-kosobokov's full-sized avatar

Aleksandr Kosobokov aleksandr-kosobokov

View GitHub Profile
@veritech
veritech / gist:1224664
Created September 18, 2011 03:02
Brute force HTTP password cracker
#!usr/bin/python
#Linksys WRT54G router brute force
#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com
import threading, time, random, sys, urllib2, socket
if len(sys.argv) !=4:
print "Usage: ./linksysbrute.py <server> <user> <wordlist>"
sys.exit(1)
@xexu
xexu / replacer.py
Created April 28, 2013 21:02
replace utility for large files
# -*- coding: utf-8 -*-
import os, codecs, sys
dir = os.getcwd()
file = sys.argv[1]
Dict = [['a', 'b'], ['c', 'd']]
fname = os.path.join(dir, file)
@mrchief
mrchief / LICENSE.md
Last active May 20, 2025 13:10
Add "Open with Sublime Text 2" to Windows Explorer Context Menu (including folders)

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@JosefJezek
JosefJezek / ldap2csv.py
Last active April 23, 2022 07:49
Export Users from Active Directory / LDAP to CSV file with Python
#!/usr/bin/python
# http://www.packtpub.com/article/python-ldap-applications-ldap-opearations
# sudo apt-get install python-ldap
import ldap
host = 'ldap://example.com:389'
dn = '[email protected]'
@geeksunny
geeksunny / find_replace.py
Created October 14, 2013 15:37
A quick'n'dirty Python script to make find & replace operations on large text files fast and automated. Creates a duplicate file copy and leaves the original file unchanged.
#!/usr/bin/python
## Configuration ##
__target_file__ = "example.txt" # Relative path to the target file to process.
__find__ = "found" # Block of text to find.
__replace__ = "replaced" # Block of text to replace with.
###################
with open(__target_file__) as file_in: # Open source file for reading.
file_out = open(__target_file__+"_replaced", 'w') # Open destination file for writing.
for line in file_in: # Loop through source, line by line.
new_line = line.replace(__find__,__replace__) # Perform find & replace on current line.
@sloria
sloria / bobp-python.md
Last active May 28, 2025 02:41
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@roundand
roundand / OpenWithSublimeText3.bat
Last active January 30, 2025 13:12 — forked from mrchief/LICENSE.md
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
Source: http://jakeaustwick.me/python-web-scraping-resource/
Jake Austwick
09 Mar 2014 on requests | python | lxml | scrape | proxies | web crawler | download images
Python web scraping resource
If you need to extract data from a web page, then the chances are you looked for their API. Unfortunately this isn't always available and you sometimes have to fall back to web scraping.
In this article I'm going to cover a lot of the things that apply to all web scraping projects and how to overcome some common gotchas.
Please Note: This is a work in progress. I am adding more things as I come across them. Got a suggestion? Drop me an email - [email protected]
@chaliy
chaliy / fix_pandas_table.py
Last active August 29, 2015 14:01
Monkeypatch Pandas DataFrame to render tables with bootstrap styles. Still no lack with ugly black borders.
import pandas as pd
pd.DataFrame._repr_html_ = lambda self: self.to_html(classes='table table-striped')
@sspecht
sspecht / Portable Postgres Install
Last active March 2, 2024 17:26
Portable Postgres / PostGIS Install for Windows
Eine kurze Dokumentation, wie man Postgres/Postgis unter Windows ohne Installation betreibt:
- PG-Binaries (ZIP) herunterladen und entpacken
http://www.enterprisedb.com/products-services-training/pgbindownload
- Batch-Datei lt. Anhang bzw. lt.
http://www.postgresonline.com/journal/archives/172-Starting-PostgreSQL-in-windows-without-install.html
im Haupt-Verzeichnis speichern (das Verzeichnis, in dem /bin zu finden ist).
- Beim ERSTEN Start der run.bat muss die gekennzeichnete Zeile ausgeführt, danach aber wieder auskommentiert werden.