01 December, 2010

Android emulator on fc14 x64 not working

I was testing Android sdk on a dell laptop with fc14 x64. Android SDK still relies on 32 bit stuff, therefore I got some errors while installing then testing the emulator:

$ ./emulator @SansungGalaxyS
SDL init failure, reason is: No available video device

I got a good advice from a quite old forum entry:

Problems are 32 bit libraries missing. I didn't need to install all stuff they say, I traced a bit the binary file and found the libraries missing:

$ strace ./emulator

Then:
# yum yum provides libXrender.so.1
# yum provides libXext.so.6
# yum install libXrender-0.9.6-1.fc14.i686 libXext-1.1.2-2.fc14.i686

it installs some other dependent packages.

Finally gotcha! Again started the emulator and worked fine!



22 October, 2010

Solaris 10 SSHD not starting

I got crazy this morning cuz sshd service wasn't working on our lab's server. It's absolutely necessary if we want to work remotely. I lost the former output of the problem, but I want to show you (and me, when this is cleared from my cache) some of the commands i used to sove this problem:


# svcadm enable ssh
here doesn't display any message.

# svcs -l ssh
here displays the service status. It was offline. It should be online since i "enable" it. It shows also its dependencies. "autofs" service was offline.

# svcs -d svc:/system/filesystem/autofs:default
STATE STIME FMRI
online 12:27:03 svc:/milestone/name-services:default
online 12:27:10 svc:/system/filesystem/local:default
online 12:27:17 svc:/network/rpc/bind:default
offline* 12:27:21 svc:/network/nfs/client:default

I offlined nfs client service because Richard screwed the NAS so he needs to repair it in oder to be able to enable this service.

# svcs -x
If typed alone -x option shows all services that hasn't started. If you add the service name, it prints:

svc:/system/filesystem/autofs:default (automounter)
State: offline since Fri Oct 22 12:27:22 2010
Reason: Unknown
See: automount(1M)
See: /var/svc/log/system-filesystem-autofs:default.log
Impact: There are 22 dependent services.

svc:/network/nfs/client:default (NFS client)
State: offline since Fri Oct 22 12:27:21 2010
Reason: Start method is running.
See: http://sun.com/msg/SMF-8000-C4
See: mount_nfs(1M)
See: /var/svc/log/network-nfs-client:default.log
Impact: This service is not running.

What I did to solve was edit /etc/vfstab and comment the line where the NFS it's mounted. Then I typed (after a lot of research):

# svcadm clear svc:/system/filesystem/autofs:default
# svcadm disable svc:/system/filesystem/autofs:default
# svcadm enable svc:/system/filesystem/autofs:default
# svcs -x svc:/system/filesystem/autofs:default

And finally
# svcs -l ssh

And it worked!

Hope it still works after rebooting the system :D.

18 July, 2010

Pre-Nacional Absoluto (2)

Here comes the second part of my tournament review. After defeating Arely, I was in good mood for the next round. I knew that with 2.5/4 I was probably going to be paired with a stronger player then I prepared my mind for a tough struggle.

Round five was a kind of disaster right from the opening. I played against Juan Manuel García, from Jalisco. I hesitated for an instance to play 1.d4 and practice some of the stuff I had been training and play for the minimal advantages. At the end I played 1. e4 and we played an Accelerated Dragon.

I fell into a trap of that move order and finished in an inferior position quickly. I was feeling bad during the game because all those tricks I had trained them a lot of years before with my former trainer Benjamin Ferrera (RIP), a Cuban immigrant well known for his book on the Dragon. I knew those traps, I just couldn't take out the dust of my mind.

I was 2.5/5 before last round. I needed to win. I had gone to the tournament with the clear objective to finish at least with +1. And it was my last chance to not to lose so many rating points (Arely hadn't international rating so my rated games score was 1/3).

I was taking a break with Juan Carlos, Luis and Saul in the hotel lobby bar when Luis said he wanted to check the next round pairing. When he came back I was shocked. I had to play against Luis. The first question all launched us was if we did wanted to play or just make a quick draw. I said I had gone to the tournament to play and so did Luis, therefore we needed to make this interesting for training purposes given the fact he's my friend.

To spice the things up, I beat him last April in the National Open Chess Champ in Monterrey with a sicilian. I knew for sure he wanted to taste my blood so I didn't expect an easy battle.

We agreed to pre-arrange the opening setup. I play 1.e4 and he usually plays Sicilian game. After some discussion about when it was fair to pre-arrange the moves, he said he plays the Dragon and asked me if I would like to play it. I said yes, of course, one of the openings I best score is the white side of the dragon. So we agreed the first 8 moves and played them at blitz speed:

Pre-Nacional Absoluto 2010
Héctor Juárez Velázquez (IPN)
Luis López Raygoza (AGS)
1. e4 c5
2. Nf3 d6
3. d4 cd4
4. Nxd4 Nf6
5. Nc3 g6
6. Be3 Bg7
7. f3 Nc6
8. Bc4 0-0

Here finished our agreenment and from now, we started to play. With Bc4 white intends to stop forever the d5 central breakthrough and enter into a sharp game with opposite castling. Now the race begin, the first to approach his enemy's king will be victorious.

9. Qd2 Bd7
10. 0-0-0 Rb8!?

I don't know very much theory of this variation (I promise, I will re-read the labyrinth), but I would prefer to set the rook to c8 for the following reasons:

- In b8 it is obstructed by its b pawn.
- In c8 white must care about Rxc3 exchange sacrifice
- I will never take the b5 pawn, then, even if he is able to open the b-file I've enought time and ways to obstruct his attack.

But he'd study it and perhaps it fits better his style than Rc8. I don't know, I hope later Mr. Polugayevzky can give me further ideas, by now I'm writing only in my current state of preparation and memory!!

11. h4

This is my favourite plan. Launch immediatly the h pawn to black's king and try to weave the mating net. He has many options to slow down my attack and counterattack in the queenside to finally win the race.

11. ... b5
12. Bb3

I think I must keep me from taking the pawn. If I do so, his rook move will be justified.

12. ...Nxd4

He pointed me out after the game that perhaps this is an strategic mistake, because he lose some pressure in the center and exchange a good knight spending a tempo. I'm not completely sure about that because now I must take the knight with my bishop and I no longer have the threat Bh6. It's a matter of taste.

13. Bxd4 a5

Now the red light started to blink. His pawn storm can break into my king castle with tempo because he will push them against my minor pieces. Now I have many options. I can push my pawn to h5 and continue the crossroad (as defined by Tartakover), but I realized I have no room for my bishop. He's threatening a4 and the only square free for my bishop is d5, and after e6 it's trapped. The attack doesn't justify the piece sac.

If I try to make room for my bishop with a3 he move a4 and b4 and my king is in trouble. I needed to make room for my bishop with tempo in order to stop his threats and start my own's. I realized it was maneouvre in which I could accomplish this. I spend 22 minutes to figure it out.

14. e5! de5

The option is the retreat of the knight to e8 but in that case I can continue my attack without hesitation, then I'd have room for the bishop and time to exhange the dark squared bishops and push the h pawn to h5.

15. Bxe5

Now I'm attacking the b8 rook, taking advantage of what I think is not its best placement. And I'm threatening to take the d7 bishop so it must be protected. His response is unique.

15. ...Rb7

Now I have the rook where I wanted it. In the case he attacks my bishop with a4 I can move it to d5 attacking the rook. It gives me the time to save the bishop and at the same time my attack can run faster with no worries. Now he stopped and thought for about 20 minutes.

16. h5 b4
17. hg6!

The starting point of a combination that gave me the upper hand in the attack. I weakened his king at the cost of a piece, and now he needed to give back some material in order to protect his king. He accepted the sacrifice almost immediatly.

17. ...bc3
18. gf7+ Rxf7

Forced. If Kh8 he's mated after Qg5! when I threat Nxh7+ and if Kxh7 Rh1 and mate, or if Nxh7 Qxg7 mate.

19. Bxf7+ Kxf7
20. Bxc3 Qd6

Now the things had settled. I had a rook and two pawns for a knight and a bishop. He'd the bishop pair, so the material is somehow balanced. Although he'd the bishop pair, the were not coordinated and my two rooks and bishop were very active. He'd an exposed king whereas mine is completely safe. So I had a dynamic advantage, that I had to exploit if I didn't want to face a pretty difficult endgame. Again, I spend about 15 minutes to figure out how to continue.

21. g4 Be6?

This was a mistake that put his king under fire. It was necessary 22....h6.

22. g5 Ne4?

One error follows another. This was the point of black's play, perhaps he didn't saw my reply:

23. Rxh7

Now his g7 bishop is pinned and if Nxc3, Qxc3 and there's no way black can protect the g7 bishop. After about 15 minutes, he replied:

23. ... Nf6

He gave a full piece. Nevertheless, his position was lost at this point.

24. gf6 ef6
25. Bd4!

The last subtlety. In some variations it gave me the possibility to play Rg1.

25. ... Qb5
26. Qh6 Kg8
27. Rg1 Bg4

A kind of trap. However there's no danger.

28. Rxg4 Qf1+
29. Kd2

And with no further checks, he resigned.

Finally I succeeded to finish the tournament with +1. I could savour the moment just a few minutes, it was Sunday night and next day I had to work...

26 June, 2010

Pre-Nacional Absoluto

These were my two best games in the pre-nacional absoluto tournament that was held in the Fiesta Americana Reforma Hotel from June 4th to June 6th.

I will remember this tournament for the weird performance I did, because I won three Sicilians and lost both non-Sicilian games. It's seems I feel comfortable in Sicilian positions with both sides, and I got the chance to experiment some of the stuff I had been studying with José Luis, my friend and trainer.

I not only got the chance to play an specific variation in the Sveshnikov Sicilian José Luis and I analyzed from the NIC 94, but got the chance to practice my endings technique in the very first round against a 1700 player. I won this first game, in which I wanted to play the Sveshnikov, but my opponent deviated the main line and went for 3. b3 followed by d4 and Nxd4, which seems to be dubious. We got into some fireworks and after things calmed down, I had an extra pawn in a pretty difficult endgame. I pressed with my extra pawn and avoided successfully the minor pieces threats.

The second game I lost badly with Ruben Canales in a Tarrash French with 3... Nf6. I played poorly in the opening and when the game was close to balanced I lost the thread and finished in a lost endgame that he exploited with good technique.

The third game is the first I want to annotate. It was played against Arely de Loera, a very young girl from Morelos. She surprised me a bit, because she knew and played a line José Luis and I were checking last week. I was preparing the line with white (I'm a strong believer that white is better in the Sveshnikov), but the best way to understand and improve an opening is playing it by both sides.

1. e4 c5
2. Nf3 Nc6

I want to enter directly to the Sveshnikov. I left for another moment my beloved Hedgehog.

3. d4 cd4
4. Nxd4 e5?!

I played automatically this move. After I made it I knew I played the opening mechanically and gave her the chance to have a good game. Now, after 5. Nb5 d6, it's not mandatory to play the Knight to c3, so white could play c4 for a Maroczy or just play Bd3 and after a6 she can bring his b5 Knight to d5 via c3 (and not to a3).

5. Nb5 d6
6. N1c3?!

She also played mechanically and returned the favour!

6... Nf6

of course, going back to the main line. Next moves are just theory.

7. Bg5 a6
8. Na3 b5
9. Nd5 Be7
10. Bxf6 Bxf6
11. c4!?

here we go! this is the line we were preparing. This move tries to weaken black's queenside and if black advances his pawn to b4, white obtains a very good game, activating the a3 knight with tempo and strengthen the d5 knight. Therefore, this move creates a sharp game right from the opening with chances for both sides. Black's main attempt is to take the initiative at the cost of a pawn. We now have the eternal struggle between a bishop pair against a very strong Knight and square at d5.

11... 0-0

I don't refuse complications.

12. cb5 Nd4

The idea. I also get a good knight whereas maintain my bishop pair and better development. White gets a pawn and a rock-solid structure, her main problem is tempo and the poorly positioned Knight at a3.

13. b6!

In NIC Yearbook 94 this move is just mentioned as a sideline, but for me this is the best answer for white and I intended to play this move with white if I could get into this position. I was a little afraid of entering into her preparation so I spend almost half an hour to remember first the ideas and next the move orders of this variation, and trying to complicate the struggle, I was playing for a win.

14. ... Bb7

The main idea in this variation is to exchange the light squared bishop for the Knight on d5 and take on b6, after that black gets a reasonable play. With the white's next move, my preparation finished.

15. Nc7

The staring point of a wrong plan. Trying to maintain the extra pawn only plays in black's favour. Now the black's light squared bishop broaden its influence automatically and I get more development advantage, which will be decisive. Now white protects her central pawn and tries to complete her development by castling.

15. ... Rc8
16. Bd3 Bg5
17. 0-0 Bf4!

I'm proud of this bishop manoeuvre. It threatens some tactical blows although it is a positional move indeed. Now I get some pressure in the h1-a8 diagonal and she must concern about mating threats. Is she plays g3 now, the positional motif reveals for itself, because my light squared bishop is a killer and now I can make the standard retreat to h6 and then launch the attack via f5.

18. Nc4?!

She's not paying attention to my threats and follow her plan blindly. Now the threat is Na5 in order to catch the b7 bishop. She won't get the time to do so.

18. ... f5!

This move needs to pass the silicon test!, but in my analysis I win by force if she tries to trap my bishop: 19. Na5 fe4! 20. Nxb7?? Bxh2! and white at least lose her queen whereas black has still mating threats. She also cannot take on f5 because of 19. ef5 Bxh2! 20. Kxh2 Qh4+ 21. Kg1 Nf3! and white should resign.

19. Qe1??

This was the last chance to play g3, although white weakens her kingside badly. Now white falls in a mating net. This can be shown as a tactical problem to beginners:

20. ... Bxh2!
21. Kxh2

White's king is not safe with Bh1 because of Qh4 and the knight in d4 and the dark squared bishop weaves the mating net.

21. ... Qh4+
22. Kg1 Nf3!
23. gf3 Qg5

There are other ways to win. I chose the more direct one. Rf6 also wins by force, and if white plays Qd2 mate comes after Rg6+, and if white plays ef5 mate comes after Rh6.

White resigns.

I will analyse and commentate my last game against Luis Lopez Raygoza, which was an interesting and sharp game. Now time's over. See you next time!

05 May, 2010

Linux Java Hotspot/Gcj error

I got a really nasty Java error while trying to start a formerly working instance of glassfish v2.1.

I tried:
$ bin/asadmin create-domain
bin/asadmin: line 7: /home/h/run/gf21/lib/admin-cli.jar: Permission denied
Failed to load Main-Class manifest attribute from
bin/..//lib/admin-cli.jar

for some reason it didn't allow me to run such jar when previously was working like a charm! I just added execution permission to the jar file:

chmod +x lib/admin-cli.jar

this was all the problem with glassfish, but when solved the issue, this lend me to the next step...

$ bin/asadmin
invalid file (bad magic number): Exec format error
Failed to load Main-Class manifest attribute from
bin/..//lib/admin-cli.jar

OMG!! WTF??? this was just crazy. I googled it a bit and found out that the problem was my java version. I have uninstalled lots of times java-gcj and java-gcj-compat packages from my linux box (FC12), but everytime I update software it installs them again, therefore sometimes I just ignore I have it again in my system. This level passed! time to go to the next level!

Now that I uninstalled java-gcj again (with nodeps option otherwise I would uninstall openoffice), I tried again, now with glassfish installer. At the moment I was a bit demoralized by asadmin problem and wanted to isolate the real issue.

Then I ran:
$ /usr/java/latest/bin/java -Xmx256m -jar glassfish-installer-v2.1.1-b31g-linux.jar
Exception in thread "main" java.io.IOException: Cannot run program "java": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:466)
at glassfish.main(glassfish.java:97)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 3 more

...that got me mad immediatly. What's this error?? I checked some forums and many of them said something about the path where you're executing the main class and so... This was not exactly my case because I got correctly the main class. In this forum they had a similar problem http://forums.java.net/jive/message.jspa?messageID=244886 so I just checked everything again.

The problem was solved with the simple command:
$ export PATH=$JAVA_HOME/bin:$PATH

previously I had correctly defined JAVA_HOME.

Conclusion

When java-gcj is installed, it adds a soft link in /usr/bin/java pointing to gcj java binaries. Therefore any program tries to execute java from there, but it doesn't corresponds to JAVA_HOME. When I removed gcj all my environment was still configured (not by me) to execute java from /usr/bin so it just didn't find JDK binaries. That's why just adding the proper java binary to the path, it worked again.

I have to complain to FC12 packagers because we all know that gcj it's not in a stable and fully compatible state, therefore it's very frustrating that you need to remove gcj and download/install Sun JDK. What's most frustrating it's that openoffice depends strongly on gcj and don't let you choose what JVM you wanna work with.

Supposedly Linux it's all about choice, and when sun jdk it's still not opensource, it's completely free tough, so it should be a way to FC12 packagers to let the users choose between JDK's.

Hope this helps anyone.

13 March, 2010

Opensolaris on XEN

A good article by Pat Patterson, former principal engineer in identity management products at Sun.

http://blog.superpat.com/2010/02/27/opensolaris-2009-06-as-a-domu-guest-on-xen-3-4opensuse-11-2/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+superpat+(Superpatterns)

Trust SSL Certificate in Java

This is an small article about how to trust a SSL certificate using Java. Very interesting and useful.

http://en.wikibooks.org/wiki/WebObjects/Web_Services/How_to_Trust_Any_SSL_Certificate

04 February, 2010

Chinese New Year Mexico 2010

Mexico City's Chinatown is preparing to celebrate the Chinese New Year (Tiger's year).

The biggest part of the celebration is the traditional parade with people dressed up as dragons on Reforma avenue, that is one of the most beautiful avenues in Mexico City.

I hope to be part of this colourful celebration, in which the Chinese language school where I study will have a main role in the organization.

Hope to see you guys there!