Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, January 16, 2012

Extract links from web pages

One or two weeks ago, I tried to download some videos from a website under Linux. Of course it was not possible to simply download the videos using the browser - the videos were secured. A challenge for a hacker. ;) After a quick search in the Ubuntu Software Center I found get-flash-videos. It is a small Perl command line program, capable for retrieving flash movies from a wide variety of movie sites. But sadly it just worked one or two times for me. On the other day, it tried the program, it stopped working. And so began the search for a solution...

For Windows I am using URL Snooper 2 from Mouser software. It is a great utility. A very powerfull tool in combination with a download manager like the Firefox extension down them all. You can get every video from the web with ease.

But I did not find any tool like URL Snooper for Linux and so - I searched the web for some "inspiration". And finally - I found ngrep. It is an command line tool - a bit old (not maintained since 2006) - but easy to use.
Combined with some Perl commands and "down them all" it is quite powerfull. Not as easy and powerful like URL Snooper, but good enough to download the movies I wanted.
And the best: the command fits into one single line. ;) (okay, if you have a big display, where 177 chars will fit... but it is one line). Of course it could be optimized further and some chars could be saved.

Because this code is for the extraction of movies from an adult website, I will not post the link here. ;)
Here is the "proof of concept":
sudo ngrep -n 1 -q -d eth0 '(/key.*flv).*Host: ([\d.])' 'tcp and dst port 80' | perl -ne 'm/.*(\/key.*flv).*Host: (\d+.\d+.\d+.\d+).*/; if ($2){ print "http://$2$1\n"; exit; }'
Take it as a source for your inspiration. Try to figure out what the line of code is doing. Ngrep and Perl can be your friends!

Sunday, February 13, 2011

UART - Video

In this small video, you can see a simple counter made with my UART board. The program for counting up the LEDs is running on a PC. The µC only communicates with the PC and is responsive to his commands.

Monday, January 3, 2011

Black screen after upgrading from Ubuntu 10.04 to 10.10

After upgrading my Ubuntu from 10.04 to 10.10 i got only black screens or weird distorted graphics on my Acer Tracelmate 220 laptop with Intel 830 graphics card.

The solution for this misery:

  1. Boot in recovery mode with root console and log on
  2. change the xorg.conf settings to "vesa" ("enable VESA": https://wiki.ubuntu.com/X/Bugs/Mavericki8xxStatus)
  3. Then follow those instructions and set the "nomodesetup" for grub: http://ubuntuforums.org/showthread.php?t=1613132

This gave me back X11 and Gnome - finally! :D

.oO(It cost me only several hours to fix the da** problem...)

Tuesday, December 28, 2010

"RS-232 Testboard" - more software

Just finished some libraries and tests programs for the "RS-232 Testboard" . You can download the package here: test-software.zip
I wrote a low level UART library, a high level library, and two example programs, showing the usage of the high level library (and as a bonus they have some nice effects).
All code was tested with Linux - but it should work with DOS too. If you want to compile it under Linux, you will need the ncurses developer library for the second example program.
Hm... perhaps i will upload some videos soon.

UART toy - additional comments...

I forgot to mention, that the Linux program must be executed as root. Otherwise it will not work, because it needs low level access to the serial port.
And the program must be compiled with optimization turned on.

The correct preprocessor command for GCC under Linux is "__linux__" - with two underscores and in small letters.

All commands in the instruction set are stated as ASCII characters. The return values and the parameters are in hex.


If someone got the circuit to work with Windows XP, please inform me. ;)

Monday, December 27, 2010

UART toy - part 3

And another part (not the last one) of my UART series.
Here is a piece of code for the PC to establish a connection to the RS232 testboard and to communicate with it..
http://sites.google.com/site/species0x2118/testboard.zip

It is just an example how to interface with the board and not a complete library. The example application sets the outputs, reads in the inputs, reads the analog input and calculates the voltage on that pin. Everything with hardware handshake.
But you need the right cable for the handshake. Otherwise change the "true" in the uartSend commands to "false" and delete the handshake activation.

The software is tested under DOS with TurboC and under Ubuntu Linux with GCC. The source compiles with Open Watcom too - but the Watcom binary is not tested under DOS yet.
I changed the compiler preprocessor macros for the recognition of operating systems and compilers several times - but did not test every combination with every operatin system and every compiler. Perhaps you need to figure out the correct setup for your system (or just delete the stuff you do not need).

It took me several hours to figure out, that linux needs an activated FIFO control register. Otherwise the data transmission will fail in 99% of the cases.

Saturday, May 15, 2010

Finally!

I was able to get my old Hewlett Packard photosmart 1115 to work - with Windows Vista.
It took me 8 hours to plan and setup an external print server with linux and cups.
Finding the right operating system was quite a challenge.

But now the s*** works!
In the end i installed Debian Linux 5.
And i'm still a bit confused why Vista is so stubborn when it comes to printer support. (And HP in supporting old printers with drivers for new operating systems)
With my old XP i have no problems - no matter how i connect the printer to the computer - the printer just works.
The opposite with Vista - no matter how i tried getting it to work - it was resisting my efforts... till today.
But now: the resistance is futile! XD