INCLUDE_DATA

Convert Firefox 3 cookies.sqlite to cookies.txt

Posted on July 16th, 2008 by id_provoke.
Categories: Uncategorized.

Now at firefox 3 does not user cookies.txt, they are use cookies.sqlite, if you use wget or curl command to download with cookies, may you must convert cookies.sqlite to cookies.txt, just copy and paste this scipt, and the script will be convert your cookies.sqlite to cookies.txt.

#!/usr/bin/python

import sqlite3 as db
import sys

cookiedb = ‘/home/henry/.mozilla/firefox/pj8×7vu3.default/cookies.sqlite’
targetfile = ‘/home/henry/kuki-.txt’

what = sys.argv[1]
connection = db.connect(cookiedb)
cursor = connection.cursor()
contents = “host, path, isSecure, expiry, name, value”

cursor.execute(”SELECT ” +contents+ ” FROM moz_cookies WHERE host LIKE ‘%” +what+ “%’”)

file = open(targetfile, ‘w’)
index = 0
for row in cursor.fetchall():
file.write(”%s\tTRUE\t%s\t%s\t%d\t%s\t%s\n” % (row[0], row[1],
str(bool(row[2])).upper(), row[3], str(row[4]), str(row[5])))
index += 1

print “Gesucht nach: %s” % what
print “Exportiert: %d” % index

file.close()
connection.close()

save this script as export-firefox-cookies.py and run with command

./export-firefox-cookies.py rapidshare

Source : http://blog.schlunzen.org/2008/06/19/firefox-3-und-cookiestxt/

no comments yet.

Bash For loop Example

Posted on July 15th, 2008 by id_provoke.
Categories: Linux, Orat-oret.

I’m always forgetting the syntax to make “for” loops in Bash. Anyhow, I know I will have to come back here to find it, so I thought I would write put up this quick example with the hope that it will be useful to others as well.

for i in $(seq 1 100); do echo -n “file${i} “; touch file${i} 2>&1; done

The the above for loop will create 100 files (called file1, file2, etc.).

another for loop exampe

(more…)

no comments yet.