About Me

My photo
I know the last digit of PI

Saturday, February 26, 2011

How to enable Remote Desktop on remote machine

http://oreilly.com/windows/archive/server-hacks-remote-desktop.html
1) connect on the machine using regedit.exe (from File / Connect Network Registry)
2) Go to the key HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server
3) Change fDenyTSConnection from 1 (Remote desktop disabled) to 0 (Remote desktop enabled)
4) Restart the system by using the command
shutdown -m \\ -r

Thursday, February 17, 2011

Installing OpenId-server on mysql

1) Download the JosID war file.
wget http://mirrors.redv.com/pub/jos/jos-1.2.1/jos-webapp-1.2.1.war
2) Deploy it on tomcat server
cp jos-webapp-1.2.1.war /usr/share/tomcat7/webapps/josid.war
3) start tomcat and stop it in order to extract the war content.
5) Copy the context.xml from the WAR to the tomcat/conf dir
cp /usr/share/tomcat7/webapps/josid/META-INF/context.xml /usr/share/tomcat7/conf/Catalina/localhost/josid.xml
6) Edit /usr/share/tomcat7/conf/Catalina/localhost/josid.xml and change the jdbc/jos resource and the Hybernate dialect:


<Resource
name="jdbc/jos"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/jos"
username="jos"
password="secret" />

<Environment
name="hibernate.dialect"
type="java.lang.String"
value="org.hibernate.dialect.MySQL5Dialect" />

Also change the password
<Environment
name="domain.configurator.password"
type="java.lang.String"
value="secret"
override="false" />

7) Download the mysql-connector and put it in tomcat/lib directory
8) Create the mysql database
CREATE USER 'jos'@'localhost' IDENTIFIED BY 'secret';
CREATE DATABASE jos;
GRANT ALL ON jos.* TO 'jos'@'localhost';
FLUSH PRIVILEGES;
9) start tomcat
10) open the josid URL and use the password previously configured in josid.xml

Maven on F14

1) wget http://apache.online.bg//maven/binaries/apache-maven-3.0.2-bin.tar.gz
2) tar -zxvf apache-maven-3.0.2-bin.tar.gz
3) cp -R apache-maven-3.0.2 /usr/share/
4) ln -s /usr/share/apache-maven-3.0.2/ /usr/share/maven
5) update-alternatives --install /usr/bin/mvn mvn /usr/share/maven/bin/mvn 1
6) update-alternatives --config mvn
Just to make sure that it is using the correct path.

Wednesday, February 16, 2011

Tomcat 7 on Fedora 14

First let install tomcat6 so we have some template from where to copy the scripts:
0) yum install tomcat6

Now lets configure the service:
1) cp -R /etc/init.d/tomcat6 /etc/init.d/tomcat7
2) Edit /etc/init.d/tomcat7 and change all occurrences of tomcat6 to tomcat7


Now lets configure the script that actually starts the tomcat:
3) cp -R /usr/sbin/tomcat6 /usr/sbin/tomcat7
4) Edit /usr/sbin/tomcat7 and change all occurrences of tomcat6 to tomcat7


Next let's make the configuration & log directories:
5) mkdir /etc/tomcat7
6) mkdir /var/log/tomcat7

Now download the tomcat archive distribution:
7) Download tomcat7.tar.gz and extract it into /usr/share/tomcat7

Copy the configuration files in Fedora standart config dir:
8) cp -R /usr/share/tomcat7/conf /etc/tomcat7
9) rm -Rf /usr/share/tomcat7/conf
10) ln -s /etc/tomcat7 /usr/share/tomcat7/conf

Make the tomcat7 to use the standard Fedora log directory:
11) rm -Rf /usr/share/tomcat7/logs
12) ln -s /var/log/tomcat7 /usr/share/tomcat7/logs

Configure the tomcat7 options:
13) cp /etc/tomcat6/tomcat6.conf /etc/tomcat7/tomcat7.conf
14) Edit /etc/tomcat7/tomcat7.conf and change all occurrences of tomcat6 to tomcat7

Specify temp & work dirs:
15) mkdir -p /var/cache/tomcat7/work
16) mkdir -p /var/cache/tomcat7/temp
17) rm -Rf /usr/share/tomcat7/work
18) rm -Rf /usr/share/tomcat7/temp
19) ln -s /var/cache/tomcat7/work /usr/share/tomcat7/work
20) ln -s /var/cache/tomcat7/temp /usr/share/tomcat7/temp

Fix the permissions:
21) chgrp -R tomcat /usr/share/tomcat7
22) chmod -R ug+rwx /usr/share/tomcat7
23) chgrp -R tomcat /var/log/tomcat7
24) chmod -R ug+rwx /var/log/tomcat7
25) chgrp -R tomcat /var/cache/tomcat7
26) chmod -R ug+rwx /var/cache/tomcat7

Add administrator user so you can manage the server:
27) Edit /etc/tomcat7/tomcat7.conf and following lines
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user name="admin" password="adminadmin" roles="admin,manager,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status" />



Now start the service and everything should works fine:
28) service tomcat7 start

Finally you can start the service on everyboot
29) chkconfig tomcat7 on

Sunday, February 13, 2011

NVidia driver F14 x86_64

По default F14 идва с nouveau драйвер зa видео картата. Ако искате да сложите нов дравер направете следното:
1. Сваляне на драйвера от www.nvidia.com (NVIDIA-Linux-x86_64-260-19.36.run)
2. Reboot и по време на GRUB избирате опция за допълнителни параметри към kernel (от менюто избирате 'a'). Добавяте параметъра single накрая на реда.
3. Когато се стартира системата, няма да ви иска парола.
Изпълнявате init 3
4. Логвате се с root
5. Изпълнявате NVIDIA-Linux-x86_64-260-19.36.run. Най-вероятно ще излезе грешка, че nouveau е активен.
6. Изберете yes за modprobe disable стъпката.
7. Изпълнете 2-5 отново. Ако пак възникне грешка, тогава трябва да се направи едно от двете:
7а. Редактирате /boot/grub/grub.conf и на реда в който започва с kernel накрая добавяте параметъра rdblacklist=nouveau (това е същия ред който редактирате от GRUB-a)
7b. Променяте initramfs като изпълните командите
mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
dracut /boot/initramfs-$(uname -r).img $(uname -r)
8. Повтаряте стъпките от 2-5 и този път не трябва да ви даде грешка за nouveau. Избирате да инсталирате opengl32 и да конфигурирате X средата

Как да инсталираме skype под F14

http://yunustj.wordpress.com/2010/07/18/how-to-install-skype-on-to-fedora-13-x86_64/


yum whatprovides


ни дава информация кой пакет да инсталираме за да имаме дадената библиотека.


E: skype: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory
S: yum install alsa-lib.i686

E: skype: error while loading shared libraries: libXv.so.1: cannot open shared object file: No such file or directory
S: yum install libXv.i686

E: skype: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory
S: yum install libXScrnSaver.i686

E: skype: error while loading shared libraries: libQtDBus.so.4: cannot open shared object file: No such file or directory
S: yum install qt.i686

E: skype: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
S: yum install qt-x11.i686


На стъпката с libQtDBus.so.4 имах доста проблеми, защото имаше конфликти с вече инсталирани пакети. Това което си спомням, че направих е да инсталирам qt.x86_64, т.е.:


yum install qt.x86_64
yum install qt.i686


И по някакъв магически начин след това нямаше конфликти :-)