Skip to content

Instantly share code, notes, and snippets.

View Visgean's full-sized avatar

martin Visgean

View GitHub Profile
Traceback (most recent call last):
File "./urwidUI.py", line 75, in <module>
main()
File "./urwidUI.py", line 71, in main
loop.run()
File "/usr/local/lib/python2.6/dist-packages/urwid-0.9.9.1-py2.6-linux-i686.egg/urwid/main_loop.py", line 170, in run
self.screen.run_wrapper(self._run)
File "/usr/local/lib/python2.6/dist-packages/urwid-0.9.9.1-py2.6-linux-i686.egg/urwid/raw_display.py", line 234, in run_wrapper
return fn()
File "/usr/local/lib/python2.6/dist-packages/urwid-0.9.9.1-py2.6-linux-i686.egg/urwid/main_loop.py", line 181, in _run
wget http://dl.google.com/earth/client/current/GoogleEarthLinux.bin
chmod +x GoogleEarthLinux.bin
sudo ./GoogleEarthLinux.bin
#! /usr/bin/python
# -*- coding: UTF-8 -*-
import settings
import urllib
import xml.etree.ElementTree as etree
class getTags:
def __init__(self):
#! /usr/bin/python
# -*- coding: UTF-8 -*-
# Poslanci by Visgean Skeloru
# Tento script slouží k zjištění mail adres všech poslanců české republiky.
import urllib
import re
baseUrl = "http://www.psp.cz/sqw/organy2.sqw?kr=1"
@Visgean
Visgean / primes.py
Created July 14, 2011 13:51
Prime numbers generator
#! /usr/bin/python
# -*- coding: UTF-8 -*-
# Prime numbers
# @author: Visgean Skeloru
# email: <visgean@gmail.com>
# jabber: <visgean@jabber.org>
# github: http://github.com/Visgean
numbers = range(3, int(raw_input("Max value: ")) + 1, 2)
@Visgean
Visgean / equality_creates_reference.py
Created July 14, 2011 13:54
Getting copy of lists or objects in python
>>> a = ["a","b","c"]
>>> b = a
>>> b.append("d")
>>> print a, b
['a', 'b', 'c', 'd'] ['a', 'b', 'c', 'd']

python:

>>> import time
>>> from datetime import datetime as dt
>>> yess = dt(year = 2012, month=9, day=1, hour=8, minute=20)
>>> time.mktime(yess.timetuple())
1346480400.0
@Visgean
Visgean / data URI.py
Created August 18, 2011 00:38
simple filter for simplifying creating data URI´s
# -*- coding: UTF-8 -*-
from django import template
from base64 import b64encode
register = template.Library()
@register.filter
def dataURI(filename, mime = None):
@Visgean
Visgean / ssh bomb.sh
Created August 27, 2011 22:28
My server was hacked today, I lost ssh control, altough i was able to create tunnel, so I bruteforced server.
#!/bin/bash
for i in {2300..3000}
do
echo $i
ssh -f -N -n -D $i regulus
done
# Done, server keeps saying:
# ssh_exchange_identification: Connection closed by remote host
@Visgean
Visgean / cheat.sh
Created September 25, 2011 20:55
How to make teacher happy
dd if=/dev/urandom count=1 bs=1241KB of=Homework.pdf