Audio / Video tools

0 comments

I do a lot with audio and video editing and I wanted to share some of my favorite cross-platform tools with my readers:

Rip audio/video from a DVD: HandBrake. The latest version (0.9.4) is faster than previous versions and it can handle extraction of individual DVD chapters. Oh, did I mention it's free?

Convert video to DVD MPEG-2 format: Avidemux. This is an amazingly powerful tool. My only complaint is that the latest version removed the "Auto > DVD" wizard because it assumed the user community would create complicated scripts to perform the same functionality (or better). To date, I haven't found a suitable replacement script, so I've stayed on version 2.4.4. Also, since it's a Linux port, Windows users need to manually add the file extension when saving files ('.mpg' for DVD files). Yeah, it's free as well!

Convert problematic MKV files to MPEG: FFmpeg. A little background... Matroska (mkv) is one of the coolest audio/video containers around. It's extremely versatile and compact with excellent quality. However, it can be a little problematic (especially with audio sync issues). If you find a problematic mkv file (e.g. Knighty Knight Bugs) and Avidemux chokes on it, I recommend you convert the mkv file to mpeg using the free FFmpeg utility and then manipulate it with Avidemux. The FFmpeg command-line is below (thanks, jamos!):

ffmpeg.exe -i "C:\video.mkv" -vcodec mpeg2video -sameq -acodec copy -f vob -copyts -y "C:\video.mpg"

...more to come...

Mere Christianity

0 comments

"People often think of Christian morality as a kind of bargain on which God says, ‘If you keep a lot of rules I’ll reward you, and if you don’t I’ll do the other thing.’ I do not think that is the best way of looking at it. I would much rather say that every time you make a choice you are turning the central part of you, the part of you that chooses, into something a little different from what it was before. And taking your life as a whole, with all your innumerable choices, all your life long you are slowly turning this central thing either into a heavenly creature or into a hellish creature: either into a creature that is in harmony with God, and with other creatures, and with itself, or else into one that is in a state of war and hatred with God, and with its fellow-creatures, and with itself. To be the one kind of creature is heaven: that is, it is joy and peace and knowledge and power. To be the other means madness, horror, idiocy, rage, impotence, and eternal loneliness. Each of us at each moment is progressing to the one state or the other."

— C.S. Lewis, Mere Christianity

Liferay Portal v5, Glassfish v3, and Oracle

0 comments

There are a lot of guides for how to install Liferay Portal (1 2 3 4), but sadly, none of them work as advertised for installing Liferay Portal 5.2.3 on an existing Glassfish v3 Prelude application server, using an Oracle database, and configured as a Windows service. After much trial and error, I've come up with the following guide that may help others along the way:

Liferay Portal on Windows

Warning: If the Oracle driver .jar files are not designed for your JDK version, use the latest Oracle drivers that are designed for your JDK version (i.e. if you're using Oracle 10g with JDK 1.6, the ojdbc14.jar 10g driver doesn't support JDK 1.6, therefore use the 11g ojdbc6.jar driver, etc.) I found this when the "Control Panel > Portal > Settings" link displayed random binary data in my web browser and I received a com.liferay.portal.kernel.dao.orm.ORMException error in the log file.

Update: The Oracle database connection kept dropping overnight so in the GlassFish JDBC settings screen for the "LiferayPool" connection pool, I located the "Connection Validation" section and placed a check in the "Connection Validation - Required" and "On Any Failure - Close All Connections" checkboxes.

Update: After reading Sun's GlassFish optimization white paper, I've made the following updates to my configuration:

====================================================

In addition to user, password, and URL (mentioned in the PDF guide), you should also add the following to your JDBC additional properties:

Name=MaxStatements, Value=200
Name=ImplicitCachingEnabled, Value=true

====================================================

domain.xml (in {gf domain}\config folder) updated with the following:

Changed:
old: <jvm-options>-client</jvm-options>
new: <jvm-options>-server</jvm-options>

old: <http-listener id="http-listener-1" port="8080" address="0.0.0.0" default-virtual-server="server" server-name="" />
new: <http-listener id="http-listener-1" port="8080" address="0.0.0.0" default-virtual-server="server" server-name="" acceptor-threads="#" />   (where "#" refers to the number of cores on your machine or VM, e.g. "2" for a dual-core processor)

Added:
<jvm-options>-XX:+UseLargePages</jvm-options>
<jvm-options>-XX:LargePageSizeInBytes=#m</jvm-options>   (where "#" is 4 for Windows Server 2003+ 32-bit installations, 16 for Windows Server 2003+ 64-bit installations, and 256 for Solaris or Linux 64-bit installations) (note: if you get "object heap" log errors, you may need to reduce these values by half)

====================================================

default-web.xml (in {gf domain}\config folder) updated with the following:

old:
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>

new:
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>development</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>genStrAsCharArray</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>

====================================================

Firefox Secure

0 comments

It seems everyone has their own opinion on which browser is better or more secure. I'm not going to engage in that debate, but if you prefer Firefox (like I do), here are my favorite security add-ons:

ProfileSwitcher: This allows you to easily switch between Firefox profiles. Although it's not hosted on Mozilla's official Add-Ons site, it's by far the best profile manager out there. Another quirk: the author requires you to "right-click and save target as..." (ironically, an IE term) to download the xpi file, which you then have to manually open in Firefox (File > Open File...), but other than that the installation is a breeze. Why do you need need a profile switcher? Well, I'll be describing some cool add-ons below, but together they practically reduce the browser to a empty text-based shell (which is good for secure browsing). For times when you need to access the internet without all the security measures (a rare scenario), you can use this add-on to switch to a default installation of Firefox. For my purposes, I created a new profile called "Firefox Secure". When you run the new Firefox profile, you'll need to load the ProfileSwitcher add-on to it as well.

NoScript: This will essentially block any script from running in your browser. Scripts (such as JavaScript, Flash, XPI, etc.) can be used to install malware, drive-by downloads, pop-ups, and other security risks. NoScript allows you to selectively enable scripts so you can watch your YouTube videos without running the advertising scripts.

Flashblock: This blocks annoying Flash videos/ads from displaying in your browser and allows you to selectively enable them. This is helpful for sites with multiple Flash objects on the page but you only want to view one (NoScript is an all or nothing block so you first unblock the site with NoScript and then unblock the desired Flash file with Flashblock).

Adblock Plus: Removes ads and banners - a simple set and forget add-on that is incredibly powerful.

CookieSafe: A simple add-on to Manage and block cookies.

ImgLikeOpera: The internet can be a visually scarry place. Even "safe" sites occasionally have bad or annoying images. Although Adblock blocks many ads and banners, this add-on blocks all images by default and allows you to selectively enable them. It's also great for dial-up users who don't want to waste precious bandwidth.

Clear Private Data: A simple add-on to clear your browsing history, cache, etc. You can right-click anywhere on the page and select "Clear Private data..." or add the optional toolbar (View > Toolbars > Customize...)

Although there are more extreme add-ons (RefControl, User Agent Switcher, Torbutton, etc.), these are the ones I use the most often and would recommend for anyone serious about browsing securely.

P.S. For OS-level cleaning, I recommend CCleaner for Windows or BleachBit for Linux.

How to buy Windows 7 Professional for $30

1 comments

Although I'm not a big fan of Windows, many of my friends are, so I often get asked what version they should install and where the best deal is.

As to the first question, most experts agree that Windows 7 is the best of the modern Windows operating systems so I'll defer to their expert judgement on the matter.

As to the second question, you can legally purchase Windows 7 for $30 if you have a valid .edu email address.

Question: You say "Windows 7 Professional" but your provided link is for "Windows 7 Home Premium"

Answer: See FAQ #2. After you provide a valid .edu email address and receive your confirmation link, you will be taken to the purchase page. On that page, you will find a section that says "Need to join your school’s network domain? You can also get Windows 7 Professional for $29.99 Click here" When you click on that link, a popup will appear to purchase Windows 7 Professional for the same price (sweet!):



Question: What if I'm not currently a student but I have graduated from a college or university in the past?

Answer: Most colleges and universities offer "alumni" email address aliases. These are email adresses with your school's .edu domain but they redirect email to your regular email account (gmail, msn, etc). For example, see Harvard's program. Just Google for your school and add "alumni email address" or "alumni email alias" in your search. Sign up for an alumni email alias and use that to register for your copy of Windows.

Question: What if I'm not a student, never was a student, don't know a student, am homeless with a laptop and I recently received a revelation that if I don't load Windows 7 on my laptop the world will end in 7 days?

Answer: Sounds like you have issues and I pity you. However, this situation intrigues me and from a purely academic, hypothetical, I-don't-recommend-this-approach point of view, here's an option:

Morehouse College is essentially giving away alumni email addresses. From their public alumni page:

...Use your temporary username (first name [dot] last name and class year @alumni.morehouse.edu -- for example: john.doe97@alumni.morehouse.edu) and password (p@ssw0rd -- the "0" is a zero) to login...

A 3-second Google search brought up this page with the following excerpt:
...In the fall of 2003, Oluwabusayo "Tope" Folarin, class of 2004, was named the College’s third Rhodes Scholar...

So I have a first name, last name, and class year. Hmmm... What would happen if I browsed to http://exchangelabs.com/, put in username Oluwabusayo.Folarin04@alumni.morehouse.edu and password p@ssw0rd?

What do you know... I'm prompted to create an email account! If I put in bogus data (note: zip code needs to be valid for bogus State you provide) and a bogus birth year (i.e. 1970), I'm redirected to an inbox.

Using the Windows 7 purchase link mentioned above, I use Oluwabusayo.Folarin04@alumni.morehouse.edu to have an email sent to the inbox with a purchase link. Thanks, Tope!

Question: Why don't you recommend this approach?

Answer: Because assuming someone else's identity is a bad thing.

Question: Then why did you put this on your blog?

Answer: Because I want to highlight this security issue to school officials, such as Morehouse and many others, that only require a name and class year for email accounts or aliases.