Monday, November 28, 2011

Using wget on a virtual Linux machine to download files from a website

A colleague sent out an email today about using wget to download our latest builds.

We run on Macbook Pros and connect to a lot of virtual servers, whether it be Windows 2008 or Linux Enterprise machines.

Since files testing application environments need to be similar - if not identical - then we need to duplicate local environments to remote VM instances.

I've used wget in the past sparingly but will use it more since now I can download files directly on the command-line from our local Hudson build server.

Here's the command:

wget --no-check-certificate "path to file from http:// to file extension"

Note the --no-check-certificate. Since we connect to a build server that uses SSL and the certificate is self-signed we need to add that to make the copy work.

Cool stuff.

Monday, October 10, 2011

JMeter, BeanShell, and Portecle ( and Bouncy Castle)

Discovered a very cool feature to JMeter.

You can embed Java scripting into JMeter; specifically BeanShell Sampler. BeanShell Sampler uses the BeanShell scripting language, which, when used in JMeter - allows you to write Java inside JMeter for specialized test scripts you might need to run.

Since I do a lot of security testing I need to access more specialized cryptographic libraries when using JMeter. BeanShell Sampler allows me one way to do security testing.

Since security testing involves truststores and key stores, I could use keytool on the command line but I found out about Portecle and that allows me to create, update and delete truststores and associated keys/certs in an easier to use GUI tool.

JMeter: trustAnchors parameter must be non-empty

If you're doing security/cryptographic testing with Java - especially with JMeter - you might encounter errors in your testing where you might get a message similar to:

javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Searching Google gives you hints that you haven't defined your keystore or truststore correctly and it's coming up null when the test is run. This was the case for me too.

In regards to JMeter I had to check my script inside JMeter AND also the jmeter.properties and system.properties files under the bin directory.

Once I had successfully defined the cacerts file location I got past this error and was able to run my test.

Here is the snippet:

# Location of the truststore (trusted certificates)
javax.net.ssl.trustStore=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/cacerts

Monday, August 22, 2011

Fair Game - Brief review

Saw the movie Fair Game a few days ago.

I'd recommend it since it condenses the story-line, leading up to and through the first part of the Iraq war, of the major and sidelined players who were influential and non-influential, respectively, in the shaping of our eventual involvement in Iraq.

In some ways it's a movie of how the Bush administration shaped intelligence to suit their policy for invading Iraq, going against some formidable evidence that Saddam wasn't pursuing weapons of mass destruction; principally, that he was NOT buying Yellow Cake from Niger.

I really enjoyed the performances of Sean Penn and Naomi Watts.

Another notable thing about watching the Blu-ray was the background commentary done by the former CIA analyst Valeria Plame and her husband Joe Wilson. Usually, this is done by the director and actors but not the actual real-life people that the movie is about. That was an unexpected bonus; although they were limited in their comments due to possible liability and non-disclosure agreements they've been bound to.

Wednesday, August 17, 2011

Highlighting in Windows command window suspends running programs

I use the command window quite a bit in Windows and have noticed that with some Windows versions, highlighting requires you to explicitly choose Mark and then select the text while other command windows you left or right click and highlighting happens automatically.

Automatic highlighting seems to be easier to do in more recent of versions of Windows; especially Windows 2008 Server, R2.

At work, I almost always run our principal application through the Windows command prompt as Administrator.

The problem though is that I would highlight and cause our BATCH application to suspend, without me knowing that I was going into suspend mode.

And learned as of yesterday, to un-suspend, the user needs to hit the ESCAPE key or use the keystroke CTRL-C in the command window.

Monday, July 25, 2011

Planes, Trains, Automobiles (and buses)

Went to Chicago for 36 hours last weekend.

Besides a short trip in my car I used mass transit to get to and from my friend's wedding.

Here's the breakdown:

1) Drive to the Table Mesa Park and ride. Cost to leave car 48 hours > $2.00
2) Bus ride to downtown Denver on BX bus: free using Eco-pass (I worked for a few hours at my desk)
3) Bus ride to Denver International Airport (DIA) using the AF line: free using Eco-pass
4) Southwest flight from Denver airport to Midway airport: $219.xx
5) Bus ride on the 55 Garfield route close to my parent's apartment: $2.25 but only had $3.00 so paid $3.00 since no change given.
6) Walked to my parent's place. About 2 blocks from the bus stop.
7) First night of sleeping: free
8) Bus ride to train station in the afternoon: $2.25
9) Train ride using the red and brown line: bought a $5.00 transit card before getting on the train.
10) Time at wedding. Fun!
11) Return on bus line around midnight: free since part part of $5.00 transit card purchased earlier.
12) Bus ride on 55 Garfield line: also free since part of transfer using $5.00 transit card used earlier
13) Slept second night at parent's house: free
14) Bus ride using the 55 Garfield to airport: $2.25
15) Southwest flight back to Denver: part of airfare stated above
16) Bus ride back to park-n-ride where I had my car: free using Eco-pass card

Cost of using public parking and public transportation: less than $20.00 for a day and a half in the city.

Total cost of transportation: ~$232.00

I'd say using mass transit with a commuter card and transfers saved me quite a bit of money. If I had taken a taxi to the wedding it would have easily cost $60.00 to $80.00 dollars both ways.

Sunday, June 05, 2011

Celsius to Fahrenheit simplified

I was certainly taught Celsius Fahrenheit conversions in the past but would forget the actual conversion math.

What was needed was a better, simplified method to remember the comparison of the temperature grades by using a simple rule than trying to remember the math. Then learning a few data points on the Celsius scale would make it much simpler.

For me, a good first step would be to remember that every 10 degrees Celsius would be 18 degrees Fahrenheit.

Then I realized that I wanted to concentrate on every 10th degree Celsius: 10, 20, 30 and 40 degrees.

So for: 10 degrees Celsius it would be 50 degrees Fahrenheit.

20 degrees Celsius it would be 68 degrees Fahrenheit.

30 degrees Celsius it would be 86 degrees Fahrenheit.

40 degrees Celsius it would be 104 degrees Fahrenheit.

For me, this is easy to remember quite quick and fast.

Remember the KISS acronym.

Wednesday, April 06, 2011

Great quote from Kung Fu Panda

you are too concerned with what was and what will be. Yesterday is history, tomorrow is a mystery, today is a gift, that's why it's called the present

Need to reference a JAR for your app in Tomcat 6.x?

One way is to place the JAR in the lib directory and then add the reference to the shared.loader property.

For example:

shared.loader=C:\Apache\Tomcat\apache-tomcat-6.0.32-windows-x86\apache-tomcat-6.0.32\lib\.jar

That was it...

Tuesday, March 29, 2011

Don't forgot about iptables if certain ports are blocked

Sometimes you might encounter a internal network configuration setup by your local network admins where certain ports are blocked.

If you can't access a certain port though and the network admins say everything is open you might want to see what iptables is doing.

I'd forgotten that iptables can limit certain ports from being used if you're trying to access you're Linux server from another server.

Here were some command I had to use to stop iptables and permanently disable it - if I needed to reboot my Linux box:


1006 netstat -ln -A inet
1007 ifconfig
1008 iptables --list
1009 /etc/init.d/iptables stop
1010 iptables --list
1011 chkconfig --list
1012 chkconfig --list | grep iptables
1013 chkconfig --help
1014 chkconfig --level 2345 iptables off
1015 chkconfig --list | grep iptables
1016 history

Friday, February 25, 2011

ATDD with Cucumber

Did a day long session exploring Cucumber for Acceptance Test Driven Development.

Seems pretty cool so far.

Seems we'll be using feature files to create scenarios and then coding step files in Java using Selenium with tie ins to cuke4duke libraries.


Tuesday, January 25, 2011

brazier, brassserie and brassiere

Easy to confuse these words. Especially if you hear them with the novice ear.

brazier - container for fire

brasserie - literally, a brewery in French, but in actuality, a more informal restaurant. Some put restaurant, then bistro and then brasserie and finally cafe...

brassiere - bra in French

Forvo makes it easy to learn the ways to pronounce these words too.

Monday, January 24, 2011

Tomcat should not be confused with the Apache web server

If it's been awhile since you've been in the Apache tool space you may have wrapped up Apache into Tomcat.

They're still a separate product offering and NOT bundled together. Wikipedia even mentions it here.

If you're looking for httpd.conf and configure files, those only are for the Apache web server, NOT in Tomcat...

I used the Apache server for a lot of Perl programs I wrote in the late 90s and early 00s; especially when I first started at Sun and had to maintain some legacy Perl scripts.

While I was an intern at Sun, Tomcat had been introduced by one of Sun's engineers and I began using it (in addition to JRun) for hosting JSP/Servlet applications.

Wednesday, January 19, 2011

Agile

There's a few tenets to agile programming/development.
  • Customer satisfaction by rapid delivery of useful software
  • Welcome changing requirements, even late in development
  • Working software is delivered frequently (weeks rather than months)
  • Working software is the principal measure of progress
  • Sustainable development, able to maintain a constant pace
  • Close, daily cooperation between businesspeople and developers
  • Face-to-face conversation is the best form of communication (co-location)
  • Projects are built around motivated individuals, who should be trusted
  • Continuous attention to technical excellence and good design
  • Simplicity
  • Self-organizing teams
  • Regular adaptation to changing circumstances

Maybe it should be made into a rhyme like, "Jack be nimble, Jack be quick...," just for easier memorization of some of the tenets.

That rhyme could be updated for agile methodologies!

Tuesday, January 18, 2011

Shenanigans

Love the word shenanigans.

Maybe it means questionable goings-on with the understanding that whatever is going on can be treated with levity, irony and good sense of humor.

Seems to be a more popular word in my vocabulary these days :)

Exploring ELK (Elastic) Stack for hack-a-thon

At my current gig, our group finally got to do hack-a-thon week and I joined a team project that tied together a few of the technologies I&#...