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 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 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

December 28, 2005

Cool utility of the day - Gnome Blogpost utility

Filed under: All, Linux, Python

I just saw a nice gnome application Gnome Blog Post. Its nice little utility for quickly posting short blog posts,

It doesn’t have much editing futures except basic: bold, italic and insert link, but it does support 3 of the most popular blog sites :

It also supports popular selfhosted blogs: I miss a few things, one is support for images( I just bought a new camera :) ) and the other is support for categories or tags(like O’reilly Radar).

Since I played a little whit PyQt I was looking for small application to program as a training exercise. I think such a blogging tool fits the bill nicely and it could also be usefull to Kde users. Since original is written in Python (with PyGtk widgets) my job will be easier.

I will post progress updates to this blog.

December 25, 2005

Merry Christmas - Future plans

Filed under: All, Linux, Python, Webmonkey, Pic

bozicno_drevo1_sm

Again I am not dead jet. I still can’t bring myself to post to this blog regularly. It’s not that I don’t have time, but whenever I start to write about some topic, I get so immersed into it, I forget to finish the post. So I have lots of half written drafts around. But thats going to change now. Why? I have finally started to learn to touch type. So I have can kill two birds with one shot: having up-todate blog and practice typing.

Other project I started or I will start shortly are: python GUI programming (Qt, wx, and reluctantly Gtk), python web frameworks (TurboGears, Django, Cherrypy). I have also been playing with different web servers (apache, lighthttpd, monkeyhttp).

Also I plan to brush up on my PHP, and C skills.

Comming up mini review of linux touch-typing tutors.

Delicious tags: linux python web

October 22, 2005

Quake4 Linux

Filed under: All, Linux, Comp-misc

Quake4FrontPage - Quake IV GNU/Linux FAQ Enough said.

I don’t play much games on a computer nowday’s, and when i do i play them on ps2. I do hoever ocasionaly play UT, and Enemy Territory.

I also respect developers who support Linux platform, and buy their games, even though I’ll probably play it for only about a week and then put it on a shelf.

Haven’t read any review’s jet, but knowing past ID games, It probably rocks.

Nessus going closed sourece, two GPL projects forked

Filed under: All, Linux, Security

It’s old news that nessus is going cloesd source for two reasons

  • Virtually nobody has ever contributed anything to improve the scanning _engine_ over the last 6 years. I’m not talking about shoe-horning DB support in nessusd, but really to contribute things which make the scans faster, or Nessus more powerful.
  • A number of companies are _using_ the source code against us, by selling or renting appliances, thus exploiting a loophole in the GPL. So in that regard, we have been fueling our own competition and we want to put an end to that.
  • The nessus will (or so they say) continue to bee free as in “free beer”. I have somewhat mixed feelings about that. I can understand why they dont want to support opensource nessus, but i am afraid that more and more additions will not be free. Not to mention that its harder to trust closed source security tool. So I guess I am not the only one thinking that since, there are two (active) projects, GNessus and Porz-Wahen that will pick up the existing GPL code and develop it further. I am not sure, wheather authors, intend to join forces or not, or even if they are aware of eachother. Aditional takes on this:

PS: There are some other projects, but it seems thees two are most pupular. (Segusius, gpl nessus plugins .)

October 11, 2005

New Linux Desktop usability projects Tango and Better desktop

Filed under: All, Linux

New desktop usability project springing up.

Beter desktop a Nowel sponsored usability testing site/blog. What is interesting are videos of people using desktop and linux apps. Tango project aim’s to provide comon icon theme for different desktops. Normaly I wouln’t care (there are some some shared themes allready) but this project seems to have support from some wery well known linux people.

I wonder why stop at icon theme and not support projects like qtgtk wich integrates parts of kde into gtk apps, or qtk-qtk themer, whitch makes gtk apps use kde themes.

Why not build single basic theme engine (or engince spec) for use by all desktop’s ? It worked for menus, taskbars and others.






















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