Archive for December, 2008

How to crash a DELL laptop in seconds and unscrew it (with a video)

P.S. The whole video/literature etc. is not targeted to malign the manufacturer and is rather based on writer’s personal experience. No offense meant.

A brief intro on how it happened

It all started with my adamant attitude to have a dual partition on my Dell Vostro 1510. Fedora, my obvious choice led to multiple crash of the lappy’s motherboard. The reason sounds strange, but is the concrete reason, as it happened not once but rather twice. Burnt the ISO image of Fedora Core 10 on a DVD and began to boot the lappy. It started normal, but before the UI asking for Fedora installation could load, the laptop hung with nothing shown on the LCD. Forceful shutdown and subsequent reboot led to weird behavior, caps lock, num lock and scroll LEDs glowing indefinitely, without anything up on the LCD. The usual methods of removing the RAM, resetting the static electricity failed to work and it turned out that it was a motherboard failure. Hence a replace for the same was done by the manufacturer.

Video

The video below is shootout of the replacement of the motherboard. ( Done by manufacturer’s engineer). But you may give a try on your old laptop or if your eagerness could not be held anymore.
Part 1

Part 2

Part 3

Part 4

Part5

Part 6

Part 7

How did we capture and process the video

The video capture was done using a Sony Ericsson phone and which resulted in multiple 3gp files. It was essential to merger these multiple files and convert them into flv format for upload using some tool. ffmpeg was the ideal option and worked like a wonder. Key steps were …

-> Converting indiviual 3GP files to flv with all the parameters viz. bitrate, frame etc

ffmpeg -i file.3gp -s 320×240 -vcodec h263 -r 25000 -b 200 -ab 64 -acodec amr -ac 1 -ar 8000 file.flv

-> Merge all files into single. This method somehow did not work with flv files, hence they were converted to mpg format and back to flv for upload to youtube.

converting to mpg with same parameters

ffmpeg -i file.flv -sameq -y file.mpg

Merging into single file

cat 76.mpg 77.mpg 78.mpg 79.mpg 80.mpg >final_mpg.mpg(This method somehow did not work with flv files)

And finally, back to flv file

ffmpeg -i final_mpg.mpg -sameq final.flv

Tags : , , ,

A strikingly odd web application exposure

Without having to expose your backend stuff to the internet, how do you service a WAP/WEB request. The blog below discusses a typical method of achieving the same. Assuming that whole web system is being developed in a intranet and not hosted outside. Let us call the internal unexposed server as A. We need a server hosted on internet to fetch the WAP/WEB requests from the mobile or computer. This server is called as B. The request is being fired on the server B, the request is written to a flat file called request file. Server A runs a shell program viz fetchrequest.sh which reads the request file every second for any new requests coming  using the curl unix utility. Meanwhile, the server B sleeps off and waits for a response from server A. Server A will read the request and if its new (newness of a request is determined by saving the previous  request number in a global shell environment variable) server A processes it and shoots back the response to server B in the form of a file via FTP. Server B, in its sleeping state waits for the this FTP response file. Once recieved, it pushes back the response to the user. The whole wait process is scheduled for a fixed period of time, after which a dummy response is send like server is down, request failed, bla bla etc . Let us see how the same is achieved in fetchreques.sh running on server A.

File fetchrequest.sh

#!/bin/bash
while [ 10 -eq 10 ]

#Runs in a infinite loop checking request file at server B every second
do
if [ `env | grep -c lastCounter` = 1 ];then
newCounter=`curl -s http://serverB/requestFile.txt | tail -1 | cut -d: -f1`

#Reading request file at server B
param=`curl -s serverB/requestFile.txt | tail -1 | cut -d: -f2` #Extracting the request parameters
echo newCounter : $newCounter lastCounter : $lastCounter

#If there is a new request, sending a response back to the server B
if [ "$newCounter" != "$lastCounter" ]; then
echo "Need to send a response"
echo "Response URL : http://serverA/something.pl?action=something&param1&param2"

#Trimming of the response that needs to be send to serverB and storing it in a variable
output=`curl -s "http://serverA/something.pl?action=something&param1&param2" | grep 'cap\\|img' |
sed \ 's/<src>.*<\/src>//g;s/<cap>/\:/g;s/<\/cap>//g;s/<img>/\:/g;s/<\/img>//g'`
echo "Response received : $output"

#writing the response to a flat file to be FTPed to server B
`echo $output>"rp_$newCounter.txt"`
`export filename==rp_$newCounter.txt`
`echo ls -l "rp_$newCounter.txt"`
typeset -i responseSize=`wc -c rp_$newCounter.txt | cut -d" " -f1`
echo "Response size $responseSize"

#If the process response is garbled, small or null, sending a dummy error in FTP file
if [ $responseSize = 1 ];then
`echo "We are working , try later" > "rp_$newCounter.txt"`
fi

#making an FTP connection to serverB and launching the response file
`curl -s -T "rp_$newCounter.txt" -u username:password"ftp://serverB/rp_$newCounter.txt"`
echo "Uploaded the FTP file for $newCounter request"
`rm -f rp_$newCounter.txt`
echo "Deleting rp_$newCounter.txt after upload"

#Updating the request environment variable
lastCounter=$newCounter
export lastCounter
fi
else
lastCounter=`curl -s http://serverB/mobRequests.txt | tail -1 | cut -d: -f1`
export lastCounter
fi
done

The whole system works very well, and the requests are processed and response send to user. There are however limitations to this model.

Tags : , , , , ,