utorok, 28. januára 2014

soup_session_feature_detach and Eclipse problem

PROBLEM - ERROR:

C  [libsoup-2.4.so.1+0x6dab1]  soup_session_feature_detach+0x11

in open JDK - Eclipse

SOLUTION:

edit eclipse.ini file
and add "-Dorg.eclipse.swt.browser.DefaultType=mozilla" to end of it


streda, 10. júla 2013

Linux bash custom command alias

You can do it globally for all users by editing edit /etc/bashrc as sudo
or only for you by editing /home/username/.bashrc

This is easy example. I just need short command to "jump" to folder with web pages.

Open bashrc file and add new line

alias html='cd /home/grex/www/'

now reload bashrc profile with command . ~/.bashrc

and try it!

štvrtok, 27. júna 2013

How to mount folder from host to guest and use it in Apache2

I have Host Pc with Fedora and virtual pc with Debian. In my other post, i showed how to set nettwork to see apache2 from host pc. http://nathrondevblog.blogspot.sk/2013/06/linux-ping-virtual-guest-from-host.html

Now I need to set apache on guest pc read files from my host pc.

1. open setting of your virtual pc and find Shared Folders.
2. click add and set:

Folder paht: path of your html files on host pc (for me /var/www/html)
Folder name: name for mounting in guest pc. (for me html)
and check permanent!

Start your virtual pc, log in and go as root.

note: be sure to backup default file before edit if you are not pro

1. open /etc/fstab
2. add line

html /var/www/html/  vboxsf  rw,uid=33,gid=33,umask=0222 0 0

where html is Folder name
and /var/www/html/ is path in your guest pc where files are mounted!

note: be sure to backup default file before edit if you are not pro

now you can change document root if its needed in /etc/apache2/sites-available/default

restart apache2 by

service apache2 restart

try virtual pc ip address in browser and see magic :)



piatok, 21. júna 2013

Linux ping virtual guest from host

I just need communication between host and virual pc, both on linux

HOST PC:Fedora 17 with Oracle Virtual Box

GUEST: Debian 6 with (apache 2, php 5.3)

Open VirtualBox Manager, select your guest, open settings -> Network and change:

1. Attached to from NAT to Bridge Adapter
2. select right name of host adapter (for me wlan0) whitch is connected to internet 



start virtual pc and try ping from host or from virtual ping host.



and for me virtual pc apache test

TADAAA

If you need add Guest Additions to your Virtual debian, use this manual:

http://virtualboxes.org/doc/installing-guest-additions-on-debian/

streda, 5. decembra 2012

Fedora (Linux) tomcat-juli problem

In case of problem: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory



To work it around, you need to add the tomcat-juli.jar to the run configuration class path.

Here are the steps how to do it:
1. In Eclipse, Open the "Server" tab.
2. Double click on the "Tomcat6" entry to see the configuration.
3. Then click on the "Open launch configuration" link in the "General information" block.
4. In the dialog, select the "Classpath" tab.
5. Click the "Add external jar" button.
6. Select the file "/usr/share/tomcat6/bin/tomcat-juli.jar"
7. Close the dialog.
8. Start tomcat 6 from Eclipse.

more on http://forums.opensuse.org/english/get-technical-help-here/applications/391114-tomcat6-eclipse-not-working.html

štvrtok, 15. novembra 2012

Wordpress - removing version info

Warning! Removing version not solving update requirements.

Go to your template directory and find functions.php

add this line remove_action('wp_head', 'wp_generator');

Tadaaa

streda, 15. augusta 2012

Java, create Hmac SHA1 like in php


private String sha1hash(String sInput){
String sReturn = "";
String sSecret = "1234";

try {
Mac mac = Mac.getInstance("HmacSHA1");
SecretKeySpec secret = new SecretKeySpec(sSecret.getBytes(),"HmacSHA1");
mac.init(secret);
byte[] digest = mac.doFinal(sInput.getBytes());

StringBuffer sb = new StringBuffer();

for (byte b : digest) {
sb.append(String.format("%02x", b));
}

sReturn = sb.toString();
} catch (Exception e) {
//TODO: handle this exception
}
return sReturn;
}