Today I couldn't listen to anything or change the volume or do anything related to audio.
Someone suggested to:
> net stop audiosrv
> net stop AudioEndpointBuilder
> net start audiosrv
> net start AudioEndpointBuilder
After 5 minutes I'm still trying to see if the first command will ever end.
I'll never find out. I finally had to reboot. I tried the put-it-to-sleep solution but it went into eternal sleep.
That's always been Windows' solution: "reboot without saving your changes"!
Monday, October 05, 2015
Tuesday, June 02, 2015
DokuWiki Hrun Alerts About Update even When Done
"Hotfix release available" alerts keep being displayed even after you do the update.
Apparently there is a bug.
In some places they explain you can manually remove the file: data/cache/messages.txt.
For me this doesn't work since the file is recreated right away.
What I did was to empty the file and leave it there and that worked.
... for a while. Now it's there again.
More info here if you want to try something.
Apparently there is a bug.
In some places they explain you can manually remove the file: data/cache/messages.txt.
For me this doesn't work since the file is recreated right away.
What I did was to empty the file and leave it there and that worked.
... for a while. Now it's there again.
More info here if you want to try something.
Thursday, May 07, 2015
Take Ownership and Assign Permissions to Yourself on Windows
Sometimes on mounted external drives, you are not the owner (don't ask me why, I'll never understand what's the reasoning behind Windows in general) and cannot change/view files.
Try this:
# Recursively take ownership of directory:
> takeown /f "c:\path"
# Reset permissions recursively
> icacls "c:\path" /reset /T
Try this:
# Recursively take ownership of directory:
> takeown /f "c:\path"
# Reset permissions recursively
> icacls "c:\path" /reset /T
Monday, March 30, 2015
Dell Laptop: Plugged In, Not Charging
I recently noticed this unwanted message on my Dell Latitude E6540 with Windows 7.
Don't know exactly what prompted it but the battery would not charge above 64%, no matter how I changed the settings of the power saving mode.
Here's how I solved it:
Thanks to nickscomputerfix!
On the contrary, a good reason not to keep it charged at 100%:
The third tip relates to when and by how much batteries should be charged. One of the more widely known aspects about battery life is the “memory effect”.
In older rechargeable battery chemistries, such as nickel cadmium, partial charging and discharging significantly decreases the energy capacity.
What is less known is that the memory effect in lithium-ion batteries, if it exists, tends to be very small. Instead, they have quite nuanced characteristics. When not in use, batteries degrade most when fully charged. So if left for several days or weeks without use, they should ideally be kept at a relatively low charging state, e.g around 20% charged.
Conversely, when being charged and discharged a lot, it is best to keep the batteries as close to the 50% mark as possible. So if you are only charging and discharging batteries a bit at a time, it is much better to do this between 45-55% than between 90-100%.
Full article.
Don't know exactly what prompted it but the battery would not charge above 64%, no matter how I changed the settings of the power saving mode.
Here's how I solved it:
- Power off
- Remove the battery
- Restart Windows
- Go to Control Panel -> Hardware and Sound -> Device Manager
- Under Batteries, remove all Microsoft AC Adapter and Microsoft ACPI-Compliant Control Method Battery
- Power off
- Put the battery back in place
- Restart Windows
Thanks to nickscomputerfix!
On the contrary, a good reason not to keep it charged at 100%:
The third tip relates to when and by how much batteries should be charged. One of the more widely known aspects about battery life is the “memory effect”.
In older rechargeable battery chemistries, such as nickel cadmium, partial charging and discharging significantly decreases the energy capacity.
What is less known is that the memory effect in lithium-ion batteries, if it exists, tends to be very small. Instead, they have quite nuanced characteristics. When not in use, batteries degrade most when fully charged. So if left for several days or weeks without use, they should ideally be kept at a relatively low charging state, e.g around 20% charged.
Conversely, when being charged and discharged a lot, it is best to keep the batteries as close to the 50% mark as possible. So if you are only charging and discharging batteries a bit at a time, it is much better to do this between 45-55% than between 90-100%.
Full article.
Labels:
battery,
dell latitude,
plugged in not charging,
windows 7
Thursday, February 05, 2015
Windows Taskbar Does Not Hide
Sometimes even if you configured the taskbar to hide itself, it won't and you tried everything you know.
Welcome to the Windows way of doing things!
There is probably a notification from some process, which you cannot easily spot.
The quick way to solve this: kill and restart the file explorer.
Go to the Task Manager --> Processes, and kill explorer.exe.
Then File --> New Task (Run) and type explorer.exe.
Done!
Welcome to the Windows way of doing things!
There is probably a notification from some process, which you cannot easily spot.
The quick way to solve this: kill and restart the file explorer.
Go to the Task Manager --> Processes, and kill explorer.exe.
Then File --> New Task (Run) and type explorer.exe.
Done!
Monday, January 12, 2015
iReport 5.6.0 Failing Silently
Versions up to 5.6.0 (currently the last one) do not run with JDK
1.8. They will silently fail, at least on Windows 7.
If you want to keep JAVA_HOME set to a JDK 1.8 installation, you can run it launching a batch file with something like this inside:
@echo off
set JAVA_HOME=C:\opt\java\jre1.7.0_71
"C:\Program Files (x86)\Jaspersoft\iReport-5.6.0\bin\ireport.exe"
Customize as needed.
If you want to keep JAVA_HOME set to a JDK 1.8 installation, you can run it launching a batch file with something like this inside:
@echo off
set JAVA_HOME=C:\opt\java\jre1.7.0_71
"C:\Program Files (x86)\Jaspersoft\iReport-5.6.0\bin\ireport.exe"
Customize as needed.
Friday, December 12, 2014
Removing commons-logging Dependency from Spring with Ivy
Let's say you want Spring to use SLF4J instead of commons-logging.
First you need to remove the dependency from spring-core:
[TODO]
In the unlikely event you are already not loading transitive dependencies:
<dependency org="org.springframework" name="spring-core" rev="3.2.8.RELEASE" transitive="false"/>
you need to to nothing.
Then add the following dependencies to specify the framework you want to use:
<dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.7.7" transitive="false"/>
<dependency org="org.slf4j" name="slf4j-api" rev="1.7.7" transitive="false"/>
<dependency org="org.slf4j" name="slf4j-log4j12" rev="1.7.7" transitive="false"/>
First you need to remove the dependency from spring-core:
[TODO]
In the unlikely event you are already not loading transitive dependencies:
<dependency org="org.springframework" name="spring-core" rev="3.2.8.RELEASE" transitive="false"/>
you need to to nothing.
Then add the following dependencies to specify the framework you want to use:
<dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.7.7" transitive="false"/>
<dependency org="org.slf4j" name="slf4j-api" rev="1.7.7" transitive="false"/>
<dependency org="org.slf4j" name="slf4j-log4j12" rev="1.7.7" transitive="false"/>
Ant: Class not found: javac1.8
This error is known to happen with Apache Ant versions less than 1.9.0,
which aren't compatible with Java 8.
Upgrade!
Worked for me.
Thanks to Kristian.
Upgrade!
Worked for me.
Thanks to Kristian.
Wednesday, December 10, 2014
Find out which applications are using port x on Windows
Find out which applications are using port x on Windows:
> netstat -aon | findstr 0.0:8080
Tuesday, August 19, 2014
Google Drive: Failed to Schedule 1 File for Upload
If your Google drive application for an Android mobile device gives you this message and you have the Developer Options enabled, try to uncheck Do not keep activities before trying anything else.
Thanks to bbell67.
Thanks to bbell67.
Friday, June 27, 2014
Wireshark: The NPF driver isn't running
The NPF driver isn't running. You may have trouble capturing or listing interfaces.
You run Wireshark occasionally and don't want to start the NPF driver automatically at start up.
Open a command shell with administrator rights and type:
> sc start npf
You can [stop] the service in the same way.
You run Wireshark occasionally and don't want to start the NPF driver automatically at start up.
Open a command shell with administrator rights and type:
> sc start npf
You can [stop] the service in the same way.
Run a Command as Administrator on Windows
I didn't know this but since I'm a Linux guy, I'm not ashamed.
On windows, if you log in as a user with administrator privileges but want to run a command shell with administrator's rights, you still need to run it in a special way:
On windows, if you log in as a user with administrator privileges but want to run a command shell with administrator's rights, you still need to run it in a special way:
- Go to the start bar search box
- Type cmd
- Right-click on cmd.exe and choose "Run as administrator"
Tuesday, June 10, 2014
Building with Ant from Eclipse: "Specified VM install not found"
After an update of the JDK and successive removal of the old version, when I tried to build with Ant from Eclipse I got:
Specified VM install not found: type Standard VM, name jdk1.7.0_55
Yeah, right, OK, but where do I update the JDK that's used by Ant??
Here:
Run -> External Tools -> External Tools Configurations -> JRE
Thanks to Michael Borgwardt
Specified VM install not found: type Standard VM, name jdk1.7.0_55
Yeah, right, OK, but where do I update the JDK that's used by Ant??
Here:
Run -> External Tools -> External Tools Configurations -> JRE
Thanks to Michael Borgwardt
Monday, June 09, 2014
Windows Keeps Forgetting the Wi-Fi Connection Password
One possible cause of the problem is that the Intel PROSet/Wireless WiFi Connection Utility is somehow conflicting with the OS.
Try to disable it and go back to Windows managing the connections.
Once you're opened the Intel WiFi connection utility, choose: Advanced, then something like Let Windows Manage the WiFi Connections.
You're done.
Try to disable it and go back to Windows managing the connections.
Once you're opened the Intel WiFi connection utility, choose: Advanced, then something like Let Windows Manage the WiFi Connections.
You're done.
Wednesday, May 07, 2014
Windows 7 Taskbar Icons Not Displaying Properly After Repair
If some of your icons display like empty boxes after a repair to the system because of some reset, then follow these instructions. They worked for me.
Tested on Windows 7
Thanks to bhadri.
- Open the task manager in the processes tab.
- Kill explorer.exe.
- From the File menu in the task manager, choose New task (run...)
- Execute the following:
- cmd /c del %userprofile%\AppData\Local\IconCache.db /a
- And restart explorer running:
- explorer.exe
Tested on Windows 7
Thanks to bhadri.
Sunday, April 27, 2014
Add a Program to the Send To Menu
If you need to use Windows and would like to add some more user-friendliness to the super user-friendly MS GUI, like, adding some other program to the Send To menu, here it is what you need to do:
- Open Windows explorer and type: shell:sendto in the text field.
- Create a link, ehm shortcut for the program you plan to add in some place (directory, desktop).
- Cut and paste it into the Windows explorer directory.
- You're done!
Thursday, April 24, 2014
Specified VM install not found: type Standard VM ...
Specified VM install not found: type Standard VM, name jdk1.7.0_45
You installed a new JDK, configured Eclipse to recognize it but the old one still pops up when you compile or do something else.
Try removing the following file:\.metadata\.plugins\org.eclipse.debug.core\.launches\projectname build.xml.launch
Thanks to Mujahed
You installed a new JDK, configured Eclipse to recognize it but the old one still pops up when you compile or do something else.
Try removing the following file:
Thanks to Mujahed
Monday, March 17, 2014
Mercurial: abort: uncommitted local changes
If you're using TortoiseHg Workbench: go to Repository --> Terminal.Otherwise simply open a console and cd to the root directory of your repository. Type: > hg update --clean -r tipThat should solve the problem.Thanks to Mike here.
Friday, February 21, 2014
Annoying Eclipse Validation Errors
Sometimes you run into these Unknown validation errors in Eclipse which you seem not to be able to get rid of.
The Maven build is running fine even from within Eclipse but the messages won't go away even if you:
If there was no real reason for them to show up because in the meantime you had removed the reason for them to exist, then they'll not be generated again.
Thanks to pelotom!
The Maven build is running fine even from within Eclipse but the messages won't go away even if you:
- Right-click on the project --> Validate
- Project --> Clean
- Close and re-open it
If there was no real reason for them to show up because in the meantime you had removed the reason for them to exist, then they'll not be generated again.
Thanks to pelotom!
Friday, November 08, 2013
Nexus 7 Not Showing Up on Windows 7 After Upgrade to Android 4.3
First generation Nexus 7 with Android 4.3
It was working before the last firmware upgrade.
After the upgrade the device simply doesn't show up in the file explorer.
If you go to the list of devices, it's there.
If you remove the driver, Windows will simply reinstall it automatically.
If you choose "Upgrade driver" Windows will tell you you have the most recent version.
What worked is:
It should...
It was working before the last firmware upgrade.
After the upgrade the device simply doesn't show up in the file explorer.
If you go to the list of devices, it's there.
If you remove the driver, Windows will simply reinstall it automatically.
If you choose "Upgrade driver" Windows will tell you you have the most recent version.
What worked is:
- Go to Settings --> Storage
- Open the menu on the top left corner and select USB computer connection
- Choose Media device
It should...
Thursday, October 24, 2013
Forgot to Change Mercurial's Commit Comment?
If you're using TortoiseHg (my version is 2.9.2) and it's the last thing you did (the commit), then you can simply go to Repository --> Rollback/Undo. What you need is the Undo and to preserve the changed files in the workspace. Follow the instructions then and you're set!
Monday, October 21, 2013
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
I got this while running an Eclipse Configuration (Run Configurations) on a GWT project on Windows. If Eclipse cannot do it, you can do it manually...
- Start
regedit - Navigate to the following path
HKEY_LOCAL_MACHINE\Software\JavaSoft
- Right click on the JavaSoft folder and click on
New->Key - Name the new Key
Prefs
Labels:
eclipse configuration,
gwt,
registry,
windows
Friday, June 07, 2013
Reduce a Video Size with ffmpeg
Basic command to reduce a video for upload to YouTube:
> ffmpeg -i input_video.mp4 -ab 56k -ar 22050 -b 300k -r 15 -s 640x360 output_video.flv
If the original size was greater and you have the time to keep it bigger, YouTube suggests a size of 1280x720 for better reproduction.
More info to come... in the meantime:
Read the man page for more information.
FFmpeg documentation.
> ffmpeg -i input_video.mp4 -ab 56k -ar 22050 -b 300k -r 15 -s 640x360 output_video.flv
If the original size was greater and you have the time to keep it bigger, YouTube suggests a size of 1280x720 for better reproduction.
More info to come... in the meantime:
Read the man page for more information.
FFmpeg documentation.
Saturday, May 25, 2013
Configure Sun's Java Plugin for Firefox
- Install the JRE or JDK as RPM or in your favorite location;
- Open a shell and go to: ~/.mozilla
- 64-bit platform: create the link: ln -s /opt/java/jdk1.7/jre/lib/amd64/libnpjp2.so . (the dot stands for the current directory)
- 32-bit platform: search for the directory: i386.
Reference:
http://www.java.com/en/download/help/index_installing.xml
Monday, April 22, 2013
Set Sun's JDK as Default on Fedora 18
If you installed Sun's JDK (yes, I still call it Sun's!) from the binary package (versus the RPM) and need to use it as the default implementation, you can manually alter the PATH and JAVA_HOME but the easy way is to, at first let Fedora know about it:
# java
> alternatives --install /usr/bin/java java /opt/java/jdk1.7.0_21/jre/bin/java 20000
# javaws
> alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.7.0_21/jre/bin/javaws 20000
# Java Browser (Mozilla) Plugin 64-bit
> alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /opt/java/jdk1.7.0_21/jre/lib/amd64/libnpjp2.so 20000
# Install javac only if you installed JDK (Java Development Kit) package
> alternatives --install /usr/bin/javac javac /opt/java/jdk1.7.0_21/bin/javac 20000
> alternatives --install /usr/bin/jar jar /opt/java/jdk1.7.0_21/bin/jar 20000
and then set it as the default:
> alternatives --config java
> alternatives --config javac
Source.
# java
> alternatives --install /usr/bin/java java /opt/java/jdk1.7.0_21/jre/bin/java 20000
# javaws
> alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.7.0_21/jre/bin/javaws 20000
# Java Browser (Mozilla) Plugin 64-bit
> alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /opt/java/jdk1.7.0_21/jre/lib/amd64/libnpjp2.so 20000
# Install javac only if you installed JDK (Java Development Kit) package
> alternatives --install /usr/bin/javac javac /opt/java/jdk1.7.0_21/bin/javac 20000
> alternatives --install /usr/bin/jar jar /opt/java/jdk1.7.0_21/bin/jar 20000
and then set it as the default:
> alternatives --config java
> alternatives --config javac
Source.
Monday, April 15, 2013
Add Installed JDK to Eclipse
If you install a JDK yourself (from a BIN, ZIP or other archive) you can easily add it from Window --> Preferences --> Java --> Installed JREs, choosing Add --> Standard VM and specifying the root directory of the newly unpacked installation.
If the JDK is already installed with the Linux standard directory structure, you should instead specify one of the directories you can find in /lib/jvm.
If the JDK is already installed with the Linux standard directory structure, you should instead specify one of the directories you can find in /lib/jvm.
Create an Eclipse Git Maven Java Project
You need to create a new Eclipse (Juno) Java project from a remote Git repository (like GitHub) managed by Maven (i.e. you already have a pom.xml for your project.)
- Make sure you installed a Git plugin like EGit.
- Click on File --> Import --> Git --> Projects from Git
- Then follow the instructions...
- Specify a URI for the repository source. This will end with a file.git.
- Select a branch.
- Local destination (<Git's_local_repository
>/<project_name >) - Select Import existing project.
- Select create Java project.
- Select Use custom location. This should be the local Git repository location.
- Mavenize it: right-click on the project's name --> Configure --> Convert to Maven project.
Friday, April 12, 2013
Export Java Syntax Coloring Preferences from Eclipse Juno
I just found out that trying to export just the Java syntax coloring preferences from Eclipse Juno doesn't work.
These are the color preferences you set from Window --> Preferences --> Java --> Editor --> Syntax Coloring.
Theoretically you should do a File --> Export --> General --> Preferences, select Java Code Style Preferences (I don't have a Syntax coloring item) and get them in your favorite file.epf
They should be included in those.
It doesn't work. But you can get them if you select export all.
I don't know if this is a bug or not...
These are the color preferences you set from Window --> Preferences --> Java --> Editor --> Syntax Coloring.
Theoretically you should do a File --> Export --> General --> Preferences, select Java Code Style Preferences (I don't have a Syntax coloring item) and get them in your favorite file.epf
They should be included in those.
It doesn't work. But you can get them if you select export all.
I don't know if this is a bug or not...
Thursday, February 21, 2013
rpm Features
Show contents of non-installed package:
> rpm -q -filesbypkg -p package_name.rpm
Extract RPM package files to current directory:
> rpm2cpio package_name.rpm | cpio -idmv
> rpm -q -filesbypkg -p package_name.rpm
Extract RPM package files to current directory:
> rpm2cpio package_name.rpm | cpio -idmv
Sunday, February 10, 2013
Create Maven Project in Eclipse from Existing pom.xml
If you want to create an Eclipse project from an existing pom.xml file, you cannot do it from the usual New --> Project ...
For some reason you need to import it:
File --> Import --> Maven --> Existing Maven projects
Maybe I'm wrong but with Ant you could create a new Ant project from an existing build.xml...
For some reason you need to import it:
File --> Import --> Maven --> Existing Maven projects
Maybe I'm wrong but with Ant you could create a new Ant project from an existing build.xml...
Thursday, January 17, 2013
Open a File in a Google Chrome Tab
There is no menu item to do that but...
Linux
Just type file:/// in the address bar.
The last / is the root directory of the filesystem.
In Windows: file://c:
Linux
Just type file:/// in the address bar.
The last / is the root directory of the filesystem.
In Windows: file://c:
Thursday, January 10, 2013
Performance Degradation of Gnome 3
If I leave my Fedora 17 desktop (4Gb of RAM) running for half a day or more, the responsiveness drops as the load climbs.
At the end it's a total stall with memory usage skyrocketing to 99% and the system blocked.
I thought it was Firefox, then Gnome then I noticed the gnome-shell process was at the top of the resource-consuming processes.
A simple restart of Gnome (Alt-F-r) fixed the problem for good.
I'll check how often I need to do this.
It could be something connected with this particular release of Fedora or a general one with this Gnome (3.4.x).
Update! Another source of load is Chrome. Try to restart it to see if you gain some memory space.
At the end it's a total stall with memory usage skyrocketing to 99% and the system blocked.
I thought it was Firefox, then Gnome then I noticed the gnome-shell process was at the top of the resource-consuming processes.
A simple restart of Gnome (Alt-F-r) fixed the problem for good.
I'll check how often I need to do this.
It could be something connected with this particular release of Fedora or a general one with this Gnome (3.4.x).
Update! Another source of load is Chrome. Try to restart it to see if you gain some memory space.
Friday, December 21, 2012
Gnome 3 Extension: System Monitor
I was missing a system monitor icon from the previous release of Gnome and finally had the time to look for a replacement in Gnome 3.
Go to the extension page with your favorite browser.
Install and enable the extension turning the button in the top left corner on.
Don't forget to configure the icon position clicking on the configure button or you'll find the calendar icon squeezed on the right and unreadable.
Go to the extension page with your favorite browser.
Install and enable the extension turning the button in the top left corner on.
Don't forget to configure the icon position clicking on the configure button or you'll find the calendar icon squeezed on the right and unreadable.
Labels:
extension,
fedora 17,
gnome 3,
system monitor
Tuesday, December 04, 2012
Fedora 17 Microphone not Working
If you can't use your headphones microphone on your newly installed Fedora 17 device, you first need to:
- Open your sound settings and check the proper device is enabled.
- If yes, run alsamixer, select the sound card and make sure that the internal microphone and capture are enabled and that both Mic Boost and Capture have high volumes.
- Run arecord -D "hw:1,0,0" -f cd -d 4 test-mic.wav. The wav file created should have sound in it.
Thursday, November 29, 2012
gnome-tweak-tool to change Gnome 3 Settings
[Updated 2013-06-20]
You can modify the gnome settings using gnome-tweak-tool
E.g. The clock/date settings
If you want to show the date in the clock on the top bar:
You can modify the gnome settings using gnome-tweak-tool
E.g. The clock/date settings
If you want to show the date in the clock on the top bar:
- Launch the gnome-tweak-tool
- Go to the "Shell" menu
- Enable "Show date in clock"
Labels:
fedora,
gnome 3,
gnome settings,
gnome-tweak-tool
Wednesday, November 28, 2012
Fedora 17: em1 Instead of eth0?
Network Interface Controllers (NIC) that are embedded on the motherboard are identified by udev as em1, em2, etc. This is part of an attempt to make interface naming more predictable and meaningful.
That's what you will find instead of eth0, eth1, etc.
To get back the old name go to: /etc/default/.
There you'll find the configuration file for the default Fedora boot loader, GRUB: grub
Add the following command (bold) to the line with the key GRUB_CMDLINE_LINUX:
GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=True KEYTABLE=us rd.luks=0 LANG=en_US.UTF-8 biosdevname=0 rhgb quiet"
Go to /boot/grub2, make a backup copy of grub.cfg and regenerate the GRUB configuration file:
> grub2-mkconfig -o grub.cfg
Reboot and eth0 will be back!
Hints here and there.
That's what you will find instead of eth0, eth1, etc.
To get back the old name go to: /etc/default/.
There you'll find the configuration file for the default Fedora boot loader, GRUB: grub
Add the following command (bold) to the line with the key GRUB_CMDLINE_LINUX:
GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=True KEYTABLE=us rd.luks=0 LANG=en_US.UTF-8 biosdevname=0 rhgb quiet"
Go to /boot/grub2, make a backup copy of grub.cfg and regenerate the GRUB configuration file:
> grub2-mkconfig -o grub.cfg
Reboot and eth0 will be back!
Hints here and there.
Saturday, October 27, 2012
Get Delete Command in Nautilus File Manager Menu
Hitting delete on a Nautilus file won't work like it used to in the past for "security" reasons.
If you want to, at least, have the delete context menu (right click) item to be able to bypass the send-to-trash behavior in the Nautilus file manager, you need to:
If you want to, at least, have the delete context menu (right click) item to be able to bypass the send-to-trash behavior in the Nautilus file manager, you need to:
- Go to Edit --> Preferences
- Behavior Tab
- Check the Include a delete command that bypasses trash
Friday, October 19, 2012
Upgrading BIOS on an Asus Motherboard
I was trying to upgrade the BIOS on a Asus P8H61-M PRO motherboard on a floppy-less PC.
Luckily this motherboard supports upgrading from the BIOS itself.
The problem was I got this error once the image was selected on a disk partition (strangely enough the BIOS saw only one of the two disks):
It turned out the file should reside on a FAT32 partition while the one it was on was NTFS.
I put the new BIOS on a pen drive and the BIOS saw it, finally ending the story.
Side note: the error message was pretty useless, once again.
Luckily this motherboard supports upgrading from the BIOS itself.
The problem was I got this error once the image was selected on a disk partition (strangely enough the BIOS saw only one of the two disks):
Selected file is not an EFI BIOS
It turned out the file should reside on a FAT32 partition while the one it was on was NTFS.
I put the new BIOS on a pen drive and the BIOS saw it, finally ending the story.
Side note: the error message was pretty useless, once again.
Thursday, July 19, 2012
Order of Annotated Controllers When Matching @RenderMapping and @ActionMapping
Configuration: JDK 7, Spring 3.1.1.RELEASE and Hibernate 4.1.3.Final. Multiple annotated controllers.
When you invoke a Render or Action mapping, it might happen the default mapping is picked up instead of the correct one.
This happens when the controller with the default mapping is first in the list.
DEBUG [http-8080-1] (AbstractMapBasedHandlerMapping.java:74) - Key [view] -> handler [{org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping$RenderMappingPredicate@2e19e=my.package.controller.DefaultController@12a8bad, ...
It's probably a bug or I don't understand the purpose yet.
This can be fixed by forcing Spring to put the controller with the default mapping last. First you scan all others and separately the default one:
<context:component-scan base-package="it.italiangrid.liferay.doclibadmin.controller" use-default-filters="true">
<context:exclude-filter type="regex" expression="EmiDocumentController"/>
</context:component-scan>
<context:component-scan base-package="it.italiangrid.liferay.doclibadmin.controller" use-default-filters="true">
<context:include-filter type="regex" expression="EmiDocumentController"/>
</context:component-scan>
Update I found out that if you use @RequestMapping instead of @RenderMapping and @ActionMapping in all methods of the controller with the default action, the problem seems to disappear.
You can use render and action mapping annotations in all other controllers.
When you invoke a Render or Action mapping, it might happen the default mapping is picked up instead of the correct one.
This happens when the controller with the default mapping is first in the list.
DEBUG [http-8080-1] (AbstractMapBasedHandlerMapping.java:74) - Key [view] -> handler [{org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping$RenderMappingPredicate@2e19e=my.package.controller.DefaultController@12a8bad, ...
It's probably a bug or I don't understand the purpose yet.
This can be fixed by forcing Spring to put the controller with the default mapping last. First you scan all others and separately the default one:
<context:component-scan base-package="it.italiangrid.liferay.doclibadmin.controller" use-default-filters="true">
<context:exclude-filter type="regex" expression="EmiDocumentController"/>
</context:component-scan>
<context:component-scan base-package="it.italiangrid.liferay.doclibadmin.controller" use-default-filters="true">
<context:include-filter type="regex" expression="EmiDocumentController"/>
</context:component-scan>
Update I found out that if you use @RequestMapping instead of @RenderMapping and @ActionMapping in all methods of the controller with the default action, the problem seems to disappear.
You can use render and action mapping annotations in all other controllers.
References
Thursday, July 12, 2012
Gnome 3: Add a Custom Item to Favorites
Install and run alacarte. This tool allows you to manage the applications you see in the window Activities --> Applications. Those shown there are a subset of the ones available.
- Create a new one in Alacarte with New Item in an existing or new menu.
- Check the Show checkbox.
- Go to Activities --> Applications and right click on the icon to add to the Favorites side bar.
Tuesday, July 10, 2012
Fedora 17: Disable Jetty
From this Fedora 17 announcement:
If you have updated from Fedora 16 and you had jetty installed, it was
automatically enabled to start on reboot. If you are are not using jetty for
serving web content, but it was installed as a dependency, please run the
following command as root user:
# systemctl disable jetty.service
This will stop jetty from running automatically on system reboot. If you also
want to stop the currently running jetty you can run following:
# systemctl stop jetty.service
If you have updated from Fedora 16 and you had jetty installed, it was
automatically enabled to start on reboot. If you are are not using jetty for
serving web content, but it was installed as a dependency, please run the
following command as root user:
# systemctl disable jetty.service
This will stop jetty from running automatically on system reboot. If you also
want to stop the currently running jetty you can run following:
# systemctl stop jetty.service
Friday, June 29, 2012
BASH's Ctrl-r
Used to search a command in the history.
Usage: type the command and start entering what you're looking for. Once found you can...
Ctrl-r + ENTER = Execute.
Ctrl-r + left/right arrow = put it on the command line to edit.
Ctrl-r + Ctrl-r = Get an older command starting with the same characters typed.
Usage: type the command and start entering what you're looking for. Once found you can...
Ctrl-r + ENTER = Execute.
Ctrl-r + left/right arrow = put it on the command line to edit.
Ctrl-r + Ctrl-r = Get an older command starting with the same characters typed.
Wednesday, June 13, 2012
Weird Things With Spring, Eclipse and Tomcat?
Everything was working and now an action seemingly still properly configured from a controller is simply ignored?
It's not Spring's or Eclipse's or your sister's fault.
Check you inadvertently didn't start another instance of Tomcat.
That's what happened to me! And I don't have sisters to blame!
It's not Spring's or Eclipse's or your sister's fault.
Check you inadvertently didn't start another instance of Tomcat.
That's what happened to me! And I don't have sisters to blame!
Thursday, June 07, 2012
hibernate3:hbm2ddl - Could not determine type for: java.util.List
Trying to generate DB tables from Java classes, I got this error for this one-to-many mapping:
@ElementCollection(targetClass = DocArea.class)
@CollectionTable(name = "area_doc",
joinColumns = @JoinColumn(name = "id_doc"))
@Column(name = "id_area")
public List getAreas() {
return areas;
}
where Area is an enumeration.
It was a version incompatibility between the hibernate3 plugin and Hibernate itself. I found out you can override a plugin's dependencies in the configuration of the plugin itself thanks to Ivar's post.
@ElementCollection(targetClass = DocArea.class)
@CollectionTable(name = "area_doc",
joinColumns = @JoinColumn(name = "id_doc"))
@Column(name = "id_area")
public List
return areas;
}
where Area is an enumeration.
It was a version incompatibility between the hibernate3 plugin and Hibernate itself. I found out you can override a plugin's dependencies in the configuration of the plugin itself thanks to Ivar's post.
Thursday, May 17, 2012
Firefox 12 Way Too Slow on Fedora 16
I found these useful tips on how to customize Firefox and get it faster.
Now, when I have time I need to test if they're working because in the meantime I switched to Chrome despite my lifelong appreciation for the Fox. This is to tell you how unusable it has become.
Now, when I have time I need to test if they're working because in the meantime I switched to Chrome despite my lifelong appreciation for the Fox. This is to tell you how unusable it has become.
Monday, May 14, 2012
No Cascade Delete on a Collection Relationship
I had the following relationship in a UserAnswer, the answer(s) a user can give to a question in a survey:
I wanted to propagate all persistence operations to the collection except DELETE. I didn't want an Answer to be deleted when all UserAnswers were removed.
This is how it worked for me:
@ManyToMany(targetEntity=Answer.class, cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH})
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@JoinTable(name="userAnswer_answers",
joinColumns=@JoinColumn(name="userAnswer_fk"),
inverseJoinColumns=@JoinColumn(name="answer_fk"))
@Sort(type = SortType.COMPARATOR, comparator = AnswerPositionComparator.class)
public SortedSet
return selectedAnswers;
}
If you don't use CascadeType.ALL, Hibernate doesn't cascade the save of an entity's Collection properties when using the PERSIST annotation. You have to explicitly use the org.hibernate.annotations.CascadeType.SAVE_UPDATE annotation.
Source here.
Friday, May 11, 2012
Eclipse Code Templates
If you'd like to have your own text additions to a new file upon its creation, you can customize the way it is created with code templates.
Go to Window --> Properties --> Java --> Code Styles --> Code Templates.
You can customize comments and code components in this way at Eclipse level or project level.
Go to Window --> Properties --> Java --> Code Styles --> Code Templates.
You can customize comments and code components in this way at Eclipse level or project level.
Labels:
code template,
customize new file,
eclipse
Monday, January 30, 2012
hbm2ddl SchemaExport: You have an error in your SQL syntax near type=InnoDB
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB'
I used to create my MySQL DBs with ant and everything was working. Now, moving to maven and hbm2ddl I get this error.
After some searching it comes out that it's a problem of incompatibility between the MySQL Java connector (5.1) and the MySQL version (5.5) where type InnoDB was dropped and replaced with engine.
The solution is to change the MySQL dialect from org.hibernate.dialect.MySQLInnoDBDialect to org.hibernate.dialect.MySQL5InnoDBDialect.
Places where this generally occurs are hibernate.cfg.xml and hibernate.properties.
Tested on MySQL 5.5.22
Wednesday, November 09, 2011
Maven + Subversion Enabled Eclipse Java Project
Updated - Apr 2013
What I want for my Eclipse projects is to be Java projects, allow content revisions with Subversion and be managed by Maven.
This is what I need to do.
Eclipse version: Eclipse Juno
Subversion plugin: Subversive
Maven plugin: m2eclipse (m2e)
Support for Subversion and Maven is now integrated into Eclipse.
You can further configure Maven under Window --> Preferences --> Maven. In particular you can add an external Maven installation and change the location of the repository which defaults to the user's personal repository and not the global one.
What I want for my Eclipse projects is to be Java projects, allow content revisions with Subversion and be managed by Maven.
This is what I need to do.
Eclipse version: Eclipse Juno
Subversion plugin: Subversive
Maven plugin: m2eclipse (m2e)
Support for Subversion and Maven is now integrated into Eclipse.
- Choose Help --> Install new software --> Work with: Juno - http://download.eclipse.org/releases/juno.
- Expand collaboration and check the m2eclipse and Subversive packages. Install all required components.
- Add the Polarion update site: http://community.polarion.com/projects/subversive/download/eclipse/2.0/juno-site/ (see step 1 for details) and install the Subversive SVN Connectors and a connector of your choice (I use SVNKit 1.7.4)
- Create a new project (Checkout Maven projects from SCM). Choose svn as SCM URL and type the URL. If svn does not appear in the list, check the global configuration under Window --> Preferences --> Team --> SVN --> SVN Connector. The connector you just installed must appear on that list.
- Once the project has been created, you might have a Java-Maven project only. If that's the case, to connect it to the SVN repository, right click on the project's name, choose Team --> Share --> SVN and follow the instructions to conncet your project to the SVN source.
You can further configure Maven under Window --> Preferences --> Maven. In particular you can add an external Maven installation and change the location of the repository which defaults to the user's personal repository and not the global one.
Monday, October 24, 2011
Liferay: Error Registering Portlets
I got a problem when trying to undeploy a portlet on Liferay the standard way: removing the unzipped WAR in Tomcat's webapps/ dir and the cached information.
08:48:56,725 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for MyPortlet
It seemd like the portlet was somehow still in the page for Liferay and the message saying the portlet needed to be removed from the page did not show any buttons to do that. After a while I didn't have the message anymore but only an error page.
Some googling brought me on a page in the Liferay forum where they suggested to remove the portlet-api-2.0.jar from the lib/ directory of the WAR and redeploy it:
> zip -d MyPortlet.war /WEB-INF/lib/portlet-api-2.0.jar
It actually worked. Don't ask me why.
08:48:56,725 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for MyPortlet
It seemd like the portlet was somehow still in the page for Liferay and the message saying the portlet needed to be removed from the page did not show any buttons to do that. After a while I didn't have the message anymore but only an error page.
Some googling brought me on a page in the Liferay forum where they suggested to remove the portlet-api-2.0.jar from the lib/ directory of the WAR and redeploy it:
> zip -d MyPortlet.war /WEB-INF/lib/portlet-api-2.0.jar
It actually worked. Don't ask me why.
Monday, August 08, 2011
Batch Resize on Linux
Install imagemagick.
Now you can use mogrify.
Example: to resize to half the original size all the JPGs in a directory (keeping the aspect ratio of course):
> mogrify -resize 50% *.jpg
More here.
Now you can use mogrify.
Example: to resize to half the original size all the JPGs in a directory (keeping the aspect ratio of course):
> mogrify -resize 50% *.jpg
More here.
Labels:
graphics,
imagemagick,
linux,
mogrify,
resize
Eclipse Startup - Crash on Fedora 15
For some obscure reason, the Fedora 15-packaged Eclipse doesn't include JSP syntax highlighting and I could find no easy way to add it (conflicting dependencies prevent that). So I resorted to the original TAR-GZ distribution. The problem there is with the OpenJDK. My Eclipse simply crashes on startup.
What you need to do is tell Eclipse to use Sun's JDK.
Open the eclipse.ini and add the path to the Java executable:
-vm
/opt/java/jdk1.6.0/bin/java
right before the -vmargs option.
More here.
[UPDATE] - Oh, the reason for the crash is not openJDK. It's a bug in Fedora. To circumvent it do the following:
What you need to do is tell Eclipse to use Sun's JDK.
Open the eclipse.ini and add the path to the Java executable:
-vm
/opt/java/jdk1.6.0/bin/java
right before the -vmargs option.
More here.
[UPDATE] - Oh, the reason for the crash is not openJDK. It's a bug in Fedora. To circumvent it do the following:
- In Gnome3 the webkit library name changed to libwebkitgtk so you need to create one missing symbolic link: ln -s /usr/lib/libwebkitgtk-1.0.so.0 /usr/lib/libwebkit-1.0.so.2
- Add -Dorg.eclipse.swt.browser.UseWebKitGTK=true to the -vmargs options in eclipse.ini
Friday, July 01, 2011
Extracting Audio from Video or Stream
From AVI or other video formats:
> ffmpeg -i file_name.avi -ab 128 -ar 44100 file_name.mp3
From an online stream:
> ffmpeg -i URL_address -ab 128 -ar 44100 file_name.mp3
> man ffmpeg
> ffmpeg -i file_name.avi -ab 128 -ar 44100 file_name.mp3
From an online stream:
> ffmpeg -i URL_address -ab 128 -ar 44100 file_name.mp3
> man ffmpeg
Wednesday, June 15, 2011
Fedora 15: Old and New Alt-Tab Behavior
As of Fedora 14 (Gnome 2.32) the behavior of Alt-Tab was to cycle through all the windows of all the open applications in a virtual workspace.
Gnome 3 shipping with Fedora 15 behaves differently and probably more efficiently (time will tell.)
Alt-Tab now cycles through all open applications in all virtual workspaces. All the windows of an application are shown when that application is the selected one. You can move the mouse over one window and select it but you can't just use the keyboard to do that.
If you want to cycle through all the windows of the active (selected) application you need to use Alt-~ (or the button above Tab.)
Gnome 3 shipping with Fedora 15 behaves differently and probably more efficiently (time will tell.)
Alt-Tab now cycles through all open applications in all virtual workspaces. All the windows of an application are shown when that application is the selected one. You can move the mouse over one window and select it but you can't just use the keyboard to do that.
If you want to cycle through all the windows of the active (selected) application you need to use Alt-~ (or the button above Tab.)
Fedora 15: Add Back Shutdown Option
Gnome 3 by default won't show the shutdown button. To see it click on your name on the top bar and press Alt. The Suspend option will turn into Power off.
If you don't want to perform this extra step (updated after kind comment):
If you don't want to perform this extra step (updated after kind comment):
- Install: yum install gnome-shell-extensions-alternative-status-menu.
- Type Alt-F2 then gnome-tweak-tool
- Go to Shell Extensions --> Alternative Status Menu Extension and switch it to on
- Type Alt-F2 then r and enter (reloads the Gnome shell.)
- You're set! You have gained the Hibernate and Power off options now.
Fedora 15: Add Back Window Buttons
UPDATED on May 9, 2020
Gnome 3 default behavior suppresses all window buttons but the Close. If you want them back:
> gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"
or use: gnome-tweak-tool.
References:
Wednesday, December 22, 2010
Eclipse Error: "Import Cannot Be Resolved"
The imported class is there but Eclipse won't see it.
Try: Project --> Clean
Try: Project --> Clean
Thursday, November 25, 2010
Creating a SVN Repository
Create the repository
> svnadmin create svnrepo
> gedit svnrepo/conf/svnserve.conf
Enable the following lines:
anon-access = none
auth-access = write
password-db = passwd
> gedit svnrepo/conf/passwd
Edit/add user
Create project directory:
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project/trunk
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project/branches
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project/tags
Import the project:
> svn -m "Your comment" import /path-to-source/sample-project file:///path-to-svnrepo/svnrepo/sample-project/trunk
Prepare work location:
> mkdir sampleProject
> cd sampleProject
Local check out trunk of project (without the folder itself):
> svn co file:///data/svnrepo/sample-project/trunk/ .
Remote check out (using SVN + SSH protocols):
> svn co svn+ssh://user@host/path-to-svnrepo/svnrepo/sample-project/trunk/ .
Create user and group svn:
> useradd svn
Add group svn to your groups.
Change ownership of all files in svnrepo/db to svn:
> chown -r svn:svn *
Add write permissions to all files in svnrepo/db.
> svnadmin create svnrepo
> gedit svnrepo/conf/svnserve.conf
Enable the following lines:
anon-access = none
auth-access = write
password-db = passwd
> gedit svnrepo/conf/passwd
Edit/add user
Create project directory:
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project/trunk
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project/branches
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project/tags
Import the project:
> svn -m "Your comment" import /path-to-source/sample-project file:///path-to-svnrepo/svnrepo/sample-project/trunk
Prepare work location:
> mkdir sampleProject
> cd sampleProject
Local check out trunk of project (without the folder itself):
> svn co file:///data/svnrepo/sample-project/trunk/ .
Remote check out (using SVN + SSH protocols):
> svn co svn+ssh://user@host/path-to-svnrepo/svnrepo/sample-project/trunk/ .
Create user and group svn:
> useradd svn
Add group svn to your groups.
Change ownership of all files in svnrepo/db to svn:
> chown -r svn:svn *
Add write permissions to all files in svnrepo/db.
Monday, November 22, 2010
Microphone Not Working in Fedora 14
If your microphone is not working on your new installation, just try this. It worked for me:
- Go to System --> Preferences --> Sound
- Select the input tab
- Switch from the existing configured microphone (probably microphone 1) to another one (microphone 2)
- Close the application and everything should work ;-)
Friday, November 19, 2010
Spring Property Editor for an Enumeration with Localized Names
Problem statement:
while the setAsText() method does not:
This is because Spring implicitly uses the enumeration name for the value of your tag, not the translated name.
E.g. If you have a select tag, this is what Spring does for you:
It makes sense, of course...
- You use a property editor when you bind a nested Enumeration field of a form backing object.
- You have localized names for the values.
@Override
public String getAsText() {
if(getValue() == null) {
return null;
}
SurveyStatus status = (SurveyStatus)getValue();
return status.getTranslatedName();
}
while the setAsText() method does not:
@Override
public void setAsText(String surveyStatusStr) {
if (logger.isDebugEnabled()) {
logger.debug("Read string [" + surveyStatusStr + "] for the survey status field");
}
SurveyStatus status = null;
if (surveyStatusStr.compareTo(SurveyStatus.ACTIVE.toString()) == 0) {
status = SurveyStatus.ACTIVE;
}
else if (surveyStatusStr.compareTo(SurveyStatus.INACTIVE.toString()) == 0) {
status = SurveyStatus.INACTIVE;
}
setValue(status);
}
This is because Spring implicitly uses the enumeration name for the value of your tag, not the translated name.
E.g. If you have a select tag, this is what Spring does for you:
<option value="ACTIVE" ... >
It makes sense, of course...
Labels:
binding,
property editor,
spring framework
Wednesday, September 15, 2010
Grep Selected Files
You can use find and grep to search for a particular string (string_pattern) in a selection of files:
> find <dir> -name "<file_find_pattern>" -exec grep -H -n '<string_pattern>' {} \;
> find <dir> -name "<file_find_pattern>" -exec grep -H -n '<string_pattern>' {} \;
Thursday, September 09, 2010
Spring Open View In Session Pattern For Portlets
I needed to implement the Open Session In View pattern for a portlet using Spring (3 with annotations) and Hibernate.
This pattern allows lazily loaded objects to have access to the Hibernate Session for the entire processing of the render request despite the original transaction (associated to the portlet request) already being completed.
I.e. If you have One To Many associations, this allows you to load the Many side of the association in the same thread of the request where you loaded the One side.
What I needed to do is:
Add a WebRequestHandlerInterceptorAdapter interceptor wrapping the stantard OpenSessionInViewInterceptor to applicationContext.xml:
then add it to the DefaultAnnotationHandlerMapping in yourPortlet-portlet.xml:
This pattern allows lazily loaded objects to have access to the Hibernate Session for the entire processing of the render request despite the original transaction (associated to the portlet request) already being completed.
I.e. If you have One To Many associations, this allows you to load the Many side of the association in the same thread of the request where you loaded the One side.
What I needed to do is:
Add a WebRequestHandlerInterceptorAdapter interceptor wrapping the stantard OpenSessionInViewInterceptor to applicationContext.xml:
<bean name="openSessionInViewInterceptor"
class="org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter">
<constructor-arg>
<bean class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
</constructor-arg>
</bean>
then add it to the DefaultAnnotationHandlerMapping in yourPortlet-portlet.xml:
<bean id="annotationMapper"
class="org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="order" value="10" />
<property name="interceptors">
<list>
<ref bean="openSessionInViewInterceptor"/>
</list>
</property>
</bean>
Labels:
annotations,
hibernate,
open session in view,
spring framework
Wednesday, May 12, 2010
Fedora: Receiving Files Over a Bluetooth Connection
This post refers to receiving files from a phone to a computer over a Bluetooth connection.
Please refer to the official Fedora documentation for installation and initial configuration:
Then you have to enable the bluetooth file sharing service.
If you can't find the link to the application in Applications --> System Tools, then create the link yourself or launch the following command manually:
> gnome-file-share-properties&
Enable Receive Files over Bluetooth.
Go to your phone and send the file to your computer.
Please refer to the official Fedora documentation for installation and initial configuration:
Then you have to enable the bluetooth file sharing service.
If you can't find the link to the application in Applications --> System Tools, then create the link yourself or launch the following command manually:
> gnome-file-share-properties&
Enable Receive Files over Bluetooth.
Go to your phone and send the file to your computer.
Friday, April 16, 2010
Hibernate ManyToOne Association With Annotations
It took me a while to get rid of a:
ERROR org.hibernate.util.JDBCExceptionReporter -
Unknown column 'applicatio0_.domain_domainID' in 'field list'
on a simple many-to-one association.
I had an Application object with a Domain field where many Applications could have the same Domain (standard many-to-one association).
The annotations on the field were:
Class Domain started with:
Hibernate couldn't correctly map the domain ID until I added the JoinColumn annotation:
which in my opinion could be inferred from class Domain:
but it wasn't.
Always use JoinColumn.
ERROR org.hibernate.util.JDBCExceptionReporter -
Unknown column 'applicatio0_.domain_domainID' in 'field list'
on a simple many-to-one association.
I had an Application object with a Domain field where many Applications could have the same Domain (standard many-to-one association).
The annotations on the field were:
@ManyToOne(cascade = CascadeType.ALL)
public Domain getDomain() {
return domain;
}
Class Domain started with:
@Entity
@Table(name="domain")
public class Domain implements Serializable {
// DB name: domainID
private Long id;
private String name;
Hibernate couldn't correctly map the domain ID until I added the JoinColumn annotation:
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name="domainID")
public Domain getDomain() {
return domain;
}
which in my opinion could be inferred from class Domain:
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "domainID", unique = true,
updatable = false, nullable = false)
public Long getId() {
return this.id;
}
but it wasn't.
Always use JoinColumn.
Thursday, March 11, 2010
Creating a Movie from Images (Linux)
The short story at this time. These instructions refer to the creation of MPEG4 video from JPGs images on Linux.
You need mencoder, part of the mplayer software.
Type:
> mencoder mf://<PATH>/*.jpg -mf w=320:h=240:fps=12:type=jpg
-ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell
-oac copy -o output.avi
Where you should customize at least:
You need mencoder, part of the mplayer software.
Type:
> mencoder mf:/
-ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell
-oac copy -o output.avi
Where you should customize at least:
- <PATH>/
*.jpg is the path to the directory where your JPGs are. - w=320:h=240 is the image size.
- output.avi is the resulting file name
Monday, March 08, 2010
Eclipse: Copying Preferences To a New Workspace
When I create a new workspace in Eclipse what I want every time is to have all my preferences from the other workspaces, first of all the color preferences. There is no apparent option in Eclipse to do that. File --> Import --> Preferences won't do that. Maybe it's hidden somewhere else.
I found an easy way to do that: simply copy the settings directory to the new workspace.
Preferences are stored in each workspace in:
/.metadata/.plugins/org.eclipse.core.runtime/.settings
Shut down Eclipse.
Copy part or the entire contents of that directory to the corresponding directory of the new workspace (after you've created it, of course).
Restart and you're done!
I found an easy way to do that: simply copy the settings directory to the new workspace.
Preferences are stored in each workspace in:
Shut down Eclipse.
Copy part or the entire contents of that directory to the corresponding directory of the new workspace (after you've created it, of course).
Restart and you're done!
Monday, March 01, 2010
Turning a SVN Project into a SVN/Java Project
This will be needed for a Java project created with the type "from SVN source". It will not have a Java nature by default.
Add a Java nature to the project in .project:
Create the file .classpath with the JDK/JRE libraries (and optionally the default output directory):
This method is alternative to the one detailed here.
Add a Java nature to the project in .project:
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Create the file .classpath with the JDK/JRE libraries (and optionally the default output directory):
Then you might want to add to the classpath the libraries which could not be detected at creation time.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
This method is alternative to the one detailed here.
Eclipse: Hiding Internal JARs
If you need to hide all the internal libraries your project is using, you can do so from the Package Explorer:
- Choose the view menu
- Check Show referenced libraries node
Tuesday, July 28, 2009
Eclipse Losing Reference to JARs
I have this weird problem that every once in a while (especially upon checking in files to SVN/CVS but not limited to that situation) Eclipse will lose reference to class path JARs and start signalling errors everywhere in the code.
What I temporarily did to fix this was to remove a library directory from the [Project] Properties --> Java Build Path --> Source list of a project, save the properties, open them again and add it back in. Problem gone... for a while.
Now I'm trying something I read somewhere: start Eclipse with the -clean command line parameter.
I'll keep you posted...
Feb 2010 Update: with the current version of Eclipse I'm using (Eclipse Java EE IDE for Web Developers, Build id: 20100218-1602) this issue seems to be vanished.
What I temporarily did to fix this was to remove a library directory from the [Project] Properties --> Java Build Path --> Source list of a project, save the properties, open them again and add it back in. Problem gone... for a while.
Now I'm trying something I read somewhere: start Eclipse with the -clean command line parameter.
I'll keep you posted...
Feb 2010 Update: with the current version of Eclipse I'm using (Eclipse Java EE IDE for Web Developers, Build id: 20100218-1602) this issue seems to be vanished.
Wednesday, July 15, 2009
Booting Debian in Text Mode
# disabling login GUI (if not gdm replace with yours)
> update-rc.d -f gdm remove
# re-enabling
> update-rc.d -f gdm defaults
> update-rc.d -f gdm remove
# re-enabling
> update-rc.d -f gdm defaults
Friday, July 03, 2009
No Javadoc When Hovering Cursor Over Text in Eclipse
I had this weird problem that no javadoc preview showed up when hovering the cursor over java code in Eclipse.
Eclipse version: eclipse-java-ganymede-SR2-linux-gtk
OS: Linux (Fedora 11)
I didn't find out why it didn't work but I found out that it was specific to the version of Eclipse I was using.
When I upgraded to Eclipse Galileo (eclipse-java-galileo-linux-gtk), with exactly the same configuration files and preferences, it worked straight away.
I guess it was a bug of the Ganymede SR2 then...
Eclipse version: eclipse-java-ganymede-SR2-linux-gtk
OS: Linux (Fedora 11)
I didn't find out why it didn't work but I found out that it was specific to the version of Eclipse I was using.
When I upgraded to Eclipse Galileo (eclipse-java-galileo-linux-gtk), with exactly the same configuration files and preferences, it worked straight away.
I guess it was a bug of the Ganymede SR2 then...
Friday, June 12, 2009
Unable to Start Eclipse On An Empty Workspace
OS: Fedora 11
Eclipse Version: 3.4.2, Build id: M20090211-1700
If I try to initialize a new workspace (empty but with an existing directory), Eclipse will open as an empty non-killable window.
I was able to have a "dirty" initialization copying the .metadata directory of another workspace I had previously and mysteriously created to the new workspace.
I need to experiment a bit more to see if it's possible to, for example, just create the .metadata directory...
Eclipse Version: 3.4.2, Build id: M20090211-1700
If I try to initialize a new workspace (empty but with an existing directory), Eclipse will open as an empty non-killable window.
I was able to have a "dirty" initialization copying the .metadata directory of another workspace I had previously and mysteriously created to the new workspace.
I need to experiment a bit more to see if it's possible to, for example, just create the .metadata directory...
Thursday, June 11, 2009
rpmdb: PANIC: fatal region error detected
I had the following error when trying any yum operation on Fedora 11:
> yum update
Loaded plugins: refresh-packagekit
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30974) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30974)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in
yummain.user_main(sys.argv[1:], exit_code=True)
[...]
The googled ;-) solution that worked for me was:
> cd /var/lib/rpm
> rm -f __db.00*
> db_verify Packages
> rpm --rebuilddb
> yum update
Loaded plugins: refresh-packagekit
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30974) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30974)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in
yummain.user_main(sys.argv[1:], exit_code=True)
[...]
The googled ;-) solution that worked for me was:
> cd /var/lib/rpm
> rm -f __db.00*
> db_verify Packages
> rpm --rebuilddb
Thursday, May 28, 2009
Eclipse: Could not launch the product...
Eclipse crashed or in my case took too long to open a file and I had to shut it down in a not clean state (really surprised it didn't crash during my attempt AND I didn't have to kill it! Great job people@eclipse!).
Next thing that happens when I try to re-launch it using the same workspace is an error message:
You need to:
Next thing that happens when I try to re-launch it using the same workspace is an error message:
Could not launch the product because the associated workspace is currently in use by another Eclipse application
You need to:
- go to the workspace home directory
- enter the .metadata directory
- remove file .lock
Thursday, May 14, 2009
JUnit, log4j And Eclipse
If you want Eclipse to pick up your log4j configuration file when you run JUnit tests from within Eclipse you can:
If you want to configure all test classes with the same optoins... uhmm... stay tuned. I'll be back.
- Right-click on a test class.
- Select Run as --> Run configurations...
- Select the Classpath tab
- Select the home directory of you project and Advanced
- Then Add folder and add the folder with the configuration file and you're done.
If you want to configure all test classes with the same optoins... uhmm... stay tuned. I'll be back.
Wednesday, March 25, 2009
Fedora 10: Firefox Starts up in Offline Mode
The problem: upon strting Firefox it goes in offline mode even if the network is enabled and working. It's really unconvenient to un-check Work offline from the File menu every time especially if you start up many windows and tabs.
The quick solution is to stop and disable the Network manager application from the System --> Administration --> Services window.
Unless you need it... in that case I can't help you right now...
The quick solution is to stop and disable the Network manager application from the System --> Administration --> Services window.
Unless you need it... in that case I can't help you right now...
Friday, March 06, 2009
gedit Color Schemes
If you upgrade to Fedora 10 right now, the new version of gedit doesn't explicitly allow you to set up a custom color scheme. They say in the future there will be an editor for that.
In the meantime what you can do is:
In the meantime what you can do is:
- > cd /usr/share/
gtksourceview- 2.0/styles/ - Copy one of the available schemes to a new one and edit that file to suit your needs.
- Once you restart gedit, the new color scheme will be available under Edit -> Preferences -> Font & Colors
Thursday, January 29, 2009
Adding a Script to The Gimp (Linux/UNIX)
- Create an *.scm file with the script. To create a script you can follow this tutorial.
- It's recommended to keep them (scripts) in your personal settings. Enter your own gimp directory: ~/.gimp-2.6 or similar, the scripts sub-directory and copy the file there.
- The place in the menus it will be placed is set in the following command (usually a the end of the script): (script-fu-menu-register "script-fu-photo-scriptName" "
. This will place the script in the Script-Fu --> Photo menu./Script-Fu/Photo/") - Then you need to run Filters --> Script-Fu --> Refresh Scripts command.
Thursday, December 04, 2008
To-Haves When Using Eclipse (Java development)
- CloudGarden Jigloo: SWT/Swing GUI builder
- Tigris Subversion: SVN repositories management (Subclipse is one client for Eclipse)
Tuesday, December 02, 2008
Converting MPEG-4 to MP3
Instructions for Fedora Linux.
Install lame:
> yum install lame
Install FAAD.
You need to compile it. Instructions are in the README.linux file in the source package.
Then you can use this command:
>
References
Install lame:
> yum install lame
Install FAAD.
You need to compile it. Instructions are in the README.linux file in the source package.
Then you can use this command:
>
faad -o - "file.m4a" | lame - "file.mp3"
References
Monday, September 22, 2008
Ant unable to locate javadoc.exe
The situation: you're launching an Ant build file from within Eclipse on Windoz and the file has a Javadoc task. But Eclipse can't find the executable.
What you need to do is add the JDK bin directory to the PATH environment variable.
There is nothing to configure in Eclipse.
What you need to do is add the JDK bin directory to the PATH environment variable.
There is nothing to configure in Eclipse.
Tuesday, September 09, 2008
Configuring the Class Path When Testing in Eclipse
If you're testing from within Eclipse and are using Apache Commons Logging + log4j and you get the message:
log4j:WARN No appenders could be found for logger
you can let log4j know about the location of the log4j configuration file adding the directory where that file can be found this way:
Right click on the test class and choose Properties --> Run/Debug Settings
Select the file.
Click on Edit and select the Classpath tab.
Select the first item in User Entries, then Advanced, then Add Folders and you're done.
log4j:WARN No appenders could be found for logger
you can let log4j know about the location of the log4j configuration file adding the directory where that file can be found this way:
Right click on the test class and choose Properties --> Run/Debug Settings
Select the file.
Click on Edit and select the Classpath tab.
Select the first item in User Entries, then Advanced, then Add Folders and you're done.
Labels:
apache commons logging,
eclipse,
java,
log4j
Monday, August 25, 2008
Merging PDFs on Windows
First you need Ghostscript.
Then, you can just issue the command:
> gswin32 -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=merged_file.pdf -dBATCH file_1.pdf file_2.pdf file_3.pdf
What I noticed is that the text in the merged file is a little bigger than the original one at the same magnification although nothing is missing.
Maybe you/we need to tweak a bit with the parameters...
Then, you can just issue the command:
> gswin32 -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=merged_file.pdf -dBATCH file_1.pdf file_2.pdf file_3.pdf
What I noticed is that the text in the merged file is a little bigger than the original one at the same magnification although nothing is missing.
Maybe you/we need to tweak a bit with the parameters...
Sunday, August 24, 2008
Dual-boot With Grub After Installing Windows XP on a Linux Machine
Your situation: Windoz will boot but Linux is now invisible.
What you want is to have Grub installed on the Master Boot Record (MBR) of the first disk to pilot the boot sequence.
You need a Linux distribution CD/DVD with the rescue mode as an option. Any distribution is fine even if different from the one you have installed.
3. With fdisk -l you can check which partition holds the linux root partition (in case you forgot).
5. If your partition is, for example, /dev/sda2, then your value for n is 1 (Grub starts from 0)
Now you can exit the rescue shell and reboot. If you had a Grub configuration file configured to boot Linux and Windoz, you are done. You will be in the same exact position as before Winsoz zeroed Grub on the MBR.
If you didn't have Windoz before, you need to add to the Grub configuration file the Windoz entry:
title Windoz
root (hd0,m)
makeactive
chainloader +1
where m is the Windoz partition (Grub's way of course, see note above).
What you want is to have Grub installed on the Master Boot Record (MBR) of the first disk to pilot the boot sequence.
You need a Linux distribution CD/DVD with the rescue mode as an option. Any distribution is fine even if different from the one you have installed.
- Boot in rescue mode
- Once you have a shell type:
- > fdisk -l
- > grub
- grub> root (hd0, n)
- grub> setup (hd0)
- grub> quit
3. With fdisk -l you can check which partition holds the linux root partition (in case you forgot).
5. If your partition is, for example, /dev/sda2, then your value for n is 1 (Grub starts from 0)
Now you can exit the rescue shell and reboot. If you had a Grub configuration file configured to boot Linux and Windoz, you are done. You will be in the same exact position as before Winsoz zeroed Grub on the MBR.
If you didn't have Windoz before, you need to add to the Grub configuration file the Windoz entry:
title Windoz
root (hd0,m)
makeactive
chainloader +1
where m is the Windoz partition (Grub's way of course, see note above).
Sunday, July 27, 2008
Screen Capture With Mac Keyboard and Windows Desktop
The problem starts on the Mac keyboard: you don't have the prnscr key! But still what you have is a Windoz machine. What is working for me (there are external applications but I couldn't find a good free one) is to open the on-screen keyboard under Programs --> Accessories --> Accessibility. There you have it!
If you have the always-on-top option enabled, you loose control of the physical keyboard and sometimes I had to kill the virtual thing anyway to get back the other one. But I can live with that.
If you have the always-on-top option enabled, you loose control of the physical keyboard and sometimes I had to kill the virtual thing anyway to get back the other one. But I can live with that.
Thursday, July 17, 2008
gpk-application Not Working
I recently had this problem with the gpk-application on a Fedora 9. This Gnome application allows you to check what you have installed and install/remove packages.
The thing was I could not see the groups of packages and update the list from a remote machine. It happened I found out the cache was corrupted and this command:
> yum makecache
restored it to its full functionality.
Almost. I still cannot remotely refresh the list (which I could on the local display) but I think this is another story... permissions maybe.
The thing was I could not see the groups of packages and update the list from a remote machine. It happened I found out the cache was corrupted and this command:
> yum makecache
restored it to its full functionality.
Almost. I still cannot remotely refresh the list (which I could on the local display) but I think this is another story... permissions maybe.
Tuesday, July 15, 2008
Linux Graphical FTP Client
I recently switched to gFTP, the FTP client from Gnome, after I apparently encountered problems connecting to a couple sites with Kasablanca (from KDE). One was that the client could not display the content of a remote directory no matter what I did.
I must say that gFTP is more solid and it did not have those glitches. I personally recommend it at this time.
I must say that gFTP is more solid and it did not have those glitches. I personally recommend it at this time.
Wednesday, May 28, 2008
Linux Toolbox: pdftk
(from the man page) If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a simple tool for doing everyday things with PDF documents. Use it to:
> yum install pdftk
Note Unfortunately pdftk was removed from the Fedora repository due to a license issue that prevented it from being used in nuclear facilities. Yeah, right. Okay. Whatever!
You have to recompile it from the sources or... grab the final product from someone who already did it: Professor Kriehn's Fedora Repository!
- Merge PDF Documents
- Split PDF Pages into a New Document
- Rotate PDF Documents or Pages
- Decrypt Input as Necessary (Password Required)
- Encrypt Output as Desired
- Fill PDF Forms with X/FDF Data and/or Flatten Forms
- Generate FDF Data Stencil from PDF Forms
- Apply a Background Watermark or a Foreground Stamp
- Report PDF Metrics such as Metadata and Bookmarks
- Update PDF Metadata
- Attach Files to PDF Pages or the PDF Document
- Unpack PDF Attachments
- Burst a PDF Document into Single Pages
- Uncompress and Re-Compress Page Streams
- Repair Corrupted PDF (Where Possible)
> yum install pdftk
Note Unfortunately pdftk was removed from the Fedora repository due to a license issue that prevented it from being used in nuclear facilities. Yeah, right. Okay. Whatever!
You have to recompile it from the sources or... grab the final product from someone who already did it: Professor Kriehn's Fedora Repository!
Tuesday, May 27, 2008
Exporting the Graphical Display
If you need to open a graphical application on a Linux box A and see it on another one B (i.e. exporting the DISPLAY) there is one easy way if you log in from B to A with SSH:
> ssh -X -Y user@host.domain
Then you can start a graphical application on A from the remote session on B and see the output on B.
> ssh -X -Y user@host.domain
Then you can start a graphical application on A from the remote session on B and see the output on B.
Monday, May 12, 2008
Installing Linux on the Sony Vaio PCG FX-220
I bought this notebook in August 2001. I will never buy a Sony again despite the pros for the following reasons:
Installation
USB: working out of the box.
Useful Links
- Bad user support. If you have a problem, you have to pay to be able to speak with a Sony representative.
- A memory slot had a problem which prevented it to be used. This is a common issue ([1]) with this series and Sony did nothing to fix that.
- The CD/DVD reader broke in 2007 (I have a Fujitsu notebook from 1996 which is still perfectly working).
Installation
- You need the boot, root and network-drivers-1 diskettes.
- Start at the boot with: expert hw-detect/start_pcmcia=false
- After that, installation starts. It might hang (it did with me) but it's a network timeout problem. Retry with a different mirror.
- At the end of the installation, LILO and Grub won't install. Skip that step.
- To reboot, use the boot diskette with the following parameters: rescue root=/dev/hda1 (replace with your settings). Load the drivers, networks-drivers-1 and 2 diskettes this time (might not be necessary but it might save your time).
- Log in as root. Install Grub: apt-get install grub.
- Configure Grub automatically creating its configuration file.
- Reboot.
- Start in single user mode because the default X.org configuration file won't work.
- Edit the X.org configuration file manually removing all references to screen resolutions above 1024x768 and above 16bpp (TODO to be verified, 24bpp might work)
- Reboot.
- Check that the network parameters are correctly set.
USB: working out of the box.
Useful Links
Tuesday, May 06, 2008
Logitech Quickcam Pro 4000 on Linux
This post is about using a Logitech Quickcam Pro 4000 on Linux (Fedora 8) to store snapshots and producing a movie.
# Install xawtv (xawtv-3.95-7.fc8)
> yum install xawtv
# Install mencoder (mencoder-1.0-0.90.rc2.lvn8 from the livna repository)
> yum install mencoder
The xawtv package contains tools which allow you to connect to the webcam, grab pictures and videos on the fly and also produce movies from the snaps.
# Check that the webcam is recognized and broadcasting:
> xawtv -c /dev/video0 &
/dev/video0 : the device (use xawtv -hwscan to see which one it is for you)
# You can grab pictures in two ways with xawtv: using webcam or using streamer.
# grab snapshots using streamer
> streamer -c /dev/video0 -j 85 -t 1200 -r 0.03 -o office-0000.jpeg
/dev/video0 : the device
85 : JPEG quality
1200 : number of snapshots to grab
0.03 : frames per second (here it's about 1 snap every 30 seconds)
office-0000.jpeg : output file with counter to accomodate 4 digits here
# grap snapshots using webcam
> webcam webcam.conf
All configuration is read from file. My webcam.conf is:
[grab]
device = /dev/video0
text = Atlanta GA - %Y-%m-%d %H:%M:%S
#infofile = infofile.txt
fg_red = 255
fg_green = 255
fg_blue = 255
width = 320
height = 240
delay = 30
wait = 0
#input = camera
brightness = 100
#norm = pal
rotate = 0
top = 0
left = 5
bottom = -1
right = -1
quality = 85
trigger = 0
once = 0
archive = office-%Y%m%d-%H%M%S.jpg
TODO Explanation to follow...
# make movie using mencoder (you can also use streamer but I didn't try it yet)
> mencoder "mf://${CURR_DATE}/*.jpg" -msglevel all=-1 -mf fps=12:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:trell:mbd=2:dc=10 -oac copy -o "movie_${CURR_DATE}.avi"
... to be continued
# Install xawtv (xawtv-3.95-7.fc8)
> yum install xawtv
# Install mencoder (mencoder-1.0-0.90.rc2.lvn8 from the livna repository)
> yum install mencoder
The xawtv package contains tools which allow you to connect to the webcam, grab pictures and videos on the fly and also produce movies from the snaps.
# Check that the webcam is recognized and broadcasting:
> xawtv -c /dev/video0 &
/dev/video0 : the device (use xawtv -hwscan to see which one it is for you)
# You can grab pictures in two ways with xawtv: using webcam or using streamer.
# grab snapshots using streamer
> streamer -c /dev/video0 -j 85 -t 1200 -r 0.03 -o office-0000.jpeg
/dev/video0 : the device
85 : JPEG quality
1200 : number of snapshots to grab
0.03 : frames per second (here it's about 1 snap every 30 seconds)
office-0000.jpeg : output file with counter to accomodate 4 digits here
# grap snapshots using webcam
> webcam webcam.conf
All configuration is read from file. My webcam.conf is:
[grab]
device = /dev/video0
text = Atlanta GA - %Y-%m-%d %H:%M:%S
#infofile = infofile.txt
fg_red = 255
fg_green = 255
fg_blue = 255
width = 320
height = 240
delay = 30
wait = 0
#input = camera
brightness = 100
#norm = pal
rotate = 0
top = 0
left = 5
bottom = -1
right = -1
quality = 85
trigger = 0
once = 0
archive = office-%Y%m%d-%H%M%S.jpg
TODO Explanation to follow...
# make movie using mencoder (you can also use streamer but I didn't try it yet)
> mencoder "mf://${CURR_DATE}/*.jpg" -msglevel all=-1 -mf fps=12:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:trell:mbd=2:dc=10 -oac copy -o "movie_${CURR_DATE}.avi"
... to be continued
Labels:
linux,
logitech,
quickcam 4000 pro,
webcam,
xawtv
Wednesday, April 30, 2008
Fedora Extras @ livna
rpm.livna.org provides many useful packages that can not be distributed in Fedora (previously known as Fedora Core and Extras) for one reason or another, including multimedia applications.
rpm.livna.org is not a standalone repository, but an extension of Fedora, Fedora Core and Extras repositories.
To add livna Fedora 8 packages to your list of repositories:
> rpm -ihv http://rpm.livna.org/livna-release-8.rpm
rpm.livna.org is not a standalone repository, but an extension of Fedora, Fedora Core and Extras repositories.
To add livna Fedora 8 packages to your list of repositories:
> rpm -ihv http://rpm.livna.org/livna-release-8.rpm
Tuesday, April 29, 2008
Installing Xine on Fedora 8
This procedure details the installation using the available prepackaged RPMs. The trick is that they're not all in the same place!
Install the main xine libraries (available from the main Fedora repositories):
> yum install xine-lib
Grab the main package and dependencies from RPM Find [1] and RPM pbone.net [2]:
Install them directly with rpm to avoid the need of disabling yum's signature check:
> rpm -ihv libdvdcss-1.2.9-2.fc7.i386.rpm libfame-0.9.1-12.fc7.i386.rpm libmad-0.15.1b-4.fc7.i386.rpm vcdimager-0.7.23-7.fc8.i386.rpm xine-0.99.5-1.fc7.i386.rpm xine-lib-moles-1.1.11.1-1.fc8.i386.rpm
Another way is to add livna to your list of repositories and do a:
> yum install xine
Didn't try this though...
Install the main xine libraries (available from the main Fedora repositories):
> yum install xine-lib
Grab the main package and dependencies from RPM Find [1] and RPM pbone.net [2]:
- xine (xine-0.99.5-1.fc7.i386.rpm) [1]
- xine-lib-moles (xine-lib-moles-1.1.11.1-1.fc8.i386.rpm) [1]
- vcdimager (vcdimager-0.7.23-7.fc8.i386.rpm [2]
- libdvdcss (libdvdcss-1.2.9-2.fc7.i386.rpm) [1]
- libfame (libfame-0.9.1-12.fc7.i386.rpm) [1]
- libmad (libmad-0.15.1b-4.fc7.i386.rpm) [1]
Install them directly with rpm to avoid the need of disabling yum's signature check:
> rpm -ihv libdvdcss-1.2.9-2.fc7.i386.rpm libfame-0.9.1-12.fc7.i386.rpm libmad-0.15.1b-4.fc7.i386.rpm vcdimager-0.7.23-7.fc8.i386.rpm xine-0.99.5-1.fc7.i386.rpm xine-lib-moles-1.1.11.1-1.fc8.i386.rpm
Another way is to add livna to your list of repositories and do a:
> yum install xine
Didn't try this though...
Thursday, April 17, 2008
Java and Firefox 3 Beta 5 on Linux
This post is about configuring Java with Firefox 3 beta 5 on Linux i386. It might work for similar versions of Java and Firefox though.
The JRE coming with JSE v1.6.0_03 is currently not working. BUT the one coming with JSE v1.5.0_08 does work!
You just need to follow the usual instructions (which can be found here) and create a symbolic link the the Java plugin library:
> cd ${FIREFOX_HOME}/plugins
> ln -s ${JAVA_HOME}jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so
Restart Firefox and check at this URL: about:plugins if it's loaded and here if it works.
Note: Actually "works" is perhaps a little bit of an overstatement. I found out an applet which is supposed to update itself with streaming data and is not doing it. So maybe it's a matter of waiting on Firefox's final version...
On the other side Firefox 3 is much much faster and less memory consuming than Firefox 2.
The JRE coming with JSE v1.6.0_03 is currently not working. BUT the one coming with JSE v1.5.0_08 does work!
You just need to follow the usual instructions (which can be found here) and create a symbolic link the the Java plugin library:
> cd ${FIREFOX_HOME}/plugins
> ln -s ${JAVA_HOME}jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so
Restart Firefox and check at this URL: about:plugins if it's loaded and here if it works.
Note: Actually "works" is perhaps a little bit of an overstatement. I found out an applet which is supposed to update itself with streaming data and is not doing it. So maybe it's a matter of waiting on Firefox's final version...
On the other side Firefox 3 is much much faster and less memory consuming than Firefox 2.
Tuesday, March 18, 2008
Verifying Which Ports Are Listening
The most reliable way is to use a port scanner like nmap.
You can install nmap in a blink of an eye on a Red Hat system (Fedora included) with yum install nmap or rpm -ihv if you have the package or in many other ways lasting a little bit longer than the blink of an eye.
Then issue:
> nmap -sT -O localhost
Reference: Red Hat Linux Manual v9
You can install nmap in a blink of an eye on a Red Hat system (Fedora included) with yum install nmap or rpm -ihv
Then issue:
> nmap -sT -O localhost
Reference: Red Hat Linux Manual v9
Thursday, December 20, 2007
Enabling the CVS Id Tag for SVN
The CVS Id tag which adds file information on the file itself upon commit is enabled by default on CVS but not on SVN. To have it enabled you need to add/modify the following on your local SVN configuration file (on UN*X: <HOME>/.subversion/config):
[...]
enable-auto-props = yes
[...]
[auto-props]
[...]
*.java = svn:keywords=Author Date Id Revision;svn:eol-style=native
Complete list of keywords: Author, Date, Header, Id, Log, Locker, Name, RCSFile, Revision, Source, State.
Of course, you need to add a line for every file type you want to configure for a fine grained control over that. Otherwise use *.
This works for all files committed from now on. If you already have files in the repository, you need to tell SVN to add them too:
[...]
enable-auto-props = yes
[...]
[auto-props]
[...]
*.java = svn:keywords=Author Date Id Revision;svn:eol-style=native
Complete list of keywords: Author, Date, Header, Id, Log, Locker, Name, RCSFile, Revision, Source, State.
Of course, you need to add a line for every file type you want to configure for a fine grained control over that. Otherwise use *.
This works for all files committed from now on. If you already have files in the repository, you need to tell SVN to add them too:
# Make sure that everything is up to date
> svn up
# Add keywords and commit
> svn propset svn:keywords "Author Date Id Rev" file_name
> svn commit -m "Adding Id and Rev property to all files"
Friday, November 16, 2007
SVN Java Project With Eclipse
If you have your source code in a SVN repository and want to set up a Java project in Eclipse (tested on the Helios release), you cannot simply do a New --> Project --> SVN --> Checkout projects from SVN.
The resulting project will not be a Java project and you won't be able, for example, to set up the build path with all its implications...
This is the way to go:
The resulting project will not be a Java project and you won't be able, for example, to set up the build path with all its implications...
This is the way to go:
- Choose Window --> Open perspective --> SVN repository exploring, configure the repository.
- Open it and choose the trunk, a tag or a branch.
- Do a right-click and do a Find/Checkout As (e.g. as a Java project)
Monday, October 08, 2007
JSTL Taglib Declaration
This post is related to web application development with Spring 1.x, JSTL and Tomcat v5.5.x.
Be sure to have this configuration to be able to use JSTL:
web.xml header (remove space after <):
Taglib declaration:
Be sure to have this configuration to be able to use JSTL:
web.xml header (remove space after <):
< ?xml version="1.0" encoding="ISO-8859-1"?>
< xmlns="http://java.sun.com/xml/ns/j2ee"
xsi="http://www.w3.org/2001/XMLSchema-instance"
schemalocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
Taglib declaration:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
Thursday, August 23, 2007
Tomcat: Redirect all requests to port 80 on port 8080
... the IPTables way! (there are other solutions)
Configure the iptables behavior in file /etc/sysconfig/iptables-config to save the new rules
IPTABLES_SAVE_ON_STOP="yes"
IPTABLES_SAVE_ON_RESTART="yes"
IPTABLES_SAVE_COUNTER="yes"
Manually add the following rules:
Save and restart the service:
> /etc/init.d/iptables save
> /etc/init.d/iptables restart
Configure the iptables behavior in file /etc/sysconfig/iptables-config to save the new rules
IPTABLES_SAVE_ON_STOP="yes"
IPTABLES_SAVE_ON_RESTART="yes"
IPTABLES_SAVE_COUNTER="yes"
Manually add the following rules:
> iptables -t nat -A OUTPUT -d localhost -p tcp --dport 80
-j REDIRECT --to-ports 8080
> iptables -t nat -A OUTPUT -d <your_ip> -p tcp --dport 80
-j REDIRECT --to-ports 8080
> iptables -t nat -A PREROUTING -d <your_ip> -p tcp --dport 80
-j REDIRECT --to-ports 8080
Save and restart the service:
> /etc/init.d/iptables save
> /etc/init.d/iptables restart
Subscribe to:
Posts (Atom)
