Saturday, December 13

Japan's Best Butt or Reuters taking the piss out of Japanese Media?




What really happened?
Did the conservative Sloggi share-holders ruin a promising beauty contest?
If they were competing for the Best Butt in Japan, then why on earth force the women to wear back-to-the-50's attire?
You can hardly see the butts, under less important circumstances, I wouldn't be bothered to complain about it, but it really pisses me off that some conservative-populists have prevented me from seeing the best butt in Japan, I find it a nuisance. So I do.





As if Sloggi didn't include strings in their collection, this photo makes it very clear.
Only I can't comprehend why they weren't allowed to wear them?
These Japanese petite female beauties would have walked the catwalk a lot less embarrassed, only if the contestants would have been allowed to wear the Sloggi strings of their own choice.
Or doesn't Sloggi know strings dignify the sensual curves of a female body?
When the point is arranging a contest about the best butt of the country, then don't go and censor them - butts.

Thursday, December 11

How to Increase the number of file descriptors on your Linux Server







Today I thought to myself, if I don't publish anything geeky before X-mas, I won't get any presents from Santa, and my credibility as a geek will suffer.
There always seems to be an ulterior motive behind many things, and mine is this. I'm seeking a job, and the CTO's and such surely Google all the applicants names because there is so much bluffing and arse covering going on in the IT business, that you wouldn't believe.
Well, perhaps this article will make me look more tech savvy online like I am in real life.

If you don't know what a file descriptor is, you may find this article extremely boring. However if you are interested, I found a good definition from the web for you:
A small positive integer that the system uses instead of the file name to identify an open file.

Most Linux distros need at least some tuning out of the box. It's not cost-effective to run production servers with default settings. There are many things that can be done to optimize the current kernel, as dynamic as it is compared to the previous major release 2.4 the number of open file descriptors still matters.
Also I/O Scheduler is set to fair as default, this should be changed according to your servers role and in my opinion one should set it to pre-emptive when in doubt. Well I haven't code-read the algorithms' source code, I'm very slow in that and must do it with a book in the other hand as I am not as much of a coder as a sys admin.

While talking about schedulers, another interesting one is the Symmetric Multi Processing scheduler, this one has been already patched in the beginning of the year 2008, and handles multiple and multi-core cpus' well, as long as the application is SMP aware. Before the patching, it didn't load balance threads in an effective manner. Okay, back to the issue at hand.

If I'm wrong about any of this, or your opinion differs, comments are welcome.

I am no kernel developer, but merely a geek who's barely keeping his head above the water when it comes to kernel development.
I tested to verify and double-check all this several of months ago at my previous working place.

The system wide hard limit for open file descriptors is defined by the kernel.

These can be changed on the kernel sources and recompiled, the values are found here:

/usr/src/linux-2.6.xinclude/linux/fs.h

/usr/src/linux-2.6.x

include/linux/limits.h

NR_OPEN = maximum number of open files per process
NR_FILE = total number of files that can be open in the system at any time

The below red is from the fs.h file.

/*

* It's silly to have NR_OPEN bigger than NR_FILE, but you can change

* the file limit at runtime and only root can increase the per-process

* nr_file rlimit, so it's safe to set up a ridiculously high absolute

* upper limit on files-per-process.

*

* Some programs (notably those using select()) may have to be

* recompiled to take full advantage of the new limits..

*/

/* Fixed constants first: */

#undef NR_OPEN

#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */

#define INR_OPEN 1024 /* Initial setting for nfile rlimits */

Based on the above, the max open file descriptors per process can easily be altered, and one can query the “system wide” max open file descriptors with either:

sysctl -a | grep fs.file-max

or

cat /proc/sys/fs/file-max

The default value for this on SuSE Linux kernel 2.6.25.5-1.1 is 50156.

This can be changed by writing it in the sysctl or directly to /proc.

To check if the actual limits have been reached system wide, can be done with,

cat /proc/sys/fs/file-nr

or alternatively,

sysctl –a | grep fs.file-nr

768 0 50156

Where the 1st value is: total allocated file descriptors

2nd value: total free allocated file descriptors

3rd value:
maximum number of file descriptors allowed on the system

There is also something called the “ulimit” which is a user ID specific limit for number of open file descriptors and it is valid per user/group and log-in session.

This limit can be increased by editing the file /etc/security/limits.conf and it does make sense to edit it for a single process like squid.

squid hard nofile 4096

to check how many open file descriptors are used per process ID, do like this, first get the PID:

ps aux | grep squid

squid 18680 42.4 1.1 61156 11284 ? Sl Feb16 1715:55 (squid) -sYD

Then you can check the number of open files used by the PID:

lsof | grep 18680 | wc –l

32

However as the number of open files is not exactly the same thing as the number of open file descriptors like you can see below we get a different value.

ls -l /proc/18680/fd/

total 15

dr-x------ 2 root root 0 Feb 19 15:39 .

dr-xr-xr-x 3 squid nogroup 0 Feb 19 05:24 ..

lrwx------ 1 root root 64 Feb 19 15:39 0 -> /dev/null

lrwx------ 1 root root 64 Feb 19 15:39 1 -> /dev/null

l-wx------ 1 root root 64 Feb 19 15:39 10 -> pipe:[29382153]

lrwx------ 1 root root 64 Feb 19 15:39 12 -> socket:[420808351]

l-wx------ 1 root root 64 Feb 19 15:39 13 -> /var/cache/squid/swap.state

lr-x------ 1 root root 64 Feb 19 15:39 16 -> pipe:[29382165]

l-wx------ 1 root root 64 Feb 19 15:39 17 -> pipe:[29382165]

lrwx------ 1 root root 64 Feb 19 15:39 2 -> /dev/null

lrwx------ 1 root root 64 Feb 19 15:39 3 -> /var/log/squid/cache.log

lrwx------ 1 root root 64 Feb 19 15:39 4 -> socket:[29382150]

l-wx------ 1 root root 64 Feb 19 15:39 5 -> /var/log/squid/access.log

l-wx------ 1 root root 64 Feb 19 15:39 6 -> /var/log/squid/store.log

lr-x------ 1 root root 64 Feb 19 15:39 7 -> pipe:[29382152]

lrwx------ 1 root root 64 Feb 19 15:39 8 -> socket:[420808349]

lrwx------ 1 root root 64 Feb 19 15:39 9 -> socket:[420808350]

All comments, suggestions or corrections are welcome, remember that this applies mostly to high loaded servers, tweaking these values isn't always necessary, but it's great fun :-)

Monday, December 1

Failed Fcking Original Online Flirts - Do not try unless you want to get problems and loneliness in your life...

Yes, I now decided to share all my pathetic online flirt one-liners. Why, you don’t want to know and solitude is boring. Why, for your entertainment. Why, because it’s the way things are. Well, some may actually work, but not with my karma.

So here are the lines - if you’re still reading, note that they always comment on a photo of a beautiful woman...only about 5% return flirt rate, and even that fcking number is exaggerated. So I am no stranger to humiliation!

your eyes are like distant but promising hills, the promise is: soon I’ll climb up the hill and am able to place my eyes opposite yours :-)

can I adjust your beautiful white hair band, it looks so pure n white on your head, you can adjust my hair band then, and we do it together until we eventually fall for each others - if not hearts - at least hair :-)

are u waiting 4 a date in that photo; you look so elegant & excited, is the date me? am I late? where’s the venue? I don’t want to miss you!

hey, don’t hug that tree with such a passion and joy, you make me jealous! where can we hug? let me know a place in shanghai, and u will not miss that tree anymore!

if u don’t give me a such look like in the photo in real life soon - I’ll cut my wrists open! Sorry, that came out with little bit too passionately.

I’m also 1974, but a man, your search is over!

fantastic sammi, lets get together - I promise it’ll be more fantastic than you can ever imagine, I am everything but the typical man!

I want you home, to look at your wonderful smiling eyes, red lips and white teeth - for the rest of my life, shall we say it is a deal then :-)

u got cream on your nose, let me lick it clean - or u want my cat do it instead - actually we both love cream so we can share the job, but can u feed?

I always have had a fetish for women few years older than myself, shall we make it reality, you n me, soon!!

I’m 1 in 6 billions n traveled halfway the world to meet my better half, so I’d like you to reveal yourself, so I can see who I came for?

tell me what is behind those sweet lips n dark eyes?

that ocean (I love oceans) and you are too much for me, I’m glad I’m not there!

which one of you will be my date tonight? or this weekend?! I love you both, the way you look that is - and perhaps your heart too one day!

young ladies have hots for elder men, or don’t they, I certainly got the hots for you!

Our ages are match, and I bet a lot of else will match too, at least I’m taken by your lovely smile....

Is your father a captain of a big boat? Can I be your captain?

you’re 3 cm taller than myself, if that is not an obstacle, tell me your story

mystery girl, could you intrigue me, tell me about yourself?

I’d very much like to hold that umbrella to help you shield you from the water that rains down on you from your broken roof :-)

I got all colors and can color it well, carefully, gently, around the edges, not letting any black spots nowhere, I color your life so much that you forget about monochrome tones altogether, when shall we start?! My color palette will dry out soon, so if you want me to color your life, please let me know now Dear!

you seem to have some fun, must have been a good photographer making such a joke to bring out your beautiful natural laughter, Let’s laugh 2gether

Anna, your photos look soo beautiful, if your heart is of the same beauty, I want to win your love - I’m for real, tis’ no joke!

could u be the one for me? I’d certainly welcome you in my heart arms wide open

Melancholic, but happy in company that I yearn, a bit mad, witty, love animals and still a teenager, its like we’re made for each others? yes?

Let us love each others like a good Christian and a good Muslim we are :-)

Big Cat, be mine, and you’ll never regret it, I’d never loose you nor hurt you......kiss kiss

you really look nice, if your heart is as nice as your looks, I’m a sold man!

how about me, would I do?

Look, I searched through at least 100 profiles until I found yours, so I spent a lot of time to find you, so for that, I hope you will respond to me :-)

Don’t try these at home, your life will be ruined, and you find yourself in absurd situations in real life, and your dreams become boring. Too much internet is no good, get your date to go live in real life within 7 days, otherwise you’re in fantasy land!

Saturday, November 22

Digital photography enthuastic banned for life aka never let anything nor anybody compromise your artistic integrity


On my previous blog I was whining about the difficulty of obtaining a shallow depth of field with mid-range digital cameras like mine. The one I have is not a DSLR, it merely looks like one, although it has manual settings and an optical image stabilizer, aspheric all-glass lens with 12 x zoom and a matte box for attaching filters. Still, it's a piece of junk when it comes to professional photography.

A'right back to the shallow depth of field, you know those nice portraits where the model is in perfect focus but the background's blurred. All this gives a professional look, makes the photo more 3-D like. The object comes out from the background, instead of a flat portrait where buildings or whatever is in the background is as sharp and detailed as the object.

The culprit is the tiny CCD panel; it's cheap to manufacture small CCD/CMOS panels. However if you know the laws of optics - or bother to google a bit - you can get a shallow depth of field with a small CCD panel, at least for somewhat still objects, but F1 racing cars, not really.




We decided to rendez-vous in the afternoon with my other half at Zhong shan Metro. Well, as usual, one of us was late, and I entertained myself with shooting the above uninteresting photo. At least it has that shallow depth of field. While playing with my toy it was getting later and later, like a race against the setting sun, and the sun always wins.
The plan was a cosplay shoot-out in Zhong shan Park, but no, the sun tumbled down below the horizon rendering our plans pointless, yes it did not set, it tumbled, I could feel the sunspots were re-arranging into a pattern that I am too scared to describe. I mean, being geek and all, you don't want to be stigmatized as a sun storm maniac who sees fractals and thinks he can predict the outcome of his next job interview from them.




We did visit the park after sunset and ended up doing some stop-photography and then had a dinner at the close by NineClouds Shopping Centre. I am not a person to give it all up so easily, so I managed to take this photo before the manager claimed that we were disturbing other guests. Eventually we were thrown out of the restaurant, but I did get my shallow depth of field photo. Well it was a cheap price to pay for a semi-good photo, to be banned from Nine Clouds Shopping Centre for life.

Wednesday, November 12

How to Differentiate a black taxi from a regular taxi in South Shanghai Suburbs?



This is a crucial bit of information if you want to enhance your urban survival skills. Let me introduce the regular taxi of South Shanghai Suburbs, this is what it looks like, and although it is dark colored, it isn't entirely black.




Yes it is quite obvious with the taxi sign on the top and all, and I'm in no way taking the piss nor in any way under-estimating my readers. Really.
Alright now the actual black taxi which fares start from a mere 5 Yuan. They all look the same, but come in a wide variety of colors. This is how they look like.




I mixed up the registration numbers with Adobe Photoshop, and the photos may give the illusion that the vehicles are parked on the middle of the road, but it isn't so, it's just me practicing my novice photography skills on how to shoot fast moving objects and avoid blurry photos, although sometimes that is a nice effect to give an illusion of movement. Please no comments about the dof and sports photography to a man who is using a camera with a 1/2.5" CCD panel.

Once I manage to obtain a Canon 1DS Mark III or Nikon D3 - 35mm full frame sensor pro digicams - I will be ready for shooting at the next Shanghai Formula1 Grand Prix.

Tuesday, November 4

Life on Post-Shanghai Asteroid



It came down heavy and hard. No, it wasn't normal rain, I could tell,
but some kind of industrial piss, probably waste water
from a translunar megaship.

Thank sys-god for my ferrovinyl skin-upgrade.
The smell got unbearable.
I felt like throwing up. I did. But I remembered to turn away,
just in time, before the puke hit my shoes.
This was my accomplishment for the day,
the theme of my blog entry,
before I initialized runlevel zero for the night.

If you’re ever caught in a filthy downpour,
even if your expensive designer shoes get soaked,
you can at least try to keep them free from half-digested crab,
or whatever else you had for dinner,
walking around the downtown pathways of
Post-Shanghai Asteroid, looking for a job,
praying for some generous human employer
to jump out of the shadows and say,
Yes, we hire ex-machines, we accept rehabilitated biobots.

You see, I was not fully human, not then, but now I have aspired to
live and work like one.



Paraphrased by myself from an original by Don Bosco.

Sunday, October 26

Shanghai October Rain




Once in a while everybody gets burned,

so it is no wonder why the facades rent asunder,

life's full of trauma and burden,

but what everybody needs is encouragement,

so never let anybody prevent your utterance,

if you do, you drink from the wrong sink,

never let anybody decide on your behalf,

instead, use your own head to think.

Tuesday, October 21

"The Modern Capitalist World Destroys Idealism"


Eino Leino

R.I.P

July 6th 1878 - January 10th 1926


My first blog entry is dedicated to the memory of Eino Leino, a Finnish poet, a master of song-like poetic forms, playwright, and novelist.

Last summer I went to a garden in Helsinki city by the sea, and see: Somebody had placed an empty beer bottle on the head of the pride of my fatherland, Eino Leino, well, his statue anyway.

I got very upset about such a disgraceful, outrageous deed, so that I couldn’t help myself but to climb up on the statue's stand and as I was about to remove the bottle, it fell down and broke into splinters of brown glass that hit the surrounding bed of flowers. I woke up from my patriotic thoughts by a sound; three Asian dolls were applausing for me…

So I decided to translate few of his poems into English…


First one…


I am here a stranger mere,

Have been from the beginning,

Strange to me are the earth and its’ valleys

Strange is the burden of life.


Second one…


Not all of them are dead
who are said to be dead.

Ocean’s black mud
many young sleep
rowing men of the grand ocean,
sailing boats mast makers.
when the weather becomes hot,
storm the ocean roars,
rising on the waves,
to sing.

What is a song of deaths children?
the song of days of life.
what is the life of children?
The song of deaths moon.

And what is God’s song?
The song once a midnight.


Third one…


WHEN I RECALL

When I remember the number of nights
I have sat alone, alone,
and watched the stars above,

flashin’ side by side,
so my girl,
o my girl,
I got to come close to you
and watch long, long.

When I remember on how many travels
I have been in the forest,
and sat under a tree

and sat without pleasures,
so my girl,
o my girl,
I must kiss you long
and cry, cry quietly.

When I recall, how many thoughts
I’ve thought evil there,
That we could have avoided together

and won with one mind,
so my girl,
o my girl,
Me, you have to love for long
and love long, long


So there you go, hope you enjoyed it, his works aren’t that easy to translate, perhaps impossible, here’s few parts of work in progress....


So What if it is a lie,
and does not stand up to the sharp blades of daylight?
We, therefore, rather dream than stay awake,
and the ailments they once again arise.
Many slept on young people’s dreams and woke with silver hair,
looked around perplexed - and fell asleep again.

They arrive, arrive again,
the white stallions of my fortune,
they come with their old weigh and power,
and my chest feels gigantic.
and the sky’s clear, and the soil’s blossoming
and the notes from my mouth smoke,
and my voice is like the thunders’
o have a dream!