Showing posts with label HOWTO. Show all posts
Showing posts with label HOWTO. Show all posts

Sunday, December 23, 2007

Installing dsniff in Fedora Core 6 / Blag 60000

apt-get install libpcap libpcap-devel libnet libnet-devel
wget -c http://apt.sw.be/packages/dsniff/dsniff-2.3-0.rhel3.dag.i386.rpm
wget -c ftp://rpmfind.net/linux/fedora/core/development/i386/os/Fedora/openssl097a-0.9.7a-9.i386.rpm
#
# create symlink
#
ln -s /usr/lib/libpcap.so /usr/lib/libpcap.so.0.6.2
#
# install dsniff ... now it can't complain about anything...
#
rpm --install --force --nodeps ./dsniff-2.3-0.rhel3.dag.i386.rpm > /dev/null

See? it works....

# /usr/sbin/dsniff --help

/usr/sbin/dsniff: invalid option -- -
Version: 2.3
Usage: dsniff [-cdmn] [-i interface] [-s snaplen] [-f services]
[-t trigger[,...]] [-r|-w savefile] [expression]
[root@m6810]#

Wednesday, October 24, 2007

Building MIMMS on Fedora Core 6 / blag Linux - Download mms:// streams !

PROBLEM: You want to download a mms:// video stream to your Hard Disk
You find about MiMMS but found no up to date RPM for your system, and soon find that compiling it is a total nightmare.

SOLUTION:
I'm posting this in the interest of helping folks running blag Linux or Fedora Core 6 to build the MIMMS client on their systems. MiMMS is a Free Software program that downloads MMS:// video streaming URLs to your hard disk.

EXPLANATION:
The original program is provided over here at GNU.org. The problem is that the build process (just running "make") will complain about AN AWFUL LOT of missing pieces and libraries, with no further help in finding what's missing.

Well, since I'm shaved bald, I've saved you from all the HAIR PULLING.

Here's an example of all the errors you might encounter (I'm pasting here so Google searches can find this entry).

Error #1: Missing QT4-make
===========================================================
# make
qmake-qt4 -o Makefile.qmake
make: qmake-qt4: Command not found
make: *** [Makefile.qmake] Error 127
[root@m6810 mimms-2.0.1]#
===========================================================

Error #2: Missing C++ compiler
===========================================================
# make
qmake-qt4 -o Makefile.qmake
make -f Makefile.qmake
make[1]: Entering directory `/incoming/mimms-2.0.1'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include -I. -Ilibmms -I/usr/include/libmms -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I. -o mimms.o mimms.cpp
make[1]: g++: Command not found
make[1]: *** [mimms.o] Error 127
make[1]: Leaving directory `/incoming/mimms-2.0.1'
make: *** [build] Error 2
[root@m6810 mimms-2.0.1]#
===========================================================


Error #3: Missing libmms development libs
===========================================================
# make
make -f Makefile.qmake
make[1]: Entering directory `/incoming/mimms-2.0.1'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include -I. -Ilibmms -I/usr/include/libmms -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I. -o mimms.o mimms.cpp
mimms.cpp:28:17: error: mms.h: No such file or directory
mimms.cpp:29:18: error: mmsh.h: No such file or directory
mimms.cpp: In function ‘int main(int, char**)’:
mimms.cpp:238: error: ‘mms_t’ was not declared in this scope
mimms.cpp:238: error: ‘mms’ was not declared in this scope
mimms.cpp:239: error: ‘mmsh_t’ was not declared in this scope
mimms.cpp:239: error: ‘mmsh’ was not declared in this scope
mimms.cpp:321: error: ‘mms_connect’ was not declared in this scope
mimms.cpp:330: error: ‘mmsh_connect’ was not declared in this scope
mimms.cpp:341: error: ‘mms_get_length’ was not declared in this scope
mimms.cpp:341: error: ‘mmsh_get_length’ was not declared in this scope
mimms.cpp:386: error: ‘mms_read’ was not declared in this scope
mimms.cpp:387: error: ‘mmsh_read’ was not declared in this scope
mimms.cpp:400: error: ‘mms_get_current_pos’ was not declared in this scope
mimms.cpp:400: error: ‘mmsh_get_current_pos’ was not declared in this scope
make[1]: *** [mimms.o] Error 1
make[1]: Leaving directory `/incoming/mimms-2.0.1'
make: *** [build] Error 2
[root@m6810 mimms-2.0.1]#
===========================================================


Error #4: Missing glib.h
===========================================================
# make
make -f Makefile.qmake
make[1]: Entering directory `/incoming/mimms-2.0.1'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include -I. -Ilibmms -I/usr/include/libmms -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I. -o mimms.o mimms.cpp
In file included from /usr/include/libmms/mms.h:41,
from mimms.cpp:28:
/usr/include/libmms/bswap.h:25:18: error: glib.h: No such file or directory
make[1]: *** [mimms.o] Error 1
make[1]: Leaving directory `/incoming/mimms-2.0.1'
make: *** [build] Error 2
[root@m6810 mimms-2.0.1]# locate glib.h
/mnt/Windows/Qt/4.0.1/src/3rdparty/libjpeg/jpeglib.h
/usr/include/jpeglib.h
[root@m6810 mimms-2.0.1]#
===========================================================

SOLUTION: Use apt-get to install all the required libs BEFORE running make:

apt-get install gnu-c++ qt4-devel glib-devel glib2-devel libmms libmms-devel

That's it!. Now we type make and everything's fine:

WE COMPILE IT!:

# make
make -f Makefile.qmake
make[1]: Entering directory `/incoming/mimms-2.0.1'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include -I. -Ilibmms -I/usr/include/libmms -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I. -o mimms.o mimms.cpp
g++ -o mimms mimms.o -lmms -lQtCore -lpthread
make[1]: Leaving directory `/incoming/mimms-2.0.1'
[root@m6810 mimms-2.0.1]#

AND WE INSTALL IT!

# make install
make -f Makefile.qmake
make[1]: Entering directory `/incoming/mimms-2.0.1'
make[1]: Nothing to be done for `first'.
make[1]: Leaving directory `/incoming/mimms-2.0.1'
install -m755 -D mimms //usr/local/bin/mimms
install -m644 -D mimms.1 //usr/local/share/man/man1/mimms.1

DOES IT WORK? YES!

# mimms -h
MiMMS 2.0.1 - MiMMS isn't an MMS Message Sender.
It's an MMS (e.g. mms://) stream downloader.
Usage: mimms [options] [output]
Options:
-c, --clobber Allow overwriting an existing file;
by default, this is not allowed.
-t, --time Record for the given number of minutes;
by default, record until the end.
-v, --verbose Print verbose debug messages on stderr.
-q, --quiet Don't print status messages on stdout.
-h, --help Show this help message on stdout.
URL Argument:
mms (MMS) i.e. mms://[:port]/
will try all supported methods.
mmst (MMS TCP) i.e. mmst://[:port]/
will only try TCP method.
mmsu (MMS UDP) Not currently supported; (poorly suited
for streaming downloads anyway).
mmsh (MMS HTTP) i.e. mmsh://[:port]/
will only try HTTP method.
http (ASX HTTP) i.e. http://[:port]/[.asx]
only the first supported URL is used.
- (stdin) i.e. look for an MMS URL on stdin;
only the first supported URL is used.
Output Argument:
none Streams to file named based on the URL.
filename Streams to the given file.
- Streams to stdout. (Implies --quiet.)
[root@m6810 mimms-2.0.1]#

FINAL STEP: WE TEST IT...


Friday, August 17, 2007

VMware Player FC6 / blag installer for blondes ;)

I'm sick and tired of having to do the work that paid programmers should do.

And no, I'm not thinking about the nice guys at blag Linux which work nearly for free :)

I'm thinking about VMWare, which distributes a "VMWare player" aimed at end-users but makes installation a nightmare full of pitfalls needing patches and lots of manual fiddling.

Don't believe me? Do you think things are "fine" as they are and there's no room for improvement? see the results of this web search on Google and compare it to this one.

In short: I'm tired of having to do the work that paid programmers, many of them surely earning 50x more than me- should be doing in the first place.

Now, to follow the suggestion of Steve from the blag forums, I will just "CHILL OUT , man..." and let you have my script:


... so you will hopefully end up with VMware Player 2.0 up and running in your blag 60000 linux box (or hopefully Fedora Core 6 as well) running the latest 2.6.22-1 Linux kernel and just pressing [enter] a dozen times....


ENJOY:
http://the13thfloor.org/musthave/easyvmware4blag001.tar.gz

FC

Sunday, August 05, 2007

Extracting icon from win32 app (or apps) using WINE on Linux

Native Linux apps are of course preferable to running Win32 ones under compatibility libs like WINE.
But when you install one such app on Linux, one of the problems of those apps is what icon to put to the launcher object(s) in our desktop or Gnome panel.

(It's not that I use a lot but the PMView PRO trial and WORDVIEW.EXE PPVIEWER.EXEs from MSFT come to mind (as my winders now runs under Win4Lin)...

I found THIS FREEBIE from MSFT (actually a coding sample from MSDN).
http://download.microsoft.com/download/win95/utility/1.0/w9xxp/en-us/4493.exe

Just extract it with unzip, find icontool.exe, and then run it with wine ./icontool.exe
There's an option in the app that allows to "Extract Icon from EXE/DLL", navigate to your Win32 installed app (usually in your $home/.wine/drive_c/Program Files/Application_Name_here), find the EXE, and then use the option "EXPORT AS BMP" to save a BMP you can then use (after conversion to PNG) as icon for your win32 app under Linux. (Save it under /usr/share/pixmaps).

There you have. And if this helped you a lot, remember I always gladly accept $5 Amazon.com gift certificates delivered to my e-mail f c a s s i a @ g m a i l . c o m
:-D

Have a nice day!

FC

Friday, August 03, 2007

JAR is a bitch, and then you die!

[WARNING: This is geeky stuff, if you're NOT a computer geek, then scroll down to the next post. Move along, nothing to see here!]

Instead of the old adage "Life's a bitch, and then you die" I propose a new version: "JAR is a bitch, and then you die".

In case you're living in a bottle or you're not a geek, JAR is the Java JDK tool used to build the compressed ".JAR" (Java Archive) files that contain a Java software application (all the different binary files inside it). It's a tiny command line application just like everything in the JDK that should be no different or more complex to use than ZIP or tar.

However, it proved to be a real pain in the ass and a TIME WASTING EXERCISE, just to update a SINGLE TEXT LINE inside an existing .jar file's "Manifest".

1. What I wanted to do:
Unpack an existing application,
update its MANIFEST file, to include the "Main-Class: ClassnameHere" statement, so I could just start the application by typing

java -jar applicationname.jar
instead of using the author's ancient approach of having to name the "Main-Class" on the command-line every time...

java -classpath applicationname.jar LongNameofTheStupidStartupClass
2. I unpacked the existing application's .jar file just fine with 'unzip', and created a text file with my favorite text editor which read:

Main-Class: LongNameofTheStupidStartupClass

I saved it as "./manifestinfo.txt"

3. So, not having used jar before, I go to a tutorial I find online here

http://java.sun.com/docs/books/tutorial/deployment/jar/modman.html

which reads

"The basic command has this format:

jar cfm jar-file manifest-addition input-file(s)


...and thinking I know what I'm doing, I type:

$ jar -c jftpd.jar ./manifestinfo.txt ./ ./ftpserver/*


I get this as a result:



4. I had to close the terminal as I couldn't type anymore (I could type but I couldn't understand anything).

Then I found what I think is a more friendly explanation on how to update the "Manifest" of the .JAR file with new info, over HERE:
http://java.sun.com/developer/Books/javaprogramming/JAR/basics/update.html

(Later I realize that what happened in Step#3 was that I forgot to include the "f" parameter to indicate that I wanted output to a file rather than to STANDARD OUTPUT. What the **** is the purpose of having output of JAR to standard output?? I don't get it).

5. So I type
jar cf jftpd.jar ftpserver/*
and IT WORKS!
But I forgot about the new manifest info... so I type:

$ jar umf ./manifestinfo.txt ./jftpd.jar
...and I get this beauty:

java.io.IOException: misplaced continuation line
at java.util.jar.Attributes.read(Attributes.java:374)
at java.util.jar.Manifest.read(Manifest.java:182)
at java.util.jar.Manifest.(Manifest.java:52)
at sun.tools.jar.Main.update(Main.java:481)
at sun.tools.jar.Main.run(Main.java:184)
at sun.tools.jar.Main.main(Main.java:1022)
[fcassia@m6810 tmp]$

WHAT THE F#CK IS GOING ON NOW????????

6. You know what was the problem? the file "manifestinfo.txt" had TWO BLANK SPACES before the text "Main-Class: ..." and TWO BLANK LINES below it !! (I pressed [Enter] twice).

Apparently, JAR FREAKS OUT (this is JAVA 6.0 update 2 JDK's JAR, for crying out loud!).

7. I removed the two leading spaces and trailing blank lines and guess what? IT WORKED!.

[fcassia@m6810 tmp]$ jar umf ./manifestinfo.txt ./jftpd.jar
[fcassia@m6810 tmp]$

8. Done.... BASTARDS!!

9. Another Golden Rule when dealing with JAR:
JAR NAME APPARENTLY ALWAYS GOES LAST.

So, contradicting what would be the 'zip' usage of "hey zip, I want to update THIS ZIPFILE with THIS_DATA" (zip something.zip newfile.txt) in JAR is totally the opposite way: "hey JAR, I want THIS NEW FILE into THISJAR" (jar umf newdata ./intothisjar.jar).

GRRR

And finally, found this thread
http://forum.java.sun.com/thread.jspa?threadID=549376

See comment #11:
"
The JAR tool is rather finicky. I have found that each HEADER:VALUE pair must be separated by a newline but not more than 1 newline. When I tried putting blank lines in the MANIFEST, I would get "Error: failed to load Main-Class attribute...". Sun needs to update their tutorials or fix this problem with the JAR tool's manifest parser."

FINICKY? That's being mercyful...

and then comment #15:

"One diference between unix and windows' file system is that text files in unix always have a final linebreak at the end of the file, while windows doesn't need to.

Java, being developed by Sun primarily for the unix comunity requires that the
manifest file ends with a new-line.

no new-line, no manifest file."

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Want more? See the comments on page #2 of the above thread at Sun.com, discussing the "joys" of the "jar" command:

===================================
Does this instruction really work???

http://java.sun.com/docs/books/tutorial/deployment/jar/appman.html

They specify the following command:
jar cmf MyJar.jar Manifest.txt MyPackage/*.class

When I tried that with my classes and files (with different names, of
course), it didn't work. What worked for me is equivalent to the
following:
jar cmf Manifest.txt MyJar.jar MyPackage/*.class

The order is simply permuted. Maybe it's just Apple's Java
implementation. Is this what you were asking about?

-jonnie

==================

The Tutorial is wrong. It should be jar cfm, not cmf.
The order of the command must match the order of the parameters.

==================

Thank you. That is good to know.
===================================

I REST MY CASE:

JAR IS A BITCH, AND THEN YOU DIE

FC

Saturday, July 21, 2007

A red mouse pointer in Linux - The REALLY Important Things in Life ;)


For the moment -and for the last year or so- I'm running the free Linux distro "blag" from the UK. It's based on RedHat's Fedora Core 6 project, with a lot of stuff removed so that it fits on a single CD, and also a nice look, with custom visuals/login screen/backgrounds.

What it lacks, apparently like Fedora Core 6, is a set of NICE COLOUR mouse pointers. blag includes the default black cursors dubbed "bluecurve" and a white colour variation of the same. I didn't like those. I wanted a big red mouse pointer in Linux and the Gnome desktop.

Well, to make a long story short: I pulled my hair reading all the contradicting and conflicting info on changing mouse pointers. Most of the stuff on the net is seriously outdated. For instance you often find results from XFree86 lists several years back saying that Linux mouse cursors can only be black and white.

Here's how to install beautiful RED mouse pointers in blag 6K, and Fedora Core 6.x or higher for that matter:

I have settled on one of two choices: "red mix" and "Komix". I'll let you guys decide which ones are better...

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1. As root, from a shell do
cd /usr/share/icons

2. If you want Komix...
wget http://art4linux.org/pages/download/cursors/Komix-0.1.tar.gz
tar xvfz ./Komix-0.1.tar.gz
tar xvfz ./Komix-0.1/Komix-Red-Regular.tar.gz
tar xvfz ./Komix-0.1/Komix-Red-Large.tar.gz

Go to System->Preferences->Mouse
Click on the "Pointer" tab, scroll down and find Komix_Red below LBlueCurve. Click on that option. DONE!

3. If you want "red mix"
wget http://www.kde-look.org/CONTENT/content-files/5605-cursor_mix.tgz
tar xvfz ./5605-cursor_mix.tgz
Go to System->Preferences->Mouse
Click on the "Pointer" tab, scroll down and find "cursor_mix" at bottom. Click on that option. DONE!
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////




There you have, a nice red mouse pointer that you can ALWAYS see, even with the corner of your eye.
Enjoy!

FC

Tuesday, April 24, 2007

My first bash hacking in 7 years...

Last time I did a BASH (linux shell) script was, I think, back in y2k. I ran Caldera Openlinux in an ancient underpowered 233Mhz Pentium I, and the desktop was then bloated KDE. Nowadays, I run Blag, based on RedHat's Fedora Core 6.
But now I was fed up with having to manually seek, download and install "pptpconfig" to get a friendly-easy to use PPTP VPN applet. (Blag includes PPTP but for some reason pptpconfig is not included).

So, I spent a couple hours tonight reading -once again- about bash scripting HERE and HERE, and thanks to a great tutorial on Gnome desktop integration at RedHat's site HERE - I was able to code a simple script which downloads the required RPMs from Fedora repositories, calls the YUM system updater, and installs everything required for PPTP VPN networking into blag, creating a default launcher with nice icon in the desktop. It's a pretty simple script, but nobody had done it before. So here it is. I have released it under the GPL, for what it's worth.

WOW,I can still code stupid little shell scripts!. What an ego boost!. ;-)


Specially since my attention defficit personality usually makes me leave my programming projects incomplete at the first sign of trouble... this time that didn't happen and it was kinda fun, reminded me of my first babbling with OS/2 Rexx...

http://the13thfloor.org/blagpptp/easypptp4blag6kv0001.tar.gz

FC

Thursday, December 01, 2005

Single-man PalmOS PDA repair company is better than the official repair service.

I went through pda-repair hell a couple months ago, trying to get Sony to repair my broken PalmOS PDA, a beatiful Clié NX80V with mp3 playback, swinging LCD screen and 1.3MP digital camera. The device fell from a table to the floor and it just died. Swapping the battery with a
new one didn't help, nor did fiddling with the power switch.

Luckily for me, it was still under warranty, and it was purchased and registered in the U.S., so I shipped the dead PDA from South America to a friend in California, and then called Sony USA trying to obtain a RMA#. My friend would ship it back to Sony and when the repaired unit is received, he'd re-ship it down South. Easy right?. Wrong.

Sony's tech support number is an insanely designed speech-recognition IVR system where the system tries to outsmart the customer. For instance, I called from overseas, so there's no caller-id info present on the inbound international call -that I know of- so the system must have identified my call as "# not available". The IVR greeted me with a message along the lines of "are you the same person that just called from that same number about a Sony Handycam?". Bloody hell I was not!.

When I finally got a chance to speak with a "customer care representative", he insisted on painfuly slow pace trying to walk you, the idiot user, through all the joy of "resetting your PDA". Hint: telling the genius that you're fairly knowledgeable on PDAs and that you already tried everything including a new battery, that you left the PDA charging for weeks, and that you're on a long distance call and that you're paying through the nose won't help: "we still need to go through all the required steps" was the answer.

If you manage to skip the ignore the babbling from the other side, you'll eventually be turned to a tier-2 tech support, that is, someone who supposedly knows about the product instead of just reading from a workflow chart. I managed to convince the person that the PDA was efectivelly dead, and no ammound of fiddling or tinkering with it was going to bring it back to life. So he issued me a "work order number" (Sonyspeak for RMA), and told me I'd be receiving an empty prepaid box from Sony by Fedex, at my registered U.S. addres. I then told my U.S. friend to wait for this box from Sony... which never arrived, actually, it did, but it wasn´t sent by Sony.

Since it wasn't labeled "Sony" anywhere my friend's secretary never realized it was the very important box from Sony they were expecting. Ok, so it wasn't technically Sony's fault. But by the time the box was found by him, the PDA was already out of warranty by a few days, and the Fedex prepaid postage on the box expired. That left me with two options: tell my U.S. friend to throw the pda away or auction it as non-working. Definitely I didn't want to spend any more greenbacks on long distance international phone calls to the Sony IVR hell to obtain a new RMA#.

Luckily for me, I found about Chris Short. He´s a guy from Mankato, Minnesota, who runs his own PDA repair shop from home. Not only he enjoys a "100% positives" rate on eBay, his services are also inexpensive: you only pay for USPS shipping if you don´t agree with the quoted price.

In the end, I was able to get my NX80V PDA back in working order in a few days, and only spending $49 US dollars on it. While Sony´s official repair service wanted $150 -apparently their "flat fee" for out-of-warranty PDAs.

Recommended!. Find his ebay listings here.