Skip to content

Instantly share code, notes, and snippets.

@phihag
phihag / log file
Last active June 29, 2016 12:05
ME906s problems
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: AT+CFUN=1
AT+CFUN=1
OK
--> Sending: ATQ0 V1 E1 S0=0
ATQ0 V1 E1 S0=0
@phihag
phihag / gist:8422290
Created January 14, 2014 17:32
badnet.info-Fehlermeldung
Zugriff verweigert
Dir wurde der Zugriff auf diese Seite auf Grund eines Cross-Site Scripting-Angriffs (XSS) in der Variable $_POST::password verwehrt.
Bitte klicke hier oder benutze die Zurück-Funktion deines Browsers, um zur Ursprungsseite zurückzukehren!
username phihag
email phihag@phihag.de
confirmEmail phihag@phihag.de
password Y8XEz<FMQ$V0+:)6]sC`KTr}*&"D<=`}
confirmPassword Y8XEz<FMQ$V0+:)6]sC`KTr}*&"D<=`}
ye5b0afbd37a83f9 jd5970706b26931ef
@phihag
phihag / gist:8380598
Created January 12, 2014 03:54
Article about open
The open function explained
[open](http://docs.python.org/dev/library/functions.html#open) opens a file. Pretty simple, eh? Most of the time, we see it being used like this:
[sourcecode language='python']
f = open('photo.jpg', 'r+')
jpgdata = f.read()
f.close()
[/sourcecode]
@phihag
phihag / RawDataeDataTest.csv
Created October 18, 2013 09:30
Demonstration of csv sorting
text text text 11/03/12 text text text UniqueNameClass1 text text
text text text 11/03/12 text text text UniqueNameClass2 text text
text text text 11/03/12 text text text UniqueNameClass4 text text
text text text 11/03/12 text text text UniqueNameClass3 text text
text text text 11/03/12 text text text UniqueNameClass1 text text
text text text 11/03/12 text text text UniqueNameClass2 text text
text text text 11/03/12 text text text UniqueNameClass5 text text
text text text 11/03/12 text text text UniqueNameClass1 text text
text text text 11/03/12 text text text UniqueNameClass1 text text
text text text 12/03/12 text text text UniqueNameClass5 text text
@phihag
phihag / shell-log
Last active December 19, 2015 03:48
$ wget https://yt-dl.org/latest/youtube-dl && chmod a+x youtube-dl && ./youtube-dl http://vimeo.com/groups/124584/videos/24973060 -v
--2013-06-29 20:52:13-- https://yt-dl.org/latest/youtube-dl
Resolving yt-dl.org (yt-dl.org)... 95.143.172.170, 2001:1a50:11:0:5f:8f:acaa:177
Connecting to yt-dl.org (yt-dl.org)|95.143.172.170|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 137063 (134K) [application/octet-stream]
Saving to: ‘youtube-dl’
100%[=====================================================================================================================>] 137,063 558KB/s in 0.2s
#!/usr/bin/env python3
import urllib.request
url = 'http://www.myspace.com/Modules/PageEditor/Handlers/Music/SearchMusic.ashx'
data = b'term=incomplete&maxArtists=10&maxSongs=20'
headers = {
'Hash':'MIGcBgkrBgEEAYI3WAOggY4wgYsGCisGAQQBgjdYAwGgfTB7AgMCAAECAmYDAgIAwAQIYLI97pYniaIEEEZ7OzdEz%2bIWLU44SUNWb30EUFjzQCE6jLLj9dgPm5be2u4N4ljriq5Up6l3RTd81ynC8UyNrmT8KElNy5%2bz8uxPHY3FdSDSgkJUuW3iF4SdT53bMvA8fAP2iOBxBMhGjy9d',
}
req = urllib.request.Request(url, data, headers)
<!DOCTYPE html>
<html>
<body>
<?php
var_export($_POST);
?>
<form method="post" name="thumbnail">
<input type="hidden" value="202" id="id_recipe" name="id_recipe">
<!DOCTYPE html>
<html>
<body>
<?php
var_export($_POST);
?>
<form method="post" name="thumbnail">
<input type="hidden" value="202" id="id_recipe" name="id_recipe">
<input type="hidden" value="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoIAAAF+CAYAAAAWSHvqAAAgAElEQVR4nLS993Mj95mv639i77GPwgTNkBxGMCcA3cg5MHOyJmmiJidOzkNODpIs2evs3XVYy/auo2xZK0fJVhh5AkGQ6G6iQZAgIZHj9Z6turduPfeHbyOQo9...(continues)...BJRU5ErkJggg==" id="effectApplied" name="effectApplied">
import subprocess
with open("blah.txt",'wb') as f:
subprocess.call(['date'], stdout=f, stderr=subprocess.STDOUT)
f.flush()
print (open("blah.txt", 'rb').read())
@phihag
phihag / fftest.py
Last active December 14, 2015 16:49
Test script for firefox webdriver in selenium
import subprocess,selenium.webdriver,os
subprocess.call(['killall', 'Xvfb'])
subprocess.Popen(['Xvfb', ':43','-ac','-screen','0','1024x768x16'])
os.environ["DISPLAY"]=":43"
ff = selenium.webdriver.Firefox()
ff.get('http://google.com/')
print(ff.title)