StvOR!

March 27, 2008

Link: recover deleted files on ext3

Filed under: All, Linux, Security

HOWTO recover deleted files on an ext3 file system by Carlo Wood via LWN

quote:

The tool that I wrote assumes a spike of recently deleted files (shortly before the last unmount). It does NOT deal with a corrupted file system, only with accidently but cleanly deleted files.

Tool doesn’t recover in place so it only needs read access to file system (it does NOT work on live file system), so this could be used for forensics as well.

Howto also includes detailed overview of ext3 file system, this is probably next best thing to looking at the source code of ext3 fs directly. Worth a read even if you haven’t had any accidents with rm :)

Of course if Carlo Wood had more recent backups of his work it would make his life a lot easier, but we wouldn’t have this nice guide and useful tool as a result.

March 22, 2008

Link: The ten commandments of Unicode

Filed under: All, Links, Development

http://cafe.elharo.com/programming/the-ten-commandments-of-unicode/ by Elliotte Rusty Harold

via Ryan Tomayako

March 19, 2008

Debugging Python HTTPConection recipe

Filed under: All, Linux, Python

Nice built in way to debug http connections problems in your python code.

This is nothing new, just for my reference, so I don’t have to hunt it down every time I need it.

   import httplib
   import urllib2

   # For urllib it's enough to do
   # httplib.HTTPConnection.debuglevel = 1
   #
   # but for urllib2 we have to:
   handler =  urllib2.HTTPHandler(debuglevel=1)
   opener = urllib2.build_opener(handler)
   urllib2.install_opener(opener)

Sources: python docs, Jamie Grove, python mailing list

March 18, 2008

Mark Pilgrim rip’s apart Joel Spolsky’s IE8 standards mode appology

Filed under: All, Webmonkey, Comp-misc

Here is original from Joel: Martian Headsets

and Mark Pilgrim’s Translation From MS-Speak to English of Selected Portions of Joel Spolsky’s “Martin Headsets”

My personal favourite:

” Or maybe they won’t… in which case, IE is going to lose a lot of market share.”

I know IE is going to continue to lose a lot of market share, and I’m publishing this now so I can blame you dirty fucking hippies for it later.

March 5, 2008

Howto change MAC adress in Ubuntu

Filed under: All, Linux, Security

Why would you want to change your MAC ?

Several reasons:

  • Some ISP’s lock their cable/ADSL modems to single MAC address ( usually your router), if for some reason you need to connect some other machine to that modem you need to change MAC address on that machine.

  • Security and privacy. Each ethernet and WiFi card has its own MAC, that can sometimes be traced back to you. By changing your MAC you can prevent that.

NOTE: While most ethernet ( all ?) support changing MAC, there are some WiFi cards that do not.

NOTE: In the following text I have used eth0 as an example of network interface. Replace it with the interface of the card whose MAC you want to change.

To list all interfaces: sudo ifconfig -a

There are several ways to change your MAC.

General Linux

Works on most Linux boxes.

First we bring down the interface:

ifconfig eth0 down

then we change the MAC:

ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx

and we bring back the interface (static):

    ifconfig eth0 192.168.0.101 netmask 255.255.255.0 broadcast 192.168.0.255
    ifconfig eth0 up
    route add default gw 192.168.0.1 eth0

or with dhcp:

/sbin/dhcpdc eth0

Ubuntu

On Ubuntu the procedure is dependant on weather you use NetworkManger or not.

Without NetworkManeger

First edit /etc/network/interfaces and change:

    auto eth0
    iface eth0 inet dhcp

into:

    auto eth0
    iface eth0 inet dhcp
        hwaddress ether xx:xx:xx:xx:xx:xx

After making above changes you need to restart networking with:

    sudo /etc/init.d/networking restart

With NetworkManeger

Create new file /etc/network/if-pre-up.d/macchange

#! /bin/sh

# $IFACE - provided by NetworkManeger 
/sbin/ifconfig $IFACE hw ether xx:xx:xx:xx:xx:xx

# If we use macchanger from http://www.alobbs.com/macchanger/
/usr/bin/macchanger -e $IFACE

After saving the above file we make it executable:

    sudo chmod +x  /etc/network/if-pre-up.d/macchange

And thats it. NetworkManeger will call our script each time before it brings up the interface.

Random MAC’s

Macchanger can be used to generate random MAC’s.

Insted of using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx you can use macchanger

Example:

    macchanger -m xx:xx:xx:xx:xx:xx eth0

Random MAC example:

    #Random MAC of the same kind (wifi, ethernet)
    macchanger -a eth0
    #Random MAC from same manufacturer 
    macchanger -e eth0
    #Fully random MAC
    macchanger -r eth0





















Get free blog up and running in minutes with Blogsome | Theme designs available here