Fixing GRUB bootloader on dual-boot PC

December 11th, 2009 Michael Stepanov No comments

I have two versions of LinuxMCE on my HTPC – stable 0710 and developer 0810. The 0810 was installed after 0710. So, the GRUB bootloader was placed on 0810 partition. A few days ago I decided re-install 0810 from the scratch and I deleted its partition including GRUB booloader. As result I couldn’t boot 0710 anymore. Thanks to GRUB power and flexibility I was able to fix that problem and watch Champions League :) The solution is simple and clear: boot from any LiveCD, drop terminal and type following command there:

sudo grub
>root (hd0,0)
>setup (hd0)

That’s it. After booting from HDD the GRUB menu was found again.

Categories: Linux Tags: , , ,

Log for Mysql console session

December 4th, 2009 Michael Stepanov No comments

To log Mysql console session use option –tee (two dashes!) with full path to the log file:

mysql -uroot my_db –tee=/tmp/mysql_console.log

As result the file /tmp/mysql_console.log will contains all commands and queries with result of their executions. That might be helpful to keep your queries for using next time or for troubleshooting.

The author of the post, where I found that useful info, said that each time the Mysql session is started with logging the log file will be replaced. In my case it isn’t. As I expected the new messages just are appended to the log file.

Categories: Digital Life, Linux Tags: , , ,

Gift Idea: Leather case for N900

December 2nd, 2009 Michael Stepanov No comments

Nokia N900 case

Piel Frama offers a good looking handmade leather case for the smartest mobile phone Nokia N900. It’s excellent option as a Christmas or New Year gift. The price of that case is €50 including worldwide shipping.

Categories: Gadgets Tags:

VIM and Mysql integration

November 27th, 2009 Michael Stepanov No comments

I use VIM with additional configuration instead of IDE. That configuration includes code explorer using ctag, syntax checking for PHP and Perl and run Perl scripts (syntax highlighting is not a subject of discussion ;) ). Also I should run Mysql queries often. So, I decided to add integration with Mysql to VIM. I managed to do that thanks to that simple solution. Just add this code to your .vimrc:
to select database:

map <C-d> :call SwitchDB()<CR>
:function SwitchDB()
: let g:current_db = input(“Database > “)
:endfunction

to run query:

map <C-m> :call Doquery()<CR>
:function Doquery()
: if !exists(“g:current_db”)
: call SwitchDB()
: endif
: let query_string = input(g:current_db . ” > ” )
: if query_string != “”
: exe “!mysql ” . g:current_db . ” -e \”" . escape(query_string, ‘”‘) . “\”"
: endif
:endfunction

So, when you press Ctrl-d the VIM gives you a prompt to type database name, Ctrl-m will run query. Sure you can use the your preferable combinations of keys. Also you may extend the login functionality by adding prompt for database host and user or hardcoded that information in the SwitchDB() function.

Using VIM to construct queries in the Mysql shell even much easier. Just specify VIM as default editor:

export EDITOR=vim

After that type \e in the Mysql shell. It’ll bring you VIM window where you’ll able to type your query. To finish with editing just type ZZ as usual. To run built query type ; and press Enter.

As result we’ll have possibility to run Mysql queries directly from VIM and using VIM to create queries in the Mysql shell.

Categories: Digital Life, Linux Tags: , , ,

GooSync goes to 100% commercial

October 10th, 2009 Michael Stepanov 2 comments

Logo

I’ve used GooSync to sync my Google Calendar with calendar on my Nokia E65 for couple years. It covers all my unassuming needs. But recently I received a notification from GooSync that they discontinue free version of their service. As an option for all free users they offer version Lite for €7 per year. Well it isn’t so big money to help the good and useful service improve its quality or just survive.

Categories: Digital Life Tags: , , ,

Amazon announced international version of Kindle!

October 10th, 2009 Michael Stepanov 2 comments

Amazon-Kindle-2-Pictures

Good news for all ebook and Kindle fans who live outside US. Amazon decided to sell its Kindle for the rest world. Its price is very attractive – $279 (about €190) plus shipping. Personally I like Kindle. In my opinion its design is perfect. The rest ebook readers look not so nice but they provide more wide functionality such support Russian language or FB2 book format.

In any case, the possibility to buy Kindle officially outside US sounds very good. Will wait a bit till it’ll support Russian language and then will buy it.

Categories: Digital Life Tags: , ,

Additional mysql server UTF8 confutation

October 9th, 2009 Michael Stepanov No comments

I spent a few day with patching LinuxMCE database connection to pass UTF8 option to the server. But without luck. However I found a way to configure mysql server to skip client’s request about charset and send all data in the defined one. To do that just add following lines in the my.cnf file under mysqld section:

[mysqld]
init_connect=’SET NAMES utf8; SET collation_connection = utf8_general_ci;’
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake

The option init_connect replaces setting ‘SET NAMES utf8′ from the client and skip-character-set-client-handshake tells to server to ignore charset sent by client and use it default one instead.

I tested this approach with LinuxMCE and it works. The Russian text is displayed on the Orbiter correctly. I tested it with Perl as well and found that Perl script still should set option mysql_enable_utf8 to true.

[via Saiweb]

Categories: Digital Life, Linux Tags: , ,

Traffic jams map with camera view from Yandex

October 8th, 2009 Michael Stepanov No comments

logo
Russian company Yandex which offers a lot of useful services and has Google’s vision of the web business (IMHO) recently announced Moscow map map with traffic jams and live cameras view! That’s really cool service and I didn’t see anything similar before. Additionally there are panoramic views. Similar as Google has.

I’m waiting when the live cameras will be added for St. Petersburg. Or at least panoramic views. Sometimes I’m missing it.

Categories: Digital Life Tags: , , ,
Get Adobe Flash playerPlugin by wpburn.com wordpress themes