Getting java JDK as a zip instead of exe

Sometimes you may need to have the java JDK available on your system without having to run the installer exe/msi for different reasons. This solution worked for me with JDK8u45, I haven’t tried it with other JDK versions so your mileage might vary.
Thanks to @Marc T for this solution.

create destination folder (c:\jdk8)
download JDK exe from Oracle
7zip -> unzip into destination folder
Open command prompt and enter cmd [cd c:\jdk8]
Enter this command to unpack the contents of the folder [for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar"]

VP8/9 vs h264/5 for personal videos

Recently I needed to encode some clips taken with my phone to a web optimized format since the videos were already in mp4 my initial thought was to keep them in mp4 format h264 video/AAC Audio.
First things first to get the videos to a web optimized format a re-encode would be needed so I had to accept that some drop in quality was going to happen. That was the easy part. A little googling and I found that libfdk_aac is the best AAC codec currently to use with ffmpeg, so I uninstalled my RPM installed ffmpeg and tried to compile my own. Getting sources for all the codecs I needed to have in my ffmpeg was pretty straight forward, but the build failed with some make error gcc was having issues building for the platform. This left me with 2 options wipe the OS fedora 20 and upgrade to the latest 21 or spin up a VM and use that to do the compile. The second option seemed like the way to go but I still wasn’t sold on the idea of having to do all this extra effort just to encode some phone clips.

During this thinking period when I was trying to get some time to go with option two I came across an article about vp9 and it hit me I was willing to jump through all this hoops to use a proprietary codec while there was a comparable opensource codec I could use with ffmpeg out of the box. So I re-installed ffmpeg from RPM spent about an hour tweaking some scripts to do the conversion and rotation of the clips.
Played back the newly encoded webm files and I could barely notice a difference with the original files, they were also 50% – 70% the size of the original files. Getting my video hosting application to work with webm files took about another hour as it was not on the list of supported extensions this was uprising since it’s an open source application.

Right now am feeling pretty happy with my choice as expected safari and IE don’t support webm so for those needing to watch the clips am just telling them to use Chrome or firefox. While the video hosting application allows me to share the clips with outsiders for my internal consumption of the clips I use Plex Media Server once they add support for webm to their native clients I will be converting the whole collection of clips from mp4 to webm.

Update: I received some feedback from family members and they are able to view the videos without a problem, so looks like I will be sticking with VP8/9.

Gnome Shell

I upgraded to Fedora 15 yesterday and I like gnome shell, sure it’s different to the old gnome but that’s why we upgrade software. I also like the fact that you can alt tab all the way to other workspaces nice!!. Personally I don’t miss the status bar and according to the word online, some features are already being added to Gnome3.2 which are missing currently, so for the first release this is pretty awesome work congrats Gnome team.
Personally the only thing I would like is for it to be easier to customize, but I see their is already an app Gnome Tweak Tool to help you customize your setup. The fact that the UI has moved away from all that windows like look is a great plus, this is Linux after all and we pride ourselves in being different.

p7zip Command Line

In CentOS to use p7zip  from command line the cmd is 7za and not p7zip or 7z, I wasted some time on this as most manuals online tell you to use p7zip [options] filename.

To extract a file you would do:

7za x filename.7z

You can substitute the .7z extension with whatever archive extension you are trying to xtract e.g tar,gz,zip etc as long as its an extension that can be handled by 7zip which should be most of the common formats.

Great Linux CMDs

In this post I will be making a list of great Linux cmd’s that I find all over the net one great place to stop by is commandlinefu.com they have a great deal of important linux cmd’s.

First cmd is mtr, it combines your ping and netstat cmd’s. In CentOS you have to su- to run this cmd:

mtr google.com

The following cmd I just started using recently and it has been a life saver I don’t know how I went all that time without it. The cmd is screen it works like your VNC or NX but for the terminal, it is especially handy if you SSH into your box but you don’t want to leave the terminal running waiting for a task to finish, you just start a screen run your cmd and detach from the screen. Now even if your connection gets disconnected or you disconnect yourself all you have to do when you connect again is run “screen -dR” and you are connected back to your earlier session and you can check on the progress of your task. To list screen instances “screen -ls”.

screen

Ctrl+a   ->pressing this twice moves to the next screen

Ctrl+a+c  ->adds a new screen to you screen instance

Ctrl+a+d ->detach from screen session

Ctrl+d  ->exit a screen

screen -dR   ->connect to/start a screen session

Mount a drive world writeable

mount -t ntfs-3g -o umask=000 /dev/drive /mnt/mountpoint

mount -t cifs -o umask=000,username=username,password=password //ipaddress/folder /mnt/mountpoint

by adding the option umask=000 any user can write to the mounted folder, this comes in handy when you want to write to a mounted drive as a regular user.  I have had a problem with some slack based distro’s not accepting this option in the current format and might need to play around with the mask cmd placement to see what works.

Update vs Clean Install

I just upgraded to CentOS 5.5 and while talking to a friend of mine we got into talking about updating vs clean install. After my update I had to restore to an image before the update as my mail system was not working, checked all packages contained in the update and zeroed the cause to a sendmail update. Which was disabling my current MTA “postfix”. I fixed that and another issue with my open office and I was ready to go. While my friend prefers to just do a clean install.

To me it just comes down to preference, if you have a heavily customized system it’s time saving to just do an upgrade, but if you are running a generic system with few modifications a clean install might be the best way for you.

Trying out new distros

The one good thing about Linux is the range of distributions available. Every few months I will load a new Distribution on my flash drive or make a Live cd and try it out. I am currently trying out Linux Mint and I like it, I would definitely recommend it for new users it comes loaded with most apps that you need day to day. It’s eye candy is one of the best I have checked out so far, I even loaded it onto one of my old boxes that am planning on donating.

Find and Identify Device ID’s

If you help fix people’s computers you will come across devices that windows will not have drivers for or you may be having problems downloading them from the machine manufacturer site, here is a quick way to go about it.

Go to Device Manager right click on unrecognised device there will be an exclamation mark on it click Properties ->Details and select Hardwae ID’s from the property drop down list. VID_ and VEN_ are used to identify vendors and PID_ and DEV_ identify Product ID. The HEX value following Product ID “PID_/DEV_” or Vendor ID “VID_/VEN_” is what you use in your search to identify the device.

Now go to pcidatabase.com enter your product or vendor id to such for your device.

Code 39

I was trying to work on a computer the other day, it would not recognize it’s DVD drive and switching with another dvd drive did not make a difference. The error message provided was
“Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)”

To solve this Code 39 error, follow these instructions:

1) Close all open programs

2) Click on Start, Run, and type REGEDIT and press Enter

3) Click on the plus signs (+) next to the following folders

  • HKEY_LOCAL_MACHINE
  • SYSTEM
  • CurrentControlSet
  • Control
  • Class
  • {4D36E965-E325-11CE-BFC1-08002BE10318}

4) This folder is the DVD/CD-ROM Drive Class Description in the registry. Look for any of the following names in the right hand column.

  • UpperFilters
  • LowerFilters
  • UpperFilters.bak
  • LowerFilters.bak

5) If  any of the above keys shown in step 4 are listed, right-click on them and choose Delete
6) After deleting the keys, close the Registry Editor
7) Reboot your computer
8) Open My Computer and check to see if your CD or DVD drives have returned. You may also want to open Device Manager and verify that the yellow exclamation and error code on the CD or DVD drive is gone.

I got this info at this site and they even tell you other things you can do with drive errors.

get Junit4 working on Centos5

Like most people I prefer to use centos supplied apps from their repos as it just makes keeping things updated easier. So I use the eclipse supplied by centos which does not have Junit4 if you would like to enable it here are the steps I followed:

1.Download eclipse from there site the .tar version

2.Extract folder org.junit4_4.5.0.v20090423 and file org.eclipse.jdt.junit4.runtime_1.1.0.v20090513-2000.jar and copy them to folder /usr/share/eclipse/plugins/ download file junit-4.1jar and place it in folder org.junit4_4.5.0.v20090423

3.Restart eclipse and you should be set. Happy Testing!!!!

NB: Depending on the eclipse version you download the numbers on the folders and files may be different, and incase the new versions require a different file than junit-4.1.jar eclispe will tell you the new version needed.

the Junit-4.1.jar I used is here or you can google it if you want.