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:
  1. Open Windows explorer and type: shell:sendto in the text field.
  2. Create a link, ehm shortcut for the program you plan to add in some place (directory, desktop).
  3. Cut and paste it into the Windows explorer directory.
  4. You're done! 
Updated for Windows 10 in May 2016.

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

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 tip

That 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:
  • Right-click on the project --> Validate
  • Project --> Clean
  • Close and re-open it
What worked for me is: select them all, right-click and delete them.
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:
  1. Go to Settings --> Storage
  2. Open the menu on the top left corner and select USB computer connection
  3. Choose Media device
It will immediately appear :-)
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
Link to the original post.

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.

Saturday, May 25, 2013

Configure Sun's Java Plugin for Firefox

  1. Install the JRE or JDK as RPM or in your favorite location;
  2. Open a shell and go to: ~/.mozilla
  3. 64-bit platform: create the link: ln -s /opt/java/jdk1.7/jre/lib/amd64/libnpjp2.so . (the dot stands for the current directory)
  4. 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.

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.

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.)
  1. Make sure you installed a Git plugin like EGit.
  2. Click on File --> Import --> Git --> Projects from Git
  3. Then follow the instructions...
  4. Specify a URI for the repository source. This will end with a file.git.
  5. Select a branch.
  6. Local destination (<Git's_local_repository>/<project_name>)
  7. Select Import existing project.
  8. Select create Java project.
  9. Select Use custom location. This should be the local Git repository location.
  10. 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...

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

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...

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:

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.

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.

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:
  1. Open your sound settings and check the proper  device is enabled.
  2. 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.
  3. Run arecord -D "hw:1,0,0" -f cd -d 4 test-mic.wav. The wav file created should have sound in it.
More details on this thread.

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:
  1. Launch the gnome-tweak-tool
  2. Go to the "Shell" menu
  3. Enable "Show date in clock"