AWStats LogFormat and nginx log_format

To parse nginx logs using AWStats – their log formats need to match.

My setup is like this:

  1. nginx log_format (specified in nginx.conf file):
    log_format      main  '$remote_addr - $remote_user [$time_local] $request "$status" $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for" "$document_root
  2. AWStats LogFormat (specified in your domain configuration file):
    LogFormat = "%host %other %other %time1 %method %url %other %code %bytesd %refererquot %uaquot %otherquot %otherquot"

Hope it helps :)

The 10.000 $ tablet – why isn’t one out yet ?

All big tablet producers are now fighting over what to do with their old models ?

They can’t afford to upgrade them – since the teams must focus on the new developments to keep up with the competition.
They can’t afford to sell them cheap – since they want profit out of them.
Since they still have to come up with new models, the newer models will be even higher priced that the old ones.

So when will the 1.000$ barrier will be broken ? When will be the 10.000$ ones ?

Still I did not hear of tablets that have SDCARD / USB Host / GSM etc… I understand its more profitable to force people to buy at a higher price from the producer, than to give them freedom to choose whatever they want.
But this will stop eventually since people will realize that they not necessarily want A TABLET, but the latest model, with the newest updates. So what will happen with the old tablets ?

Now the question, why will you buy something that won’t receive full updates for it’s assumed lifetime (2-3 years let’s say), that doesn’t gives you the versatility you want ? And one that in 3 months is already out of date ?

Maybe somebody has to assume the responsibility of making something perfect, upgrade-able, maintained for many years – with all the standard connection ports (no vendor lock-in), something that doesn’t ask your personal details – and sell it at the correct price ?

Hopefully somebody will realize also that it’s easier to fit a touch screen onto a mini notebook with a beefed up battery. Frankly I like to have control over the OS and have keyboard, than to enjoy the mini OSes on tablets now that are support only for the browser and some apps.

Corsair V64GB2 tested in Ubuntu 11.04

I’ve just booted up Ubuntu 11.04 and decided to give it a go and test the new Corsair SSD V64GB2 that I’ve installed on my Acer 3410 Laptop.

Results are IMPRESSIVE:

Screenshot-64 GB Solid-State Disk (ATA Corsair CSSD-V64GB2) – Benchmark

Screenshot-64 GB Solid-State Disk (ATA Corsair CSSD-V64GB2) – Benchmark

Look at the constant speed (around 245Mb/s and at the flat and stable read times).

And yes, I will never buy a SATA disk again :)

Giada N10 Nettop, Intel Atom 330, Review

I’ve just bought up a Giada Slim-N10. Nobody endured to buy it and for more than half an year I watched it on display. I decided to take the plunge and have it.

I’ll post few screenshots below, but shortly, I’m impressed. Such a small package, decent price, decent performance and based on the few tests below, even better an Acer 3410 (Celeron @ 1.2Ghz) laptop.

CPU-ID:

Super-PI:

Super-PI results surprised me. Even if the whole thing seems snappy enough (Windows 7 64bit), the time 3m27s seems way slower than 1m44s that a Celeron 723 ( http://hex.ro/wp/blog/acer-as3410-723g-celeron-723/ ) was producing.

The Windows Experience Index is however 3.3 which is better than the laptop above. Hard disk and Video performance make a lot of difference it seems:

Finally, the hard disk speed (Tests ran with HdTach, in Windows XP Compatibility mode):

Again, the results are better than the Acer 3410 laptop that I’m comparing it against. In the Acer’s case, the hard disk ends somewhere around 40Mb/s transfer speed, while for Giada N10, they end at around 55Mb/s transfer speed.

I cannot actually compare them both. Acer cost (when I bought it) 330 euros with reduction from 380. So for 100 euros more I got Windows Home pre-installed, 13’3 inch screen, keyboard, faster CPU in SuperPI and 1Gb of RAM more. Both can do 720p on Youtube. On the downside, I can’t really play many things on the laptop … the video board is better on Giada.

I say I like the package, it’s small, it fits behind a big TV.

In the future I will be tempted to use these type of PCs – they seem cheap, do the job properly and for multimedia experience … nothing can beat them.

The most important of them all is that the IDLE temperature is 36 Celsius:

This is the lowest I saw in a processor :) so I’m impressed.

Maven 3 vs Maven 2

I decided to compare Maven 3 (3.0.3) with Maven 2 ( 2.0.10).

A friend told me that it M3 is supposed to be faster than M2. Since I’m just starting a new project (Primefaces 2 / JSF 2 / Tomcat 6) for some remote administrative tasks that I need – I decided to switch from the good old maven 2 to maven 3 and see what happens.

Not changing the machine nor the pom.xml, it is indeed faster:

Maven 2 builds in 8 seconds:

------------------------------------------------------------------------
BUILD SUCCESSFUL
------------------------------------------------------------------------
Total time: 8 seconds
Finished at: Tue Apr 12 18:32:55 CEST 2011
Final Memory: 18M/33M
------------------------------------------------------------------------

Maven 3 builds in 6.20 seconds.

BUILD SUCCESS
------------------------------------------------------------------------
Total time: 6.190s
Finished at: Tue Apr 12 19:01:22 CEST 2011
Final Memory: 5M/15M
------------------------------------------------------------------------

As you can see, the memory used is half the size.

Me gusta :)

Machine is Intel Q9000, 4Gb DDRAM@800MHz, Intel X25m 80GB SSD hard disk.
Project is as basic as can get so that I can have a Tree populated with dummy data, JSF session bean hooked to a Spring service that, via mybatis, connects to an empty database to return … well, nothing.

War file is about 10Mb.

Friend was right, Maven 3 is faster, I’m keeping it.

Playing guitar is hard.

But not because you don’t know but  because everything is a mess …

Where to begin ?

  1. Your “first” finger is actually your second finger.
  2. As you look at the chords, the first you see is considered the 6th. The last chord you see (the bottom one, 6th) is considered the first.
  3. The main string is the considered the G string. But music standard defines A4 as the reference note. Duh
  4. Logical paradox of the same note that is actually a different note! In fact the frequency doubles – but nobody tells you that.
  5. There are 5 lines on a musical staff, but the C major scale starts way below the first and finishes somewhere above the middle, where another scale starts which finishes way above the top line. Grrr.. Why did they not FIT the octave? One octave INSIDE the 5 lines !
  6. Ever heard of a hemi-demi-semi quaver ? Yeah!! And since a quaver = eighth-note, it follows that hemi-demi-semi quaver = hemi-demi-semi-eighth note! Semi Demi Yeepy Yey!

I can’t stop thinking what if musical notation would have been invented after the everybody familiarized themselves with mathematical simple notation ? And you didn’t have to rotate, translate, shift, mirror, flip, invert and contort, fingers + tabs + scales + octaves + strings ?

I want to play, I’m not a video board to do rotations and translations and shadows real time.

The future of Nokia N8

What to do with an N8, now that the Symbian platform won’t be supported by Nokia?

Simple, frame it!

End Result - N8 Framed

It’s a simple job, although I’m not recommending to buy the N8 just for this purpose
If you have already chosen a brighter future phone such as an Android / IPhone (which will enjoy years of innovation from community due to not imposing expensive certificates down developer’s throat (hint hint!)), then… you can still use N8 as night clock due to its “Big Clock” screen-saver (screen on all night).

Materials:

  1. Copper cable (at least 1.5mm thick, you probably need 50cm not more.
  2. Needle nose pliers.
  3. Photo frame of 10x15cm (which can sit vertically). Color is up to you.
  4. Nokia N8 (the most expensive item from the list)
  5. Roll of wrapping paper, for decor.

Then it’s all matter of twisting the copper, punching the right holes into the cardboard of the photo phrase, then carefully adjust the background color for decor:



Now, if you have insomnia, you can still see how much time you have until you go to work and do your best for your company, keeping customers and investors happy.

There might be a chance for Nokia in the agreement with Microsoft.

I read all the news today (12 Feb 2011) related to the newly signed deal between Nokia and Microsoft.

Nokia could have done it by themselves. They did not need Microsoft. But nobody showed them how nor they asked for help. Below is my opinion on how.

Back in the days, I was an avid user of Nokia 6600, then 6680, etc (S60v2). If my memory serves correctly, there were 1 or 2 viruses around that could mess up the phones by replacing all icons on the software / change fonts etc. And what did Nokia do to fix this issue ? Force all the good developers to pay for certificates / third party approvals – and thus to filter out the bad guys. What ?

And because back in the days there were no real competitors to which the programmers to turn to, maybe some were courageous enough to get entangled in contracts, payments for app reviews, certificates, publisher IDs that had to be renewed each year, and so on.

HOWEVER.

When the moment came and alternatives appeared (iOS/Android), everybody flew there leaving Nokia to sign today’s deal …

There might be a chance for Nokia / WP7 to turn out good for both, but please somebody tell them not to start again with the certificate stuff, and really fix their problems instead of forcing others to pay for that.

If I’d be a big manager at Nokia, that’s what I’d do.

Is Ubuntu better than Windows ? My oppinion on ‘Not.’

I swiched to Ubuntu on the backup PC that I used because “rsync” was native and I needed it to backup the web sites … Plus, Windows had to be restarted each night due to issues with Wireless which would not reconnect once the link was lost.

Guess what, it happens the same in Ubuntu!

Feb  6 13:43:45 adevaraciune kernel: [1361767.569654] BulkOutDataPacket failed:
ReasonCode=-2!
Feb  6 13:43:45 adevaraciune kernel: [1361767.569657]   >>BulkOut Req=0x7be1ca,
Complete=0x7be1c9, Other=0x425
Feb  6 13:43:45 adevaraciune kernel: [1361767.569660]   >>BulkOut Header:70 0 0
44 0 0 7 40
Feb  6 13:43:45 adevaraciune kernel: [1361767.720021] ===>rt_ioctl_giwscan. 2(2)
 BSS returned, data->length = 270
Feb  6 13:43:45 adevaraciune kernel: [1361767.720072] ==>rt_ioctl_siwfreq::SIOCSIWFREQ[cmd=0x8b04] (Channel=1)
Feb  6 13:43:47 adevaraciune kernel: [1361769.577524] BulkOutDataPacket failed: ReasonCode=-2!
Feb  6 13:43:47 adevaraciune kernel: [1361769.577528]   >>BulkOut Req=0x7be1ca, Complete=0x7be1c9, Other=0x426
Feb  6 13:43:47 adevaraciune kernel: [1361769.577531]   >>BulkOut Header:70 0 0 44 0 0 7 40
Feb  6 13:43:49 adevaraciune kernel: [1361771.252011] Qidx(0), not enough space in MgmtRing, MgmtRingFullCount=1!

Once it gets into “not enough space”, that’s it. It will not reconnect (or it might take an indefinite amout of time, like from 18 hours up to two days or something).

Solution, use crontab -e to:

0 5 * * * /sbin/shutdown -r now

Since I’m using it to connect remotely, without wireless is as good as NULL.

I know that I should probably just do an

0 5 * * * /etc/init.d/networking restart

but is no better than a Windows reboot.

I have to babysit the Ubuntu or not ? Yes, I do have to babysit it. So it’s no better.

Not to mention pulseaudio which behaves like crazy with 5+1 and a 6 years old SoundBlaster Live 5+1 board.
On Windows at least I had to reboot it, it did not force me to downgrade the audio system to 2+1.

It’s free, but next time I will install probably a different distribution.

QT on Symbian / I spend more time on Google than in QT Creator

Problems I encountered in 1 day of programming in QT for Nokia’s state of the art, N8 mobile phone:

a) You can’t disable the frame / border around the QTableWidget, even after setting the frame style to Qt::NoFrame.
b) You can’t scroll to the bottom of the table.
c) If you rotate the phone, the selected cell might go out of view – table will be repainted from the first row.

A sample screenshot of a 6 rows QWidgetTable, just after the application starts and is instructed to go to the last row:

The code below:

table->scrollToBottom();

only scrolls the table to somewhere around the middle, around row 3.

Another snippet:

table->setCurrentCell(5, 0);

does the same (divide by two ?) algorithm to decide it’s not the 6th cell, but somewhere in the middle of 4th and 5th.

The simulator bundled with QT Creator does a better job, it takes you a bit closer to the 6th column, but doesn’t quite gets there:

Also, let’s inspect a bit how the frame of the table successfully encapsulates the cells (it’s a 2x magnification of the N8 screenshot above):

Why can’t we get table frame to SURROUND, to be OUTSIDE table’s contents ? Isn’t this the role of the frame ?
Guys, come on, Sun did the Layouts properly 10 years ago.

To add more insult to the injury, the code below:

table->setFrameShape(QFrame::NoFrame);

does not do anything (according to the documentation, it should cause the frame not to be drawn. Wanna bet ?).

Conclusion:

If I would be a Big Manager at Nokia, I would… in fact, these problems seem so deep, that I don’t know what I would do. If I found 3 elementary bugs in just one item (QTableWidget) made by a company that has XX? years of experience in UI coding, I’d be afraid to ask a list of critical tasks programmers spend their time on.

On the good side – I’m impressed by QT, it’s a huge step forward compared to J2ME / Symbian programming – it’s so much easy to program and arrange everything – to create the events, finally a good platform to develop.
I just hope access will be given to create all kind of good stuff:
a) low level programming (Screensaver API, backlight control in screensaver, etc …)
b) attention to UI details and not kludges.

If I’d be a Big Manager at Nokia, that’s what I’d communicate to the team.