Primal Cortex’s Weblog

Amnesia sets in…

Archive for the ‘All about all’ Category

All about all…

Execute a simple Java Console application

Posted by primalcortex on March 14, 2013

How to execute a simple java console program, with a main function?

Sometimes whe need to build a simple java program to test some concept/code/whatever.

So the code is something like (grabbed from stackoverflow for my quick reference):

Sun’s tutorial contains a complete demonstration, but here’s another one from scratch. You need two files:

Test.java:

public class Test {

   public static void main(String[] args){
      System.out.println("Hello world");
   }
}
Then create a Manifest.mf file with the following content:

Manifest-version: 1.0
Main-Class: Test

Then compile the Java source file and create the jar file:

javac Test.java
jar cfm test.jar Manifest.mf Test.class
java -jar test.jar

Output:

Hello world

Posted in All about all | Tagged: | Leave a Comment »

Synology Mail Station with POP3 retrieval – Hibernation issues

Posted by primalcortex on October 27, 2012

After installing and enabling Synology Mail Station (RoundCube), I added a POP3 external account, so that account’s mail also was available at RoundCube’s interface on my Synology.

The issue is that after that change/configuration the NAS didn’t hibernate any more.

I thought that the issue was related to the pooling interval to the POP3 account, and I was right, it was set to 5 minutes by default. I’ve changed to 4 hour’s (240 minutes), but checking the logs I could see that the pooling was still at 5 minutes… and still the NAS wouldn’t hibernate.

So a quick check I’ve found out that the fetchmail process that fetchs the mail from the external POP3 accounts reads it’s configuration files from /var/packages/MailStation/target/roundcubemail/ext

In my case the POP3 account was defined on the admin accounts, and so there is an admin_fetch file, which might be different if other users are using the POP3 external accounts feature.

Editing this file there is a line

#### .fetchmailrc
set daemon 300

Which means pooling every 5 minutes (300 seconds)

I’ve changed the value to 21600 (4 hours), and waited for the next NAS restart.

After that pooling was set to every 4 hours and the NAS does hibernate now.

Didn’t bother to much to see how to restart the fetchmail process without rebooting the NAS, but probably restarting the Mail Station packages will suffice.

Posted in All about all | Tagged: , , , , | Leave a Comment »

How to check Apache Httpd version

Posted by primalcortex on November 22, 2011

This is a quick post regarding the how to check the Apache httpd version.

The simple way is just to run the following command: httpd -v

But on Linux, an error might crop up, namely: ./httpd: error while loading shared libraries: libexpat.so.0: cannot open shared object file: No such file or directory

So solve this issue, just run first the following command on the sbin httpd instalation directory:  source envvars and then the httpd -v command should work ok.

 

Posted in All about all | Leave a Comment »

[K]Ubuntu on the Asus N73SV video issues – i915, Nouveau, Nvidia and Bumblebee

Posted by primalcortex on August 10, 2011

Well, after a month on using this Asus Laptop N73SV there are some issues with it.

The first one, and I’m not sure if it’s a driver issue or just a plain hardware issue is that the external connected monitor was working fine, and then started to have a blue tint and now it has a green tint. So first I wonder if the VGA cable or the monitor itself was bad, but replacing it by another same monitor brand and model  and different VGA cable, it has shown the same issues. So Ok, it’s a laptop issue that some HP owners are also having… Just search for HP an video tint… Removing the battery and power, waiting some time, and booting up with the external monitor, even the ASUS logo is tinted… So it’s not a K/Ubuntu issue. Solution? None so far. I have to try with a different monitor/and cable namely HDMI.

The second part of this post related with the video issues that I have is due to the fact that this N73SV has dual cards: an Intel i915 and NVidia GT540M. While trying to debug the above issue, I ended up with no desktop effects on KDE KDM by messing around with the desktop effects options… Whatever I did to enable them I was also greeted with the message that Effects couldn’t be enabled. So issue was related to the fact that the GLX libraries couldn’t be found/loaded… When running glxgears this error appear:

name of display: :0.0
Xlib: extension “GLX” missing on display “:0.0″.
Xlib: extension “GLX” missing on display “:0.0″.

The solution:
I’ve removed bumblebee and nvidia, which cleared the issue:

apt-get purge bumblebee
sudo apt-get purge nvidia*
apt-get install –reinstall xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
dpkg-reconfigure xserver-xorg
reboot

And after this I could enable  again Desktop effects but I was using the default Intel driver and the Nouveau driver.

Finally, I’ve installed again MrMee/Bumblebee, which by itself installed again the Nvidia drivers, and after that I could only boot into Recovery Mode, because a normal start wouldn’t give me the Kubuntu boot logo and at final boot stage I just had a black screen with an hanged computer…

This issue is due to the fact that the nouveau driver is/was enabled, and I had to disable it. I found no complete instructions for doing that, but these do work:

The nouveau driver needs to be disabled, by editing two files:

/etc/modprobe.d/blacklist.conf

Add at the end of this file the following line: blacklist nouveau

And then, the other file to edit it depends of your grub version. For Grub2 , there is the need to add the following to the file /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash pci=nomsi nouveau.blacklist=1

And then run the command: update-grub2

On Grub1, just edit the menu.lst file and add the nouveau.blacklist=1 to yur booting kernel options, keeping in mind that after a kernel upgrade you need to blacklist the module again.

Booting up now with the Intel Driver and the Nvidia driver installed by Bumblebee should work.

Posted in All about all, KDE, Linux | Tagged: , , , , , | 1 Comment »

Portuguese Steam Engine train at the Douro

Posted by primalcortex on July 28, 2011

One of my favourite shows at the Travel Channel is the one named “The Great Scenic Railways Journeys”. North America has a lot of private and volunteer steam engines trains that are a tourist attraction, and at the same time, keep it’s pre-industrial and industrial history. And this on two countries that have at most 250 years of “modern” history.

Portugal despite it’s huge 1000 year history and contribution to the global world history is famous for  forgetting and letting rot it’s assets…

So it’s good to see, again this year, an old steam engine train on one of the more beautiful rail-roads in Europe and across the OPorto wine region is back in action:

If your in Oporto area this year, don’t miss it: Every Saturday until the 1st of October.

Posted in 1, All about all, Geral | Tagged: , | Leave a Comment »

Kubuntu, Bumblebee upgrade and NVidia

Posted by primalcortex on July 28, 2011

Yesterday, I’ve upgraded bumblebee on my Asus N73SV, which by itself downloaded and installed a new version of the proprietary Nvidia driver.

During the upgrade process, I was asked to install the maintainer version or my version… and I kept my version.

So after rebooting, I had no Kubuntu splash screen, just a black screen and after a while it just computer just hang with a dead keyboard. So unbootable and only rebootable by pressing the power button several seconds.

After some fiddling around I found out that booting into safe mode, getting into a root shell and starting KDM, everything seemed to work fine.

To keep a long story short, at boot time the X server loaded the Nouveau driver, and it was failing (looping) with some strange IRQ error. So the computer hanged.

The solution: Goto System -> Additional Drivers and enable the NVidia driver.

Reboot, and everything is Ok: Splash screen and Kdm.

A good solution is probably to purge completely the Nouveau driver if you’re really want to use the Nvidia driver. Instructions here: https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia

I reality this is the same issue with the ATI drivers. After upgrading the drivers it is, at least in my case, to explicitly enable them.

Posted in All about all, KDE, Linux | Tagged: , , | Leave a Comment »

Arch Linux test drive: Thoughts from a Kubuntu user

Posted by primalcortex on June 24, 2011

My old work laptop computer is about to be replaced by my employer by a new ASUS N73SV.

First of all this computer has what is called the Optimus Graphics Technology, that isn’t so Optimus regarding Linux… This technology is made of two video cards, one Intel embebed on the chipset and one discrete Nvidia chipset. As far as I know there is no Linux driver for this, and Nvidia won’t be releasing in a foreseeable future Linux support. So the Intel card will be used (I’m not using this for games) and the Nvidia card will be disabled. There are solutions for disabling completely the card and or use some applications on the Intel card and others on the Nvidia card, I’ll have to check. But disabling the Nvidia card improves the battery life, so…

So, off course, the first thing to do this computer is to nuke the Windows 7 install and install a Linux OS…

And there’s the catch: Kubuntu 11.04 or the Arch Linux Rolling distro?

Both have great documentation and great communities, but both could have some “clean up” on it. For example, on the Arch Beginner Install, some things aren’t completely obvious (Well at least for me). This is due to the fact that the documentation is in fact complete, it shows all the possibilities, but it should only show first the most obvious/common/standard way, and then link out the complete documentation regarding the subject. This way documentation could be more slim and straight forward.

Anyway, I was able to install and get an Arch system running without any issues with KDE Desktop but there where issues, and those are not Arch Linux fault. These issues are related to it’s mirrors and the software and sync status of them.

So being on PT, I’ve enabled all PT mirrors, and ended up with KDE 4.4.5 installing and running… Well the latest release of KDE is 4.6.3, so what happened here??? Browsing the mirrors I’ve found out that some where not up to date, so I’ve disabled them, and sure, pacman now shows that KDE 4.6.3 is available. So I’ve disabled the out of date mirrors, and while downloading I had failures regarding mplayer, and x264 packages that wouldn’t allow the upgrade to proceed.

Humm, ok, so I’ve enabled the core repository, and now everything is downloaded fine, but pacman refuses to upgrade due to some packages are corrupted.

So, not of the best starts…

But still I’ll give Arch Linux a try, because mainly on Kubuntu to have the latest software version, namely Libreoffice and even Calligra for test driving means to add backports and probably broking your next mandatory upgrade.

So, after reading the Arch Linux Wiki, I’ve found out that there is a mirror status page that shows what mirrors are available and up to date. I’ve deleted my obsolete mirrors, and enabled only the “live” ones (one in my case and did a full upgrade, and after an hour, more or less I had KDE 4.6 SC installed and running.

So far what I’ve done:

- Installed the base Arch system, making sure that the mirror list was up to date.

- Configured a new no priviledge user, and set up sudo

- Installed Xorg and KDE

- Configured the dbus and kdm daemons to start automatically

Then, I want to install the KDE Kpackagekit, but this was only available on AUR, not on the mainstream repositories. I’ve followed the instructions on http://archlinux.fr/yaourt-en#get_it and installed yaourt package manager. From here I’ve installed Kpackagekit, and with it I was able to install through KDE the rest of packages that I wanted, namely  the kdeplasma network widgets.

 

Posted in All about all, Geral, Linux | Tagged: , | 2 Comments »

Dokuwiki error

Posted by primalcortex on June 1, 2011

Quick post:

If by any chance, on Linux, you have the following error: The datadir (‘pages‘) does not exist, isn’t accessible or writable. You should check your config and permission settings.

The easiest way to check it is to do:

1) Goto root: sudo -s

2) Goto the web server user, normally www-data is the user used by Apache and lighttpd: su – www-data

4) Transverse the directory until reaching the pages directory: cd /; cd dir1; cd dir2 and so on

5) Somewhere when transversing the directories the permission error will pop-up when doing the cd command without enough privileges (the reason for the issue). To solve the issue, exit to the root user and correct the permissions to the user www-data on the affected directory.

Posted in All about all, Linux | Tagged: , | 1 Comment »

Panasonic Viera G30 and AVCHD files

Posted by primalcortex on June 1, 2011

Just bought a few weeks ago a Panasonic Viera G30, european model. The image quality is superb for SD (standard definition) and on HD it is just breathtaking, far superior, in my opinion to the LED and LCD competition at half the price.
Anyway, I own a lot of AVCHD files produced by my Canon Vixia HF200, and the Panasonic can happily read the camera SD card on it’s own SD card slot and even on it’s USB port trough an external card reader. I really never saw these files on an HD TV set, albeit I’ve saw some of them on a friends Sony LCD TV (model KDL4000, I think, not sure) through a WDTV player. I wasn’t amazed of the image quality on this TV..
Well on the G30, the AVCHD files just look fantastic, showing perfect near cinema quality and playing smooth without any hiccups or any flaw.
But there’s a catch. Panasonic Viera can only play AVCHD files with it’s own media player if they are inside a Blue-Ray file structure. Standalone MTS files are not played.

This means that I have a problem, being it that my all AVCHD video library of standalone files cannot be played directly on Viera without first packing them into a BD file structure, much like the folders and files that are on the SDHC camera card…

Creating the file structure on an external hardisk and copying all files to the STREAM sub-folder is not enough, because the G30 will try to read the playlist file .MPL.
So it isn’t just enough to copy the files to a “pre-prepared” hard disk, a correct MPL file must be generated.
So far the only tool that I know that can do that is the multiAVCHD program, only available for windows, but runs fine on Linux, through WINE.
The problem with this tool, in my case, is that will build a complete BD file structure by copying the MTS files and then generating the MPL file… A waste of time.
So if anyone knows a tool that given a list of MTS files, generates a MPL file, and runs on Linux, give me a bip to check it out.

Posted in All about all, Linux | Tagged: , , , , , , | Leave a Comment »

JBoss AD Login Module configuration

Posted by primalcortex on March 30, 2011

When configuring the JBOSS Ldap login module one, of the parameters is the ldap url that Jboss will use to connect to the Active Directory.

Anyway, when doing an all products in a server install (Jboss + AD + DB on same machine), I blindly enter the following URL for the LDAP connection. ldap://localhost:389 …

This is big troubles, because, using this URL the LDAP login module was always unable to authenticate users with the following error:

ldapctx javax.naming.PartialResultException: Unprocessed Continuation

It took me a while to solve the issue, and it’s quite simple.

First make sure that the domain name is able to be resolved, namely by the command ping domain.com or nslookup domain.com. The domain name must be the Active Directory configured domain name that the LDAP login module is going to connect to make user validation. If the above commands fail, just add the domain name and the AD IP to the hosts file.

Then replace the url from ldap://localhost:389 or from ldap://invalidADname:port to ldap://domain.com:389 and a follow reference configuration line.

Things must look like these now:

<application-policy name=”MyApplicationDomain”>
<authentication>
<login-module code=”org.jboss.security.auth.spi.LdapExtLoginModule” flag=”required” >
<module-option name=”java.naming.provider.url”>ldap://domain.com:389</module-option>
<module-option name=”java.naming.referral”>follow</module-option>
<module-option name=”java.naming.security.authentication”>simple</module-option>


</authentication>

Issue solved…

Posted in All about all | Tagged: , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.