All Things Techie With Huge, Unstructured, Intuitive Leaps

A Whole Bunch of MySQL Stuff

Had a major event today on our server.  MySQL took the server down.  It was the daemon mysqld.  It started to spike the memory, which started the system to page furiously and then we had a kernel dump.  Went to /var/log/messages and grepped for “memory” and saw that UID27 reported out of memory as part of the crash output.  The message was

 [ERROR] /usr/share/mysqld: Out of memory (Needed xxx bytes)

So what to do?  Obviously we didn't have enough RAM allocation.  I use entirely an innodb engine with mysql.  So I had to find where mysql was getting its configs from.

From the server console, I typed in:

mysql --help

and among all of the stuff that was returned, it told me where to look for the config file.  It said:

Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf

So I went to /etc/my.cnf and used the vi editor.  I added

innodb_buffer_pool_size = 1000M

I added it under [mysqld].  We have 4 Gigs of RAM and the allowable value is up to 80% of the RAM.  Previous to this it was 16M.

Then I stopped the database by issuing the following command:

/etc/init.d/mysqld stop

No issues.

To start it, I issued

/etc/init.d/mysqld start

and it failed.  This is what it said:

[root@ap1 etc]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]

Well, went back to /etc/my.cnf and I noticed that I had forgotten the "i" in the innodb_buffer_pool_size.  I added that, and it started.

I gotta tell you, the application now screams!!  I should have done a RAM allocation earlier.

Making Effective Online Ads

Everybody sells at one time or another. We sell ourselves to our dates. We sell ourselves to our prospective employers. We sell stuff on the internet. There is a lot of clutter out there, and when we have something to sell, we must get ourselves to stand out above the clutter.

If you have to create an ad, or a webpage or any online presence, then this eBook is for you. It is the Top Secrets of the Admasters. It teaches you how to make the most effective online ads and web pages. It tells how to make ads that people cannot resist clicking on.

The psychology and layout of an online presence is important. This book show you how to use color, subject matter, trusted colors, the 9 elements that your ad must have and other helpful tips to rise above the noise and get noticed on the web.

Buy it here on Amazon Kindle:

Major UIX Tip -- It's Black and White

If you ware a regular reader of this blog, you know that I have several blogs, and I am constantly experimenting with them as to optimal design to generate the most hits, the greatest user experience and the best UIX or user interface experience.

I decided to experiment with stickability -- how long visitors to the site would stick around for content other than that what brought them there in the first place.  I took two relatively popular blogs, and had one with a black background and one with a white background.

The white background blog continuously outperformed the black one.  After a month, I switched it.  The one that was previously black and now white, suddenly became popular again with more hits.

No one needs more black and white evidence than this.  I had previously opined that a black background on a mobile device acts like a mirror, and that a white background was better.  That was a subjective feeling before.  It appears that it is also an empirical observation now.

New Revenue Stream for Photoshop Gurus

Self publishing on Amazon with eBooks is now a big thing.

I was reading an online forum for that topic and the author of the above book idly wondered online as to whether Brits hated her because she wasn't getting sales in the UK.  Her book had a cover of the heroine in a bar scene that was drawn for the cover.

I opined that perhaps the UK reader had cultural anomalies that made them hard to identify with the American bar scene.  The author replied that she was considering changing the cover.

It occurred to me that a photoshop person could make some serious cash by doing covers for authors.  Then I discovered that they were.  There was some guy selling stock photos for $20 with the title and author added with the photoshop text tools.  Others were selling covers for up to $299 per cover.  Photoshop gurus, here is another revenue stream for you.

A real graphics designer with a creative flair could probably make more money doing covers than the authors were making writing the books.

Just as an exercise tonight, I idly wondered how I would re-design the cover of Ms. Alroc's book called "Strangely Sober".  Knowing that sex sells, I photoshopped the above cover just as an exercise.  Ms. Alroc didn't ask for this and is unaware that I am doing this.  I just did it to see how my design effort would turn out.  I will certainly notify her that I have done this, and I will remove it if she requests it.

And if you are a Kindle reader, please buy her book:


How to split a .war file or a .zip file

I had a problem.  I remotely manage some coders 800 miles away.  I am getting them up to speed with j2ee, jsps, java, pojos and such.  I needed to get a .war file to them to deploy on a test server.

I used Eclipse to make my war, and when I went to send it to them, the size of the file was 34 megabytes.  I am only allowed 25 megabytes with my email program as an attachment.

What makes a war file big, are the jars in the lib directory.  I could have pulled them out and sent them separately, but my programmers are junior programmers and I wanted a no-muss, no fuss solution.  I needed a free file splitter.

So I went to and downloaded FreeFileSplitter.  I broke my war file into 18 mb chunks, and sent my guys two emails each with a chunk attached.

They downloaded FreeFileSplitter on their end.  It doesn't even have an installer.  It is just a very small binary that sits on the desktop.  They joined the two chunks together and deployed the war.

Thanks very much to FreeFileSplitter.  It works like a charm.  It will split and reassemble any kind of file including zip and media files.

How To Prevent Hack Attacks and Cyber Attacks From Iran

I just read that American Banks and other companies are under cyber attack sponsored by the government of Iran.

If I were the CIO, CTO or the IT management type responsible for American banks, financial institutions, energy companies, or major (and not-so-major) corporations, I would call in my network administrators and system administrators and have them write firewall rules blocking everything from Iran. If there is an economic embargo, there should be an internet embargo as well.

As a public service, here is a list of IP addresses to write the firewall wall rules preventing any access at all from Iran.

 Major IP Address Blocks For Iran

From IPTo IPTotal IPsAssign DateOwner Research Organization for Science & Technology IRAN Audio Visual Company (Islamic Republic of Iran Broadcasting) Danesh Golestan Networks & Beyond Networks & Beyond Network Solutions Institute Of Petroleum Industry Technology Company (ITC) co. Rayaneh Sepehr Ettelarasan Tehran Group Sepehr Ettelarasan Tehran Inc. System Company of Tehran Informatic Center Rayaneh Technology Company (ITC) Etela Resan Company Ltd Resaneh Resaneh Audio Visual Company Ettela Resaan Sepehr University Of Technology University Of Technology Internet Engineering, Inc Internet Engineering, Inc Online Network Solutions Investment Group. Consultants Rasana Tadbir Kavir Yazd Cooperative Rasana Tadbir Communication Development Co. Ltd Technology Company (ITC) co. Resaneh Audio Visual Company Rayaneh SABZ KHAZAR CO. P.J.S. Gostar Saba Data Transfer Company Private Joint Stock Group Resaneh Online Internet Engineering, Inc Investment Group. Net Company Ltd. Rasaneh Pars Networks & Beyond Company Ltd Dena Etela Resan Company Ltd Negar Parsian Etela Resan Company Ltd Internet Engineering, Inc Rasana Tadbir Investment Group. Group Net-e Aria System Tabriz Engineering Company Net Company Ltd. amin ertebat Rahe Talaie Enteghal Dadeha of Tehran Informatic Center Negar Parsian co. Rasaneh Pars Gostar Spadana Gostar Saba Data Transfer Company Private Joint Stock Technology Company (ITC) Azma Company Ltd Ettelaaat Dibagaran Karaj Co. Ltd. Esfahan Net Azma Company Ltd Network Solutions System Tabriz Engineering Company Research Organization for Science & Technology Research Organization for Science & Technology Research Organization for Science & Technology Sepehr Ettelarasan Tehran Internet Engineering, Inc Online University Of Technology Consultants Networks Rayaneh Rayaneh Rayaneh Consultants Iranian Oil Company Technology Company (ITC)

Come to think of it, I should do this with China too.  It is ironic that the minute that I deploy a new server, I start getting clever scripted hack attacks from institutions in China, like the meteorological institute.  I think that firewall blocking from unfriendlies, should be the first step in protecting your digital assets.


Buddha of the Binaries ~ Zen of Software Development~ Noble Truth #3

Oh Buddhist of the Binaries, I desire more lessons, what is the third noble truth?

Well my little code monkey with the red ass,  the third noble truth is that bugs in software  can be overcome and apps become killer and happiness can be attained; that true happiness and contentment are possible. lf we give up useless kiddie scripting and learn to code Java classes and jsps each day at a time (not dwelling in the past or the imagined future) then we can become happy and free. We then have more time and energy to help take our company viral. This is Nirvana.

One must learn to write elegant, simple profound code that supplies a desired need among the software addicts of the world.  Your code must become the crack cocaine of the mobile device.

For the other lessons, click HERE (and send money!)

How To Resize and Rename Photos

I had a problem.  I had to send a kajillion pictures to a person.  They were taken with a high resolution setting on the camera.  All of the photos were too large to be sent by email.

Usually when I have just a few, I open them in GIMP and resize the image.  This was a whole folder full of photos.

I searched the web for a free resizer and PhotoResize400.exe came up.  I gave it the college try.  I downloaded it from here:  and to my surprise, it wasn't zipped or anything.  The binary executable loaded directly onto the desktop.

I then separated out the pics that I wanted into a new folder on the desktop.  Then I closed the folder, grabbed it by selecting it, and drag and dropped it on the PhotoResize400.exe icon.  As quick as you could say "Gee I wonder if this works|, it was done.  I took a peek inside the folder, and sure enough it was done.

It preserved the original pics, and next to it, made a newer smaller version labeled -400.jpg.  (If the original pic was name 100234.jpg, it renamed it to 100234-400.jpg).  So now, it was a pain in the rear to separate them.  I decided to use DOS to do it.

I opened a RUN command shell and changed directory (cd command) to my desktop.  Then I did a directory listing (dir).  All of the photos were name September12-00x.jpg and the smaller ones were named September12-00x-400.jpg.

To separate them out so that the listing would group the smaller ones together, I had to do a DOS rename. It was easy as pie.  I typed in rename September12*-400.jpg  resized*.jpg in the cmd window.

What this did was rename the September12-00x-400.jpg to resized-00x-400.jpg.  The 00x was an incremental number (01, 02,03) so the numbering was preserved, it just took out the September12 prefix, because even the big ones (unresized) started with that prefix and they were a pain to separate.  Now all of the unresized ones started with September12 and all of the small ones started with resized.  When you did a directory listing or explored the folder, they were all neatly grouped into large and small by name.

As a product review, I fully recommend PhotoResize400.exe.  The photos are a little small for my liking, but it let me send a whole pile through the email.

Anonymous Email? What is the Best?

I was idly wondering about sending an anonymous email, so I plugged the term into good old Google.  The first site that came up was:

I have a couple of throwaway email accounts (everyone should have a couple of them that cannot be tied to you) and send two from that page.  That was 5 hours ago.  No email has arrived at any of my email boxes from them.  Things that make you go hmmmmm.

Then I ended up at:

Well, within 20 minutes the test email arrived.  So I would say that is the best out of the two.

When the email arrived, it said that it was from Free Email Service and the return address was:

That works for me.

Then I got to thinking ...........  ..............

suppose that I was an intelligence agency, FBI, law enforcement, private investigator, criminal, blackmailer or a news organization.  I would set up one of these things to collect information and see what comes in.

That thought was enough to scare the crap out of me.  Its now back to sending emails from a Linux command line for me.

Update:  It is now 16 hours and the emails from still have not yet arrived.  This service is definitely not to be relied on.

Update II - I think that is a scam.  My test emails still haven't arrived a full day and a half later, and they probably never will.

java.sql.SQLException: After end of result set

I had to google this exception thrown because I had never encountered it before:

java.sql.SQLException: After end of result set

It turns out that I had called ResultSet twice.  The second time it was after the end of it.  It was a careless dumb coding error.

Simple yet dumb error.   Hope this helps.

Thread: Too many open files

Running my tomcat app on a Centos machine.  I looked at the logs and saw this error:

Thread: Too many open files

Bummer.  I opened up a putty ssh to the server and did an su to superuser.  I wanted to see what the hard limit was for open file handles

I typed in at the bash#    ulimit -Hn and the return value was 1024,  Not good.

I issued the command to up the hard limit to 10000.  The command was ulimit -Hn 10000.

The soft limit was 1024 as well.  I upped the soft limit to 5000 with the command:  ulimit -Sn 5000

From what I could gather, this problem started happening when I initiated a log4j logger and we started getting decent traffic.

Hope this helps.

Java - How to make an arraylist of arraylists

I had to make an arraylist of arraylists.  The reason that I was doing this, was that I had to eliminate duplicates from a resultset.  The easiest way to do this was to put the resultset into an arraylist so that I could operate on it, because you can't iterate or use a resultset twice in Java.

Here are a few examples of the constructors to make an arraylist of arraylists:

   ArrayList<ArrayList<Object>> allData = new ArrayList<ArrayList<Object>>();

 ArrayList<ArrayList<String>> allString = new ArrayList<ArrayList<String>>();

 ArrayList<ArrayList<int>> allInts = new ArrayList<ArrayList<int>>();

Easy once you know how.

CNN Website Error

(click for larger image)

This has all happened to us at one time or another.  We have deployed a website and have forgotten to validate the tags.  When we visit the website live, we find the above junk printed.  It is actually the tag code that wasn't interpreted but rather rendered as text due to a missing element.

One of the easiest ways to avoid website validation errors is to go to the following URL:

and enter the URL.  It will identify any tag errors.

I am just amazed that a large organization like CNN who lives and dies by their online presence would make such newbie mistakes.

Java String MySQL Error

I just spent an hour banging my head against a wall.  I constructed a mysql query string from variables.  So my string construct would look like this:
String quality = "Very Good";

String queryString = "Select  * from products where consumer_rating=" + quality;

The thing kept bombing.  It said that I had an sql error near where consumer_rating=Very Good.

It all looked kosher.  I had forgotten that a string value needs single quotes.

In other words, I should have declared quality =" 'Very Good' ";

Notice the single quotes after the double quotes.  Necessary for an sql statement for string injection.

Hope this helps someone save some time.