Accéder au contenu principal

Articles

Affichage des articles du 2011

How to create an executable from a Scala project

I started to have fun with scala and I wanted to be able to package and launch a Scala executable. It is an eclipse project and it is already using Maven for dependency resolution. I found the following solutions (to confirm) 1. Use SBT as a build tool. SBT seems to support the Maven pom.xml files for dependency resolution. 2. Use Gary Boone's solution by wrapping the Scala project entry point into a Java static main function 3. Use mvn assembly : single plugin as described on stackoverflow

Use Python to login to a secured website

This Python 2 class logs in and connect to a secured website. The class inherit from thread so that it is possible to run multiple instance of the class. class CRReader(threading.Thread): data = None headers = None def __init__(self, crNo, semaphore): threading.Thread.__init__(self, name=crNo) self.loggedin = False self.crNo = crNo self.semaphore = semaphore self.opener = None self.status = None def login(self): if self.loggedin is False: #print 'Login ' + self.crNo url = "https://example.com/login.php" opts = { 'username': 'John', 'password': 'pass1', } CRReader.headers = { 'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12', 'Accept': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'Accept-Language':...

/etc/X11/xorg.conf

#To setup bigger resolutions with Ubuntu in a Virtual Machine #Section "Device" #Identifier "VESA Framebuffer" #Driver "vesa" #VideoRam 4096 # Insert Clocks lines here if appropriate #EndSection Section "Device" Identifier "Configured Video Device" #Driver "vboxvideo" EndSection Section "Monitor" Identifier "My Monitor" HorizSync 31.5 - 150.0 VertRefresh 75-85 EndSection Section "Screen" Identifier "Screen 1" Device "VESA Framebuffer" Monitor "My Monitor" # If your card can handle it, a higher default color depth (like 24 or 32) # is highly recommended. # DefaultDepth 8 # DefaultDepth 16 DefaultDepth 24 # DefaultDepth 32 # "1024x768" is also a conservative usable default resolution. If you # have a better monitor, feel free to try resolutions such as # "1152x864", "1280x1024", "1600x1200", and "1800x1400" (or whatever ...

iPhone Email Hack for data retrieval

I wanted to send an email I typed in my iphone from a cybercafe without wifi access. I just setup a adhoc wifi network and sshfs the whole file system. For ssh setup, see my previous blog post. I discovered that email are clearly stored in : /private/var/mobile/Library/Mail And emails are stored as .emlx files. To read those files use a mail client just like thunderbird or use a simple text editor. You can use a base64 decoder to decode encrypted message part when necessary.