Archive for ronhks

SSL tanusitvany generalasa

HTTPS protokollhoz sajat, alairt kulcs es tanusitvany generalasa:

openssl genrsa 2048 > ronhks.hu.key
openssl req -new -x509 -nodes -sha1 -key ronhks.hu.key > ronhks.hu.crt

 

Glassfish start script

Hogy is kell, gentoo alatt glassfish szervert indító scriptet csinálni. Álljon alább a példa:
Létrehozunk egy file-t /usr/local/bin/gf_start tartalma:

#!/bin/bash
/opt/glassfish/glassfish3/bin/asadmin start-domain

Kell egy stop is: /usr/local/bin/gf_stop tartalma:

#!/bin/bash
/opt/glassfish/glassfish3/bin/asadmin stop-domain

És maga az indító script /etc/init.d/glassfish aminek a tartalma:

#!/sbin/runscript

depend() {
        need net
}

start() {
        ebegin "Starting glassfish"
        # Ensure that we run from a readable working dir, and that we do not
        # lock filesystems when being run from such a location.
        cd /
        start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/glassfish.pid --exec /usr/local/bin/gf_start
        eend $?
}

stop() {
        ebegin "Stopping glassfish"
        /usr/local/bin/gf_stop
        eend $?
}

restart() {
        if ! service_stopped "NULL" ; then
                svc_stop || return "$?"
        fi
        svc_start
}

Gentoo – out of space

egy kis ellenőrzés a függőségekre:

revdep-rebuild

majd

eclean distfiles

és/vagy

eclean packages

Ha Gentoo széthullik update-kor

Ha meghal a gentoo és se einfo, se rc-service

emerge -ave system 
emerge -ave world 
revdep-rebuild

Glassfish remote acces for console

Lecseréljük az admin jelszót:

asadmin --host localhost --port 4848 change-admin-password

Engedelyezzuk a remote access-t a console-hoz. Kéri az admin felhasználót. és a hozzá előzőleg megadott jelszót.

asadmin --host localhost --port 4848 enable-secure-admin

Majd egy jóképű szerver restart:

asadmin restart-domain

Jenkins install from binary on Gentooo

Edit /etc/layman/layman.cfg and add new overlay list :

overlays  : http://www.gentoo.org/proj/en/overlays/layman-global.txt
            http://godin-gentoo-repository.googlecode.com/svn/trunk/layman.xml

Or in one line:

layman -f -o http://godin-gentoo-repository.googlecode.com/svn/trunk/layman.xml -a godin

Add to sync list :

layman -S
layman -L
layman -a godin

Add to make.conf :

echo "dev-util/jenkins-bin" >> /etc/portage/package.keywords

emerge the ebuild:

emerge -av dev-util/jenkins-bin

How to setup a multilingual website with Drupal 7

Setting up a basic Drupal website in English is relatively easy. Setting up a multilingual website isn’t as obvious as you would hope it to be. Knowing a thing or two about how and where to find help on drupal.org is a must. See References for more information.

The present article does not address the topic of multilingual menus.

Alright, let’s do it.

  1. Starting with a fresh Drupal 7 install is the best way to avoid problems. That said, it is possible to transform a unilingual website into a multilingual one. Let’s just say that it is beyond the scope of the current article.
  2. Activate the Locale and Content translation modules. Both come installed with Drupal 7.
  3. Download, install and activate the i18n and Variable modules (and all their submodules). The Variable module is new and required by i18n in D7. It provides a simple interface where you can designate system variables as Multilingual variables. In D6, you have to do it by hand in the settings.php file (See References block). More on the usefulness of the Variable module a little later.
  4. Go to the languages interface (admin/config/regional/language) and add a new language to the list. In this article, I’ll be adding French.
  5. Now, add a Path prefix language code to each language. You can do this by clicking the language edit link (admin/config/regional/language/edit/en). In the current example, I’ve added “en” for English and “fr” for French. Note the warning: Modifying this value may break existing [node] URLs. I had created a couple of nodes prior to making this change and encountered many nagging problems related to bad links. Deleting and recreating all existing nodes solved all those problems. If you have many existing nodes, export them before deleting them. Then import them back. You can do this more easily with the Node export module (http://drupal.org/project/node_export). Also, make sure the option “Determine the language from the URL (Path prefix or domain)” is enabled at admin/config/regional/language/configure.
  6. Once this is done, go to the Drupal translation page (http://localize.drupal.org/) and download the translation package for the language you just added. In this article, French for Drupal core 7.x. Look for the Download link which appears to the right of Drupal core 7.x. If you hover over this link, you will see that is points to a file named drupal-7.x.fr.po. Download this file to your desktop.
  7. Go to admin/config/regional/translate and click on the Import tab. Import the translation package you’ve just downloaded into the desired language (drupal-7.x.fr.po into French for this article). You may need to import other project (module) packages (e.g. Views, Panels, etc.). But you can do that later.
  8. Go back to the Overview tab. Note the higher percentage for translated strings for the language you added.
  9. Next, we will activate the Language switcher block which will allow users to switch between languages. Go to admin/structure/block. Look for Language switcher and set the region (sidebar first in the present case). Click the Save blocks button at the bottom of the page. Goto your Home page and check that the block is showing. Clicking the different languages will switch the interface back and forth between them.
  10. The last step is to enable Multilingual support, with translation for each of the content type that you require. For the Article content type, go to admin/structure/types/manage/article and click on the Publishing options tab (the horizontal ones) and activate the Enabled, with translation radio button. Then click the Save content type button. Repeat for all content type that need a language specific translation.

That’s it. Your website is multilingual ready. Now every time you create a new node (Article, Page, etc.), you’ll have to specify which language it belongs to. Language neutral nodes will be displayed just the same for all languages. That’s why this article appears in English as well as in French. Check it out.

Drupal 7 CorporateClean theme Multilingual

Multilingual support for CorporateClean theme:

<?php
if (module_exists('i18n_menu')) {
	$main_menu_tree = i18n_menu_translated_tree(variable_get('menu_main_links_source', 'main-menu'));
} else {
	$main_menu_tree = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
}
print drupal_render($main_menu_tree);
?>

Control Hudson or Jenkins from Eclipse Indigo 3.7

For the latest eclipse release 3.7 called indigo is a plugin available to watch and control your build server based on hudson or jenkins. It is part of mylyn 3.5 as a view called “Builds”. See here for more information about the new features of mylyn 3.5. Their is as well a commercial plugin suite called tasktop available.

Howto install:

  1. Go to help -> install new software
  2. Click on “Available software sites”
  3. Click on add with name “mylyn” and url “http://download.eclipse.org/mylyn/releases/latest”
  4. Click ok to go back to site list
  5. Click ok to go back to available software
  6. Choose under “Work with” mylyn
  7. Choose under “Mylyn integrations” the point “Mylyn Builds Connector: Hudson/Jenkins (Incubation)”
  8. Choose under “Mylyn SDKs and Frameworks” the point  ”Mylyn Builds (Incubation)”
  9. Click on next
  10. Go through install process and restart eclipse
  11. Choose from menu “Window” -> “show view”
  12. Choose “Mylyn” -> “Builds”
With the blue server icon on the left side of the title bar you can add a new build server. Choose “Hudson” inside the wizard and click next. Enter the url of your jenkins server and enter a label. Click on refresh at the right side under build plans. Choose your favorite builds and click on finish. After that you should have a view similar to the one above. You can start a new build and get updates as notification during the build process.

XBMC irexec start python script

Azonos terminálból indítva (display :0-ból):

# Test to see if XBMC is running first

if pidof -s /usr/share/xbmc/xbmc.bin ; then
	# Try a clean kill
	echo "Closing xbmc!"
	ps aux|grep -i tv|grep -v grep|grep -i xbmc.bin|awk '{print $2}'|xargs kill
	echo "XBMC stoped (soft)"
	# takes a second or two to die with the soft kill
	sleep 2
	if pidof -s /usr/share/xbmc/xbmc.bin ; then
		ps aux|grep -i tv|grep -v grep|grep -i xbmc.bin|awk '{print $2}'|xargs kill -9
		echo "XBMC stoped (hard)"
	else 
		echo "XBMC Stoped (soft)"
	fi
else
	echo "Startup XBMC"
	xbmc
fi

echo "Done!"

Másik terminálból indítva (display :0-ra indítva):

# Test to see if XBMC is running first

if pidof -s /usr/share/xbmc/xbmc.bin ; then
   # Try a clean kill
   echo "Closing xbmc!"
   ps aux|grep -v grep|grep -i xbmc.bin|awk '{print $2}'|xargs kill
   echo "XBMC stopped (soft)"
   # takes a second or two to die with the soft kill
   sleep 2
   if pidof -s /usr/share/xbmc/xbmc.bin ; then
      ps aux|grep -v grep|grep -i xbmc.bin|awk '{print $2}'|xargs kill -9
      echo "XBMC stopped (hard)"
   else 
      echo "XBMC stopped (soft)"
   fi  
else
   echo "Startup XBMC"
   DISPLAY=:0 xbmc &
fi

echo "Done!"