Friday, December 26, 2008

How to commit only needed files in svn

Sometimes I want to commit only several files using svn (subversion) command line.

What is the best way? I use this one.

First of all I see the status of my svn repository:
svn status
If I see ? mark at the start of the line, I then decide should I add (svn add dir/filename) or delete or whatever.

Later I do as follows:
svn status | cut -c8- > out.txt
What this does it deletes first 8 characters and dumps svn status to file. I then edit this file via some editor deleting lines I don't need.

And then I execute the following command, which would commit only those files present in out.txt
svn ci --targets out.txt --username USER -m Commit_message

Thursday, December 11, 2008

How to import mysql database from dump?

Simply use the following command (on Windows):

mysql.exe --default-character-set=utf8 -u root database_name < path\to\dump\file.sql

Assuming that you are using:
  • mysql without any password (if you still use password, then use -p option)
  • username root
  • dump file in utf8 encoding

Tuesday, December 2, 2008

Tuesday, November 11, 2008

How to change GIMP language in Windows

I started using GIMP many years ago since there was no better free graphics editor solution out there.

But every time I install it on my office desktop (Windows XP) I find it difficult to change language.

Now this is the solution: go to My Computer properties (or Control Panel, System), select Advanced Tab, and ADD new environment variable in the second text box:
- Variable name: LANG
- Variable value: en

And you have English Gimp. That's all folks :)

Friday, March 14, 2008

Changing only directory permissions in linux

Yesterday I have noticed that vTiger has released stable 5.0.4 version that was a key thing to upgrade from previous 5.0.4 RC. The procedure looked simple stupid.

But the problem I faced was linux file/directory permissions. The patch which should have been applied to the previous vTiger version consisted of many files which had 777 (read write for all) permissions. I know chmod but I nevertheless couldn't find the way to change only directory permissions.

So I googled for a while and found very useful bunch of commands. This will let you to change only directory permissions in unix:

find . -type d -exec chmod go-w {} \;

finds all directories (notice -type d) in the current directory and forbids to write for group and others (go-w)

find . -type f -exec chmod ug-r {} \;
finds all files in the current directory and forbids to read for owner and group

Sunday, March 2, 2008

Easy Eclipse for PHP

Today I have finally decided to move on creating PHP projects using EasyEclipse IDE. This great tool recently was in my mind but rather I was using UltraEdit.

After installing I have one very annoying issue with opening PHP files from Eclipse navigator. When opening some file it was opened not only in Eclipse Editor, but also in my default windows Editor - Ultraedit.

After googling for about 2 hours and getting no information how to solve this I decided try to tune Windows :) And surprisingly I found a solution: all you have to do is to delete *.php extension from File Types (under Windows -> Folder Options) in order to prevent these files being opened by your default Windows Editor. In other words, you should unassociate *.php extension in your operating system so EasyEclipse for PHP will behave correctly opening only one desired file instead of two...

Wednesday, January 23, 2008

Lithuanian puzzle

This is a lithuanian puzzle about money.

Pardavėjas prekiauja kepurėmis, kurių vieneto kaina yra 10 rublių. Prieina pirkėjas, pasimatuoja vieną kepurę. Sako, kad pirksiąs ir paduoda 25 rublius.

Kadangi pardavėjas neturi grąžos, tai pasiunčia berniuką pas kaimynę pasmulkinti kupiūrų. Berniukas netrukus sugrįžta ir atiduoda pardavėjui tris kupiūras - 10 + 10 + 5. Pardavėjas įteikia pirkėjui kepurę, grąžą 15 rublių ir padėkojęs už pirkinį atsisveikina.

Po keleto valandų į parduotuvę įsiveržia pasipiktinusi kaimynė. Dar nuo slenksčio pradeda šaukti, kad tie 25 rubliai yra padirbti ir pareikalauja, kad pardavėjas grąžintų jai pinigus, nes priešingu atveju bus iškviestas žandaras.

Pardavėjas nenori kelti skandalo ir, kad ir skaudama širdimi, atsidaro kasą ir atiduoda moteriškei tuos nelemtus 25 rublius.

Klausimas. Kokį nuostolį patyrė pardavėjas?

Wednesday, January 16, 2008

Enable utf-8 support for vTiger crm

vTiger CRM team has announced that they had moved to utf-8 in the new 5.0.4 version of this open source CRM. But I had some issues in order to make it work correctly.

First of all, your database should be utf-8 compliant.

But this is not enough. If you try to import data from vTiger front-end via CSV import, you will get your data correct in the front-end, but not in the back-end :) If you look at the database, you will see that it was saved as unicode (I mean those cahracters which are from other than ISO-885-1 charset).

And even if you open your database via phpMyAdmin administration tool, and enter some new account naming it i.e. "Account Žopa", you will get "Account ?opa" from the front-end while listing Sales > Accounts.

In order to make it work correctly, you need to add the following line in the function connect in include/database/PearDatabase.php file.

$this->query("SET CHARACTER SET utf8");

This will help you to solve problems with utf-8.