Donnerstag, 24. März 2011

Putting users configuration under Git version control

Hi girls and guys,

today i want to show you something which a friend of mine
Reiner Herrmann pointed out for me.

There are two main reasons why you want to put your configuration under version control. You can document what you are changing and when you are changing files like ~/.bashrc or ~/.vimrc for example. At least those are the files which changes quite often on my machines. And the second reason is to simply providing an easy way to restore your configuration when things became messed up.

First make sure you have installed git. This should be in the main repository of your distribution. For Debian simply install it using apt-get install git.

I am now going to show you how you can put your ~/.bashrc under version control
using git.

If you are not familiar with git simply go to the website. You find all documentation
you will ever need on this website.

Let's assume for now i am under /home/matthias. Create a Directory ~/.local_gitrc

mkdir ~/.local_gitrc

and create the Git Repository by navigating in this particular directory you've just created. Here you can initialize your git Repository by typing:

git init

That's all. Your Git Repository have been initialized. Next you copy the original ~./bashrc to this
directory

cp ~/.bashrc bashrc

and add this to your git directory blob

git add bashrc

Make your first commit.

git commit -m " bashrc: initial commit"

Now as the final step link the Script in Your Git Repository to it's original location.

ln -sf /home/mattias/.local_gitrc/bashrc /home/matthias/.bashrc

There have been a lot of suggestions around the internet that you should be able to do this with the
/etc directory too. The result is a a script called etckeeper.



Thats it.

Mittwoch, 9. März 2011

Mein Damen und Herren ich präsentiere

Das Linux Sheet das über die 8 Monate Lpic1/2 entstanden ist.
Das Sheet ist natürlich noch lange nicht fertig. Verbesserte Versionen folgen demnächst, da es als erste Version die offiziell im Web stehen darf trotzdem noch eine Menge Fehler enthält und einiger Ergänzungen bedarf. Ich hoffe dass es irgendjemanden etwas nützt.

Übersetzung in anderen Sprachen erwünscht.
PLease translate into other languages.

Mittwoch, 2. März 2011

Setting up XWiki on Opensuse with mysql and tomcat

Hi girls and guys,

After spending hours with my setup of XWiki on Opensuse 11.3 i finally managed to fulfill this task.
Since it is pretty easy to install but has a lot of edges to deal with, i will detailed instruct you how to get this wiki up and running.

I only describe how to do this on opensuse. If you are looking for Debian just go ahead reading here

(1) First install these packages using zypper:

zypper ref && zypper in mysql-community-server mysql-community-server-client tomcat6, tomcat6-el-1_0-api tomcat6-jsp-2_1-api tomcat6-lib tomcat6-servlet-2_5-api
jakarta-commons-collections-tomcat5 mysql-connector-java java-1_6_0-su
n

(2) Now copy your XWiki-enterprise-web-A.x.n.war to /srv/tomcat/xwiki.war and start the tomcat6 Server by issuing the following:

service tomcat6 start


(3) After waiting a couple of seconds this command unpacks your war archive and you should end up having a directory xwiki under /srv/tomcat/

Stop the tomcat Server by doing a

service tomcat6 stop

(4) We need to do some changes to the particular init scripts. First edit the /etc/init.d/tomcat6 Script and put

TOMCAT6_SECURITY=no


under the line with
PATH="/bin:/sbin"

and save the file. Next is the /etc/init.d/mysql. Find the line in the case constructor that says

echo -n "Starting service MySQL "


and add the following option line
--max_allowed_packet=32M \

!!!The \ in the end of the line is important here!!!

(6) Next create the database for your xwiki and grant the permissions by executing the follwoing

service mysql start && mysql_secure_installation
(this will finalize the installation of mysql for opensuse)
mysql -u root -p -e "create database xwiki"
(this will create the database xwiki)
mysql -u root -p -e "grant all privileges on xwiki.* to xwiki@127.0.0.1 identified by 'xwiki'"
(this will grant the permissions to Xwiki)

(7) Copy the mysql connector library from /usr/share/java/mysql-connector-java-5.1.6.jar to
/srv/tomcat6/webapps/xwiki/WEB-INF/lib/. A Symbolic link may also work. But i didn't try this out.

(8) You must now edit the /srv/tomcat/webapps/xwiki/WEB-INF/hibernate.cfg.xml file. And
comment out other database configurations you don't need. Especially the one hsqldb which is the line that is not comment out by default. Instead uncomment out the mysql section.

(9) Now you can restart the servers by issuing the following commands:
service mysql restart && service tomcat6 start

(10) You should add the servicedaemons permanently to avoid starting them manually each time.
chkconfig -a mysql && chkconfig -a tomcat6

The wiki should live on localhost:8080/xwiki. All you have to do now is to apply the xwiki-enterprise-wiki.A.x.n.xar file. But this should be no problem if you followed these steps.

You can get the latest XWiki and further Instructions here:
http://www.xwiki.org/xwiki/bin/view/Main/Download