"; */ ?>


24
Sep 08

How to Digg at Work

work, digg, life...

How many people do digg at work? Do you do it? The answer to this is mostly “YES”; sometimes, the answer is “NOT OFTEN”, in order to avoid “YES”; and the most rare answer is “NO”. And only sometimes, now days in 21st century, the answer could be “WHAT THE HECK IS DIGG!?”

However 99% of people will have no difficulties with answering the question “Do you work?”. That is due to the fact that “WORK” has been defined for a way longer period of time than “DIGG”. And most of the time, unless employed by Digg, its competitors, or “ Times Magazine”, DIGG and WORK do not go together. Therefore employees do not like to be caught by their managers and supervisors while reading fresh news from the Digg’s first page.

But there is nothing wrong with spending some time reading DIGG at work. In fact it can, and most of the time will boost the productivity, if not abused, and done right – really! According to our friend Albert Einstein, there is nothing as innovative and productive as taking 10-15 minutes breaks. And Albert generally knew what he was talking about. :)

A wise man once told me: “The secret to creativity is knowing how to hide your sources” (I believe it was also Einstein) – so here is a simple way of using Digg at work without causing any suspicion.

Lynx – is the answer to creating “work and digg” balance, and can be used to read pretty much any website, not only Digg. It is available on windows, Mac, comes pre-installed with most distributions of Linux, and according to its documentation is available for other platforms as well.

Here is what reading Digg at work using Lynx web browser would look like:

Reading Digg.com with Lynx Web Browser

Colors of the terminal could be changed to blend in better with the Desktop, and applications mostly used, which will depend on the nature of the job. Lynx is very easy to navigate – mostly just by using “up down left right” arrows, and is considered “work safe” – it is a simple text after all.

Boost your work productivity, and… happy Digging!

what else is interesting about digg: How does Digg Make Money?


15
Sep 08

Reset Lost Password in Sun Application Server

Sun Application Server Password ResetHappens to the best of us, less with system admins more with developers. But we are all human, and believe it or not we DO forget and loose passwords at least once every so often. Some time ago I wrote a tutorial on how to reset lost root password in mysql, and here is another similar tutorial on how to reset the lost domain password but this time for Sun Application Server.

Before going any further with this article, please first check “.asadminprefs” file:

cat /home/toly/.asadminprefs
 
AS_ADMIN_USER=admin
AS_ADMIN_PASSWORD=YourSecretPasswordInTextHere!

the admin password could be there

If it is not there, there are two ways to reset it:

  • Reinstall or recreate the affected domain.
  • Create a new dummy domain and copy its security key file over to the real domain to substitute the password.

Below is an explanation for the second approach (in case when “reinstall or recreate affected domain” is not an option):

Given:

 >   Sun App server is installed in                 "/opt/SUNWappserver"
 >   Domain to which the password is lost:   "domain1"

Step 1. Creating a new dummy domain

/opt/SUNWappserver/bin/asadmin create-domain --adminport 7070 --adminuser admin --instanceport 7071 dummy-domain
 
Please enter the admin password>password
Please enter the admin password again>password
Please enter the master password>password
Please enter the master password again>password
 
Domain dummy-domain created.

Step 2. Copy dummy-domain’s “admin-keyfile” to domain1’s “admin-keyfile”

cp /opt/SUNWappserver/domains/dummy-domain/config/admin-keyfile  /opt/SUNWappserver/domains/domain1/config/admin-keyfile

now the password for domain1 is “password” – DONE :)

Step 3. Deleting the dummy domain

/opt/SUNWappserver/bin/asadmin delete-domain dummy-domain
Domain dummy-domain deleted.

NOTES:

The above is true for Sun’s Application Server 8.x and later.

For Sun’s Application Server 9.x check out “change-admin-password


14
Sep 08

Configure Rails and MySQL to Support UTF-8

Rails on MySql

The fact that there are so many different countries, people and languages makes it very interesting to watch all them to use a single tool. Besides the different cultures of programming, there is a definite difference in languages that the tool needs to support in order to become widely used.

Luckily, if the tool is written to support UTF-8 encoding it is guaranteed to support all the modern spoken languages. Since UTF-8 is able to represent any character in the Unicode standard, yet the initial encoding of byte codes and character assignments for UTF-8 is backwards compatible with ASCII, and for these reasons, it is steadily becoming the preferred encoding for e-mail, web pages, and other places where characters are stored or streamed – in our case it is a mySql database.

When working with Rails on mySql, it is most of the time, a good practice to make sure the UTF-8 support is enabled, since even if there is no immediate need, in the future, clients of the Rails application could come from different points of Earth – due to the Earthy nature of the Internet.

Here are 3 simple steps on how to configure a Rails application and mySql database to support UTF-8 encoding:

Step 1. From the Rails side, due to the “convention over configuration” principle, there is only one thing to make sure of. Open the Rails database configuration file:

  vi config/database.yml

(here I used “vi” text editor, but any editor of choice can be used: notepad/textmate/emacs/aptana.. etc)

Notice the “encoding” option, and make sure it is set to “utf-8”:

  ...
        development:
        adapter: mysql
>>>  encoding: utf8
        database: my_international_db
        username: user
        password: password
        socket: /var/run/mysqld/mysqld.sock
  ...

That will conclude this step, since everything from Rails side is configured. Simple? Well, yes – Rails is well designed to keep it simple stupid.

Above is the sample for the Rails development environment, make sure that testing and production environments have the same configuration.

Step 2. Now it is time to configure MySql server. This will be done by editing “my.cnf” – mySQL configuration file:

  vi /etc/mysql/my.cnf

There are several sections in the file. Modify two of them – “client” and “mysqld” as shown below to configure mySql for UTF-8 support:

...
[client]
 
default-character-set=utf8
 
...
[mysqld]
 
default-character-set=utf8
character-set-server=utf8
default-collation=utf8_unicode_ci
...

Step 3. The very last action would be to restart MySql server. Here is an example on how to do it in Linux (Ubuntu):

  sudo /etc/init.d/mysql restart

NOTE: Only databases that are created after the above change will support UTF-8 encoding.

After these three steps Rails application and MySql server are configured, and ready to serve the whole planet!


11
Sep 08

Install Sun Application Server on Ubuntu

Sun Microsystems

On the client site when working on Java (or should I say JEE) projects, the application servers are most of the time “rotate” between these four: JBoss, Websphere, Weblogic, and someties Geronimo. However there are some clients who have pretty tight contracts with Sun, and in these cases the Sun Application Server is used.

I think now days in development world in general, well except maybe .NET part of it, Ubuntu and/or Mac OS slowly become OSs of choice for developers. Sun app server however is not the most used app server out there, and since its installation could be a bit non-straightforward, here are four simple steps on how to install it on Ubuntu box:

Step 1. Download the “.bin” form sun:

“Sun Java System Application Server”

http://java.sun.com/j2ee/1.4/download.html (I needed 8.2, but there are more recent ones)

Step 2. Change permissions, to make it runnable:

chmod 744 sjsas_pe-8_2-linux.bin

Step 3. If you just run it:

./sjsas_pe-8_2-linux.bin

It is going to complaint that it is missing a standard c++ library:

./sjsas_pe-8_2-linux.bin: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory

Having done some “apt-cache” searches ( apt-cache search libstdc++ ), found that Ubuntu has “libstdc++.so.6” in /usr/lib.
From /usr/lib run:

 sudo ln -s libstdc++.so.6 libstdc++-libc6.2-2.so.3

Step 4. Run it now, it will install Sun App Server successfully! * **

* Do not run installation as root – it will fail (for most sun app servers versions)

** If you use any form of Beryl (or some Compiz’es), disable it, or reload window manager as a “Gnome Manager”. This is due to the fact the the installer is written in Swing, and Swing does not get along too well with some display managers.


26
Aug 08

USSR is Winning Olympics 2008

USSR National EmblemI was born and pretty much raised in USSR (Ukraine), and therefore when it comes to sports – not war/politics and definitely not nationalism/silly Soviet patriotism, it makes me feel happy when any of the 15 USSR (former) republics athletes achieve gold/silver/bronze or just a good notable performance.

As a kid, I went to Children’s Olympic Reserve School doing sport gymnastics for several years, where I could see how high our standards were and just how important the role of sport was on the grand scale of things in the country.

So I was looking at “Overall Medal Standings” at the end of 2008 Olympics and came to an interesting conclusion:

NOC Name Total Gold Total Medals
Russia 23 72
Ukraine 7 27
Belarus 4 19
Georgia 3 6
Kazakhstan 2 13
Azerbaijan 1 7
Uzbekistan 1 6
Latvia 1 3
Estonia 1 2
Lithuania 0 5
Kyrgyzstan 0 2
Tajikistan 0 2
Armenia 0 6
Moldova 0 1
Total: 43 171

As the table above shows the (formerly :) ) strong USSR could have taken 43 gold medals, which is 7 medals ahead of US, but still leaves USSR at the second “gold” place after China, however it would take 171 total medals which would make it a 2008 Olympics winner by the total medal count!

One “the very true” argument could be “foo get abour it, USSR is no more” – true. But I was mentally flipping pages through the history, combining the medals of Roman Empire, Osman Empire, and even Delian League, but their medal count did not come even close the third place. (“Persian Empire” came pretty close actually :) )

Just wanted to bounce it against people of www ;)