pátek 28. listopadu 2008

phpmyadmin in Ubuntu 8.10 Intrepid

Installation of phpmyadmin usually would do one command:

sudo aptitude install phpmyadmin


But with last version in Itrepid I had some problems. In /etc/phpmyadmin/apache2.conf I've added this lines to section :


AllowOverride All
Order allow,deny
Allow from all


because I use phpmyadmin on my laptop, there is no need for other security restriction. Also I commented out authentification lines:

# AuthType Basic
# AuthName "phpMyAdmin Setup"
# AuthUserFile /etc/phpmyadmin/htpasswd.setup


restart apache:

sudo /etc/init.d/apache restart

Then should be phpmyadmin available on:

http://localhost/phpmyadmin/

where you can login with mysql root password

středa 26. listopadu 2008

How to disable pc speaker in ubuntu

How to get rid of annoying pc speaker sound.


After entering this command:


$ lsmod | grep spkr


You should be able to see somemthing like this:

pcspkr 10624 0


So, open in your favourite text editor as super-user this file

$ sudo vim /etc/modprobe.d/blacklist


And add new line

blacklist pcspkr


Note: if you didn't find pcskpr in lsmod, try to look for
snd_pcsp. It could be also causing troubles.

pondělí 7. července 2008

Dual screen on kubuntu with intel graphic card

I've tried to run dual screen on my laptop Dell Laitude D620, but I've never had enough time to sort it out. There are two ways how to configure dual screens on Xserver, dynamically with xrandr and statically with xorg.conf. I've always have problems with editing xonrg.conf, so I prefere xrandr.




The output of command xrandr (without parameters) looks like this:

Screen 0: minimum 320 x 200, current 3360 x 1050, maximum 3360 x 1050
VGA connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 434mm x 270mm
1680x1050 60.0*+
1280x1024 75.0 59.9
1152x864 74.8
1024x768 75.1 60.0
800x600 75.0 60.3
640x480 75.0 60.0
720x400 70.1
LVDS connected (normal left inverted right x axis y axis)
1280x800 59.9 + 60.0 59.9
1280x768 60.0
1024x768 60.0
800x600 60.3
640x480 59.9
TMDS-1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 434mm x 270mm
1680x1050 59.9*+
1280x1024 75.0 59.9
1152x864 74.8
1024x768 75.1 60.0
800x600 75.0 60.3
640x480 75.0 60.0
720x400 70.1
TV disconnected (normal left inverted right x axis y axis)


Lines marked with stars (*), are currently in use.

Port names for Intel driver:

      VGA - Analog VGA output

      LVDS - Laptop panel

      TV - Integrated TV output

      TMDS-1 - First DVI SDVO output

      TMDS-2 - Second DVI SDVO output





Intell chipset 965 has limitation for maximal virtual desktop size 2048x2048, if the sum of width of both of your desktops is greater you have to disable dri
in xorg.conf. It is some graphic acceleraion

Section "Module"
Disable "dri"
EndSection


then you have to extend your virtual desktop (also in xorg.conf)

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
SubSection "Display"
Depth 24
Virtual 3360 1050
EndSubSection
EndSection


In my case it is 3360x1050px (two 22").


You can change position of screen by command:

xrandr --output VGA --left-of TMDS-1 --auto


I've encountered strange error:

xrandr: cannot find crtc for output VGA



I've solved it by turning the laptop screen off

xrandr --output LVDS --off


Then everything worked as I imagined. With xrandr you don't have to restart xserver after each change, so it is pretty much pracitcal.

Useful links:
http://www.intellinuxgraphics.org/dualhead.html
http://www.thinkwiki.org/wiki/Xorg_RandR_1.2

sobota 10. května 2008

Český google Translate

Google spustil novou službu Google Translate, která umožňuje mimo jiné také překlad do češtiny. Na přednášce v Praze se bývalý vicepresident Google Douglas C. Merill zmiňoval o revolučních technologiích jejich překladače. Google údajně vychází z multilingualních webů, které patrně přložili rodilí mluvčí nebo tlumočníci a v této (patrně rozsáhlé) databázi hledá fráze, takže by výsledný překlad mohl být lepší než z klasického word-to-word překladu. Podívejme se, jak to vypadá:

Anglická věta

Why this fucking fuck doesn't fuck?


má trošku jiný význam, než tvrdí translator.. :)

Proč toto kurva, kurva není kurva?


Následující věta demostruje, že translator vždy nepřekládá "fuck" jako "kurva"..

fuck the fucking fuckers

CZ:

ty zasraný hajzlové



Problémem při překladu jsou mnohoznačná slova, která se musí překládat pomocí kontextu. V tomto mě google opravdu příjemně překvapil.

Četl jsem zajímavou knížku o německých tancích ve druhé světové válce.
Představí se taneční páry v tancích jako je samba, rumba...
V pěti standardních tancích typu M4 "Sherman", VT-72M4, T-72M4
V pěti standardních německých tancích typu M4 "Sherman", VT-72M4, T-72M4
V pěti standardních amerických tancích typu T-34

První dvě spojení byla správně rozpoznána, u dalších jsem zkoušel, které slovo změní překlad.
Google má asi databázi militantních zemí, které používají tanky :-). Spojení "českých tancích" by bylo přeloženo jako "czech dances".

I have read an interesting book on German tanks in the Second World War.
Present the dance couples in dances such as samba, rumba ...
In the five standard dances type M4 "Sherman, VT-72M4, T-72M4
The standard five German tanks type M4 "Sherman, VT-72M4, T-72M4
The standard five U.S. tanks type T-34


Jistě znáte známý text od Monty Python o použití anglického slova "fuck" v různých významech.

- fraud: "I got fucked"
- trouble: "I guess I'm really fucked now"
- dismay: "Oh, fuck it!"
- aggresion: "don't fuck with me, buddy!"
- difficulty: "I don't understand this fucking question"
- inquery: "who the fuck was that?"
- dissatisfaction: "I don't like what the fuck is going on here"
- incompetence: "he's a fuck-off!"
- dismissal: "why don't you go outside and fuck yourself?"



-- Podvod: "Mám v prdeli"
-- Problém: "Myslím, že jsem fakt v prdeli nyní"
-- Zděšení: "Ach, to kurva!"
-- Aggresion: "není to se mnou, kámo!"
-- Potíže: "Nejsem pochopit tuto otázku, kurva"
-- Inquery: "kteří to bylo?"
-- Nespokojenost: "Nemám rád to, co se kurva děje"
-- Neschopnost: "On je kurva-pryč!"
-- Propuštění ze zaměstnání: "Proč ne ty jdi ven a do prdele?"



Dávám googlu tak dva roky, možná tři a pak se podívám jestli už by se to dalo použít :-). Myslím, že překldatelé se zatím o svou práci nemusí bát.

čtvrtek 1. května 2008

Rotating image in LaTeX

When you include some graphics you can set dimensions of image and also rote angle.


\begin{figure}[ht]
\begin{center}
\includegraphics[width=500px, angle=270]{graphics/some_image.png}
\caption{Some image}
\label{img:SomeImage}
\end{center}
\end{figure}