Skip navigation.

Blog

Skip the blog side panel.

On 23rd of April 2015, Mihai Șucan passed away due to metastatic cancer caused by RDEB.

My name is Mihai and I work on the Firefox developer tools. When it comes to web development, I like both server-side and client-side work. I am mainly interested in web browsers, web standards and related technologies.

Opera2 script

Hello people!

Given the fact I'm constantly checking new Opera builds, I repeat lots of things. I decided to write my own BASH script which does the common work.

To better understand how the script works, and what it needs to do for me, here's an explanation of my usual testing setup.

First, I run Ubuntu Linux. I always keep and use the latest official stable release of Opera. I don't use the Debian package, because I want to upgrade more often than the repos. As such, I use the official tar.gz/tar.bz2 packages: I unpack them myself and I upgrade the files manually.

My stable Opera installation is self-contained within a single folder: ~/bin/opera. My profile is self-contained as well, within ~/bin/opera/usersettings (the default profile folder). I don't risk using ~/.opera. This way, I can make sure I always backup my entire Opera nicely - just the usersettings folder. That's where I keep all the Opera files, including plugins and emails.

I keep the weeklies in a completely separate folder: ~/opera-dev/linux. Here I manually unpack tar.gz/tar.bz2 archives. The nice thing about the Opera archives is you can immediately run them, since they create their own profile subfolders. This way I can have as many Opera "installations" running simultaneously without any problems.

By now, you can tell I have to manually move the archives I download to a predefined location where I store them. Also, if I want to test an experimental build with my stable profile, I generally don't have time to do it. That's because I would have to manually modify the INI files to point to the location of the experimental build, after I copy the entire stable profile folder. That's boring. :)

As such, here's how to use the Opera2 script:

  • opera2 clean
    

    This removes the profile of your latest Opera build. You can configure where experimental builds are located using the DIR_OP_DEV variable.

  • opera2 clean-run
    

    The same as above, but Opera will be started afterwards.

  • opera2 unpack opera-*.tar.bz2/gz
    

    This unpacks the Opera build you want designated by the second argument. The build must be provided as a tar.gz or tar.bz2 file - as the official ones are. The package will moved to the configured DIR_OP_PACK, and the content of the archive will be extracted to your DIR_OP_DEV.

  • opera2 unpack-run opera-*.tar.bz2/gz
    

    The same as above, but the script will also start Opera from the extracted folder.

  • opera2 upgrade opera-*
    

    This will "upgrade" the Opera build you want designated by the second argument - a folder name starting with "opera-" followed by the major and minor version (this is the default naming of Opera builds). If the second argument is not specified, the current working directory will be used.

    The script will copy files from your stable profile folder (defined by DIR_OP_STABLE) to the profile of the build you specified. The script will also make some changes to several copied files (will replace all paths pointing to the stable Opera installation folder to the new build).

    Warning: Doing this will DELETE the profile of the target Opera build. The script does NOT try to detect if the destination folder is REALLY an experimental build. Do NOT run this on your Opera stable installation folder.

  • opera2 any thing else (or no arguments)
    

    This will start the latest Opera build from the configured DIR_OP_DEV with the provided arguments. You can configure other applications to automatically open links with this script - the latest Opera build.

You should check the script source ... to be sure it will not break your stable installation. :) Always check the result of running this script before starting Opera.

As you can see, the script is tailored to my needs. Care should be taken when using the script. I am sure it does not work if your stable installation is configured with "exotic" file paths. The script was only tested with Opera 9.x builds, on Ubuntu 7.04.

Download the Opera2 script.

New project: ReTidy page cleaner

I did publish my latest PHP script: the ReTidy page cleaner. The script allows you to clean HTML documents exported from word processing applications. For more details look at the ReTidy project page.

Opera Chat log analyzer

Hello!

Did you know you can enable logging in Opera Chat? It works with Opera 8 and 9. Perhaps with Opera 7 too (I am not sure).

To enable logging for Opera Chat edit your mail/accounts.ini file and add/change:

Incoming Log File=c:\path\to\your_file.log

... for the [account] you want.

The generated log is debug mode, almost unreadable by humans. Plus, it's a single file: no separate files for private messages or channels.

Because of this I have made script that parses the log and generates human readable files.

One tiny problem: Opera does not include the log start/end date (only the time), which forces me to guess the log date. Log date guessing works by catching all UNIX timestamps sent by the IRC server, user signon, topic date, etc.

The script creates files for private chats, channels and one $server file

For one file of 166.4 MB on AMD Duron 1.3ghz 512MB RAM with 7200 RPM HDD running Ubuntu 6.06 Linux, PHP 5.1.2 ... parsing took about 5 minutes. The script generated 135 files (12.3 MB). Average speed: 502 KB/s.

For this release I have optimized the code for better speed, initially this script was 3 times slower.

The script was tested on irc.opera.com and irc.freenode.net.

The output is text, not HTML.

Generally the script should run fine, but you can easily brake it. If you improve the script please send the updated file to me.

You need only PHP, nothing else. It probably works with PHP 4 too (I only tested with PHP 5.1).

Download the script.

Rename the file to .php. Uploaded as .txt to avoid conflicts.

Thanks and let me know if you find this useful. Any comments suggestions are welcome!