Tuesday, May 27, 2008

How to convert DVD movie to .3gp

Most modern mobile phones can play movies in .3gp format. Here's an example, how to convert a movie on DVD to .3gp format. Of course this is not the only way how to do it:
  1. Open DVD Shrink, go to "Edit" -> "Preferences" -> "Output files" & uncheck "Split VOB files into 1GB size chunks
  2. open DVD, choose Re-author
  3. Drag the Main movie title into "DVD structure" window
  4. Go to "Compression settings", and choose only one language, uncheck all subtitles. Be sure that the video compression is set to 100% or "no compression" (although not mandatory, this is major time saver option)
  5. In the "DVD structure" windows, right click on the movie title, and choose "Set Start/End frames". This way you can remove unwanted frames from the beginning or the end of the movie .- e.g. opening and closing credits (again not mandatory, but it is space saver option)
  6. Click "Backup", in "Select backup target" choose "Hard disk folder", and set the target folder for DVD output files, e.g. "c:\movie"
  7. Click "OK" and wait a couple of minutes until DVDShrink finishes its job.
  8. Now go to DVD output folder (e.g. c:\movie) and rename the biggest file (something like VTS_01_1.VOB) to movie.mpg. You can delete all other files. Now you have a movie in one .mpg file, with one audio track and no subtitles. And in the same step we 've cut the credits from the movie.
  9. In the following steps we'll try go get some movie details, and figure out which parts of the movie we can cut
  10. Open movie.mpg in your favourite movie player, and pause at some bright scene
  11. press "Alt"+"Print Screen" on your keyboard, open paint (START->All programs->Accessories->Paint) and paste the clipboard (edit->paste)
  12. Zoom the spot just above the movie, and draw a line through the black part, that we want to crop from the final movie. Check the length of the line in the lower right corner of the paint window, and choose the next even number (in this example the length is 71 px, so we choose 72)
  13. Repeat the same procedure for the lower black part of the movie, for the movie width and the movie height. See the picture below:
  14. Now some simple math; our input movie is 1024x426. We want to resize it to 320 px width and keep the aspect ratio. So we can calculate the output height like that:
      • 1024/426=320/width => width = 133
      • we choose the next even value, so the size of our output movie will be 320x134
  15. In the next steps we'll convert the .mpg file to .3gp, using a command line tool "ffmpeg"
  16. Get the ffmpeg binaries here and extract the archive somewhere, e.g. c:\programs\ffmpeg (I got this version from super installation, because not all windows binaries have support for 3gp. This version does, at least it works on my system)
  17. open command line (START->Run->cmd)
  18. in terminal windows, type :
    1. > cd \programs\ffmpeg
    2. > ffmpeg.exe -i c:\movie\movie.mpg -croptop 72 -cropbottom 78 -vcodec mpeg4 -b 144k -bitexact -hq -s 320x134 -r 25 -acodec aac -ac 2 -ar 48000 -ab 24k -f 3gp c:\movie\movie.3gp
  19. Some explanation of the above command:
    • -i :input file
    • -croptop/-cropbottom :set crop top/bottom band size (what we've measured before)
    • -r :frame rate
    • -b :bitrate
    • -hq :higher quality
    • -s :output size (what we've measured and calculated before)
    • -acodec :audio codec
    • -ac :use 2 for stereo, 1 for mono
    • -ar :audio sampling rate
    • -ab :audio bitrate
    • -f :force format
  20. After a while you'll have a brand new .3gp movie, with the original aspect ratio, without black borders and without credits!
  21. transfer the movie.3gp file to your mobile phone and enjoy the silence of your kids watching the movie when you're in traffic jam ;-)

If you have time, you can use 2-pass encoding, which should produce a better quality movie. Although I'm not really sure if you'll spot any difference on your small mobile phone screen.
For 2-pass encoding use the following commands:
  • > ffmpeg.exe -i c:\movie\movie.mpg -croptop 72 -cropbottom 78 -vcodec mpeg4 -b 144k -bitexact -hq -s 320x134 -r 25 -acodec aac -ac 2 -ar 48000 -ab 24k -f 3gp -pass 1 c:\movie\movie.3gp
  • > ffmpeg.exe -i c:\movie\movie.mpg -croptop 72 -cropbottom 78 -vcodec mpeg4 -b 144k -bitexact -hq -s 320x134 -r 25 -acodec aac -ac 2 -ar 48000 -ab 24k -f 3gp -pass 2 c:\movie\movie.3gp

Some gui alternatives, if the procedure above is too complicated, although at my knowledge they can't handle movie in DVD format, but only a movie already in one file (.avi, .mpg or something):

Monday, May 19, 2008

How to stamp date on digital photos

Using a totally free command line tool jdatestamp, works in GNU/Linux and in Windows:

- get jdatestamp here (for windows click on jdatestamp-1.1-win32.zip)
- extract the zip archive somewhere (e.g. c:\programs\jdatestamp)
- put all the photos, which you want to stamp with the creation date, in one folder (e.g. "c:\pictures\orig")
- open command line (START->Run->cmd)
- in terminal window, type:
> cd c:\programs\jdatestamp
> jdatestamp -datefmt "@d.@m.%Y" -pointsize 40x -color goldenrod1 -trans 40 -outfile "c:\pictures\stamped\@f" "c:\pictures\orig\*.jpg"

- wait until the program finishes. You'll find stamped photos in "c:\pictures\stamped\" directory.

Short explanation:
- datefmt : date format string (date helper page here)
- pointsize : size of the text; if followed by "x" (e.g. 40x) the size is relative
- color : self explanatory (all possible colors here - basically you can choose any 24 bit color)
- trans : set the transparency of text


More detailded userguide here. Of course you can choose the options however you like.


This is what you get with the above options:

SSH authentication using keys

First you have to create a key. Although using a password to further protect your key is not obligatory, I personally very much recommend using a password:

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): xxxxxxxxxxx
Enter same passphrase again: xxxxxxxxxxx
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx user@host


Then you have to upload your public key to the remote host:

$cat /home/user/.ssh/id_rsa.pub |ssh user@host "cat >> .ssh/authorized_keys"

Before you connect to the remote host, you can use the following command:

$ ssh-add
Enter passphrase for /home/user/.ssh/id_rsa:
Identity added: /home/user/.ssh/id_rsa (/home/user/.ssh/id_rsa)


This way you don't have to provide the password for your key each time you connect to the remote host.

Great page with some more very useful ssh tricks here.

Tuesday, April 22, 2008

Sylpheed and gmail IMAP

To fix how sylpheed manages IMAP folders for a gmail account, I did the following:

When you delete a message it actually goes to the Trash folder in gmail. I still have to figure out how to remove "All mail" from listing.

Thursday, February 21, 2008

"network unavailable" gmail mobile problem resolved

Problem:
Gmail mobile notifies an error: "Network unavailable" and says something like "This program requires a working data connection. Please check your signal strength" or "java.lang.RuntimeException: Unexpected server response: 403 Forbidden" or similar.

Solution (worked for me on my SonyEricsson):
Menu -> Settings -> Connectivity -> Internet profiles -> New profile -> Name: Gprs /*or something else */ , Connect using: /* Choose GPRS Data account */ -> Save
Go back to Interet settings -> Settings for Java -> Choose prevoiusly created profile, e.g. "Gprs"

If the solution doesn't work for you, don't blame me.

Saturday, January 20, 2007

Adobe Acrobat Reader is not the only PDF reader

If you thing Adobe Acrobat Reader is too slow and too complex, then you should try Foxit Reader.

Advantages, taken from the manufacturer's web site (excluded are characteristics of non-free version):
  • Incredibly small: The download size of Foxit Reader is only 1.5 M which is a fraction of Acrobat Reader 20 M size
  • Breezing-fast: When you run Foxit Reader, it launches instantly without any delay. You are not forced to view an annoying splash window displaying company logo, author names, etc.
  • High security and privacy: Foxit Reader highly respects the security and privacy of users and will never connect to Internet without users' permission. While other PDF Reader often silently connects to the Internet in the background. Foxit PDF Reader does not contain any spyware or adware.
In a couple of months using it I had no complaints yet. Available are also versions for Windows Mobile, Embedded Linux, Desktop Linux, and even U3 USB flash drives! If you need it, it also integrates into your web browser.

Friday, January 19, 2007

Import pictures from digital cameras to creation-based folders

I use picasa for managing pictures from digital cameras, but I don't like its importing module.

As I like to have files and folders organized, I want to have pictures taken on one day in the same folder (which makes searching really easy), e.g.:

Since Picasa can't import in such way, I found one program that does that (and a lot of other things too):

http://www.nabocorp.com/cam2pc/freeware.php
(freeware version does its job more than good enough):


After inserting memory card into reader or connecting digital camera to your PC, just choose "Download pictures using Cam2PC" in the context menu, and click "OK":

Remote desktop with 0 configuration

Edit: new version has some new features (not described in this post)

This program is just great. It allows (encrypted) remote desktop connection without any configuration at all. Something like VNC or Remote Desktop, but with no need for opening ports on firewall, forwarding ports on router, configuring how to encrypt traffic etc. And it works on Win XP Home also (which lacks of Remote Desktop).

http://www.crossloop.com/index.html

e.g.: Computer B want to control desktop on computer A:

1. Computer A starts with "Access" part of the program. Name can be anything alphanumeric, Access Code is 12 digit number (used for encoding)
(all images are from
http://www.crossloop.com/ipage.htm?id=help



2. Computer B starts with "Share" part, entering the same Name and Access Code:


3. Computer A allows the connection


And thats it.

Some minor considerations:
  • weak part of "0 configuration" is that the traffic (or at least some part of the traffic) must travel through some third-party system, in this case the manufacturer's servers. Although all the traffic is encrypted, you have to consider the privacy issue when using this program (on the other hand, are you afraid somebody is snooping on your gmail account?)
  • the program is actually a shell around TightVNC, what might be a problem, if you already have TightVNC running - after you close the connection, the normal TightVNC also stops.
  • it has no module to transfer files or folders between two computers (EDIT: new version has thi)
  • computer running as "HOST" must grant the connection, so you can't use this program e.g. to control your home PC from work, if nobody is at home
  • only works in windows
Licence: Freeware, no spyware, no small print in EULA/TOS.


If privacy consideration is keeping you back from usage, there is an alternative, but it needs more configuration, resources and work to be done:


http://www.uvnc.com/addons/repeater.html
http://www.uvnc.com/addons/nat2nat.html

Similar principle, but instead of remote desktop you get virtual private network:
https://secure.logmein.com/products/hamachi/vpn.asp

Tuesday, January 16, 2007

Saving desktop layout icons position in Windows

Really comes in handy, especially if you have bunch of icons arranged in different groups all over the desktop, and suddenly they mess up for various reasons and who knows why.

2 variants, I installed the second one:
http://www.snapfiles.com/get/iconrestore.html
http://www.nthelp.com/50/save_desktop_layout.htm

Security tab in Windows XP Home


Normally you can change security settings for files or folders in Windows XP Home in safe mode. But there's a way to bypass that restriction.


Download and install
x86 (Intel) version of the Security Configuration Manager from Microsoft web site:

KB: http://support.microsoft.com/?kbid=245216
Direct download link: ftp://ftp.microsoft.com/bussys/winnt/winnt-public/to
ols/scm/SCESP4I.EXE

























Alternative: ACLview

Sunday, January 14, 2007

Connecting unpatched system to the internet

Did you know, if you fresh install windows XP or you bring a computer with preinstalled windows XP (doesn't hold for windows XP with SP2 integrated) from the store and you connect it to the internet, it will most likely be infected in just a couple of minutes, even though you won't even touch the keyboard or the mouse!

Why? A lot has been written about that:
http://news.com.com/Study:+Unpatched+PCs+compromised+in+20+minutes/2100-7349_3-5313402.html

http://aroundcny.com/technofile/texts/tec082904.html
http://www.techworld.com/security/news/index.cfm?NewsID=5535

How to defend yourself? Read the great tutorial from the sans's institute:
http://www.sans.org/reading_room/whitepapers/windows/1298.php (PDF file, 1,18 MByte)


Windows XP SP2 turned on the firewall by default, so it eliminated that problem. But you can still see users installing windows XP with SP1 after the infection, and wondering, why are they being infected again. And they surely believe the Windows Update is just another Microsoft invention, so they could spy on them using pirated version of windows.

Browse safe with internet explorer

If you don't/hate to/can't use account with limited credentials for your normal work in windows, you can still use the following program which will run Internet Explorer and default mail agent with limited credentials:

http://www.amustsoft.com/1-defender/


Why is that useful: While browsing the internet you can come across malicious web site, which hosts exploits for your browser. If your browser is vulnerable, malicious things could be installed on your system (mostly spyware). By running the browser with limited credentials you can limit the impact of the infection, because the malware can't access important systems folders. For more info check the manufacturer's web site.

Some notes:
  • It changes the IE and mail agent's shortcuts on the desktop and quick launch toolbar
  • It does more or less the same thing as Microsoft's DropMyRights, but it is a little more user-friendly
  • Internet Explorer has to be set as default web browser (have know idea why)
  • You won't be able to install active-x/plug-ins this way (ie. flash plugin), but you can of course still run IE normal way from shortcut in start menu
  • 1-defender doesn't handle .html links, so if you double click on the .html or .htm, IE with full credentials will open.
Licence: Freeware




















Very useful replacement for windows clock

Very useful and simple replacement for windows clock in taskbar. Just like in GNOME. Left click on the clock shows the calendar, with right click you can access preferences, where you can configure come settings (not too many though). I really like it, and it's under GPL licence (in other words - totally free), and it's low on resources:

http://wincalendartime.sourceforge.net/