Fix weird flux menu

Some distro’s just add all the items under single menu and thus the menu itself becomes unusable because of the number of items in the submenu and this I did not like and hence ceated this simply python script to fix that. For using the script, back up you “menu” file, redirect the output of this script to ‘menu’ file again.

 

#!/bin/python

F = open("~/.fluxbox/menu", "r")
count=0
mkc=1
started=0

for line in F:
    print line.rstrip()

    if '[submenu]' in line.lower() and started == 1:
        print '[end]'

    if '[end]'  in line.lower():
        count=0
        mkc=1
        if started > 0:
             started=0
             # print "Count is {}".format(count)
             # print "Started is {}".format(started)
             print '[end]'
    if '[exec]'  in line.lower():
        if count > 15 :
            if started > 0:
                started=0
                print '[end]'
                # print "Count is {}".format(count)
                # print "Started is {}".format(started)
            print '[submenu] ({})'.format(mkc)
            started=1
            mkc+=1
            count=0
        # print count
        count+=1

scapy packet dump to packet

First you need to have scapy installed. And if you don’t know about scapy, then

Scapy is a powerful interactive packet manipulation program. It is able to forge or decode packets of a wide number of protocols, send them on the wire, capture them, match requests and replies, and much more. It can easily handle most classical tasks like scanning, tracerouting, probing, unit tests, attacks or network discovery (it can replace hping, 85% of nmap, arpspoof, arp-sk, arping, tcpdump, tethereal, p0f, etc.). It also performs very well at a lot of other specific tasks that most other tools can’t handle, like sending invalid frames, injecting your own 802.11 frames, combining technics (VLAN hopping+ARP cache poisoning, VOIP decoding on WEP encrypted channel, …), etc

So, just install scapy

dnf install PyX scapy

Once done, start scapy so that you can capture and see the packet in pdf.

a=sniff(count=1)
a.pdfdump

Windows Vs Linux – One more time

Tux, as originally drawn by Larry Ewing
Image via Wikipedia

One of the most written and commented articles has to be Linux vs Windows (of course there are competitors like vim vs emacs) but none has been covered so much as Linux vs Windows. So, what am I going to write here which is not covered earlier in so many other posts. Well a little different perspective 🙂

 

We will take this post in points so that we do not divert and its easier for you to comment with quotes to point number 🙂

1) These are for complete different segments of users.

Windows is for everyone and Linux is for geeks and fan-boy‘s. Well, not that I agree with this but lets face the fact. Windows is OS on which all the drivers works and you dont have to worry about which Webcam I need to buy or which scanner will work.

The reason for this is multi-fold but does that matter to everyday users.

2) Cost factor.

This is something that keeps popping up every time there is some discussion like this. I don’t think that anyone using Linux is using it because it is free. If there is someone using the FREE OS just because it is free then I for one would definitely like to understand if the same person would use Windows if it was free.

BTW, I guess in China people don’t even know that Windows license’s are paid.

3) Ease of Use

People using Windows have always this notion that Linux is difficult to use. I found it the other way round. I find myself limited in ways to work on Windows (Oh and yes, I am stuck with Windows here for last around 2 months). Its mostly a question of perception. There are still things in Linux that you might have to do in the so called bash/console/terminal/command prompt, call it what you want to. But mostly that is the case for doing things faster and otherwise you probably would not need to open a terminal ever.

But if you go to any of the forums, you will definitely get suggestions to open a terminal first. Why, because you will be getting suggestions from veterans in the field. These guys have been using Linux since the days when there was no GUI or using GUI was considered sin. Just kidding but seriously you can do things much faster in a “command window”.

4) Different Filesystems.

Windows uses FAT/vFAT/NTFS and so on whereas Linux uses some 83 other types of FS. Mostly widely used being ext2, ext3, ext4 and reiser (I guess ). Why does it matter to you? Because you can use (read as read/write) any of the windows Filesystems on the Linux box natively but not the other way round. So, be careful with this.

5) File-type and associations.

Files and folders are same on Linux and Windows. Does not make much of a difference. Both are handled in similar manner. Not the same if you look a little deeper. This is one thing that confuses most who are new to Linux.

In Windows the File type and the action of double click is based on the extension of the filename. So, if I have a file with name “a.txt” then the default text editor would be used. That is not the case in Linux (well the File Manager uses similar concept , see I told you it is confusing). The file type in linux is determined by the header in the file that is stored along with the files and not seen by us normally. Thus allowing you to store a pdf file with “.txt” extension and still be able to use pdf viewer to open the file. How cool is that 🙂 or how confusing is that 🙁

6) Applications

Some would say that the number of applications available on Windows is much more that available on Linux. Oh yeah, surely and how many of them you can use or rather how many of them are required. If not all, most of the useful ones are paid. So, you need to buy a license to use it. This is not the case with Linux, you have some couple of thousands of applications with mostly very decent GUI’s developed by Open Source advocates. And they were actually generous enough to compile it to “.exe” for the windows also.

7) Fanboys

The main reason for liking any one of the OS is probably because you met a Windows fanboy first so you also became a Windows fanboy. If you met a Linux fanboy first then you would become a Linux fan. Okay, there are chances that you met a more hardcore fanboy of the other side of the war, then he might convert you to his side and win over you.

I will leave it at abrupt end, so that it can tickle some more thoughts in both you and me 🙂

Enhanced by Zemanta