Search Results: "pstorralba"

30 August 2007

Pablo S. Torralba: Shell date and time tricks

One of the things I hate the most when programming is dealing with time and date functions and all the special cases which exists. Even more, I have the feeling I'm walking a path many times walked before, so it becomes one of the most unpleasant tasks for me.

Fortunately, it's true, so many others walked before that path so here are some quick tricks for shell programming using the wonderful date UN*X program:
  1. Converting epoch:
    1. From epoch to anything else: date -d @$epoch_value +FORMAT (where FORMAT is of course as described on date(1), and '@' makes the actual undocummented trick).
    2. From anything else to epoch: date +%s
  2. Calculating times
    1. One day forward: date -d "1 day"
    2. One day backwards: date -d "1 day ago"
    3. Just imagine "1 month", "3 months ago" and the like. Not only google is so friendly with human language ;-)
  3. More format conversion: '-d' option accepts several other formats as input, even with calculations:
    1. date -d "1977-08-19 30 years", yeah! my 30th birthday was on sunday. Thanks date, and it was (as epoch): date -d "1977-08-19 30 years" +%s... 1187474400 :-D
    2. Funny ls:

      ls -l while read perms links user group size d t name
      do
      echo $perms $links $user $group $size $( date -d "$d $t 1 day" ) $name
      done
      You can, of course, change the way date is shown. That's because 'YYYY-MM-DD hh:mm' is also a valid input format for date as it is 'YYYY/MM/DD'.
So '@', '1 day' and 'date' saved me the day.

Update: This features and more are indeed described in the coreutils info manual. Thanks mp for pointing it out.

19 July 2007

Pablo S. Torralba: Damn GFS

Just a few hours before the public release of the portal we work on one of the cluster machines get overloaded by issues no relevant for the point. The fact is once the machine started to not answer properly so it was fenced by some other node, but the problem was once this automatic action was held, the whole 6 machines GFS cluster went down letting all the machines unusable.

This, in addition to all of the previous issues we suffered on GFS, made us really thinking about purging GFS in favor of NFS. It was no an easy decision as it was fully against all our previous decisions but we weren't confident about GFS in the production systems. So we migrated it in a time record configuring everything by night so at six o'clock service would be held properly. And we managed to fulfill this purpose. We made it!

We are now tired after about 27 continuous working hours but the overall result was quite acceptable. I'm still proud about or design (not so much about my own decissions) which allowed us to make this king of changes so quickly.

But you can be sure I don't think we will never again think about installing GFS on any system as it seems not being production suitable (as RedHat even says so). And it is not only because the buggy GFS2 (at least, at present date) but for the sensation of instability all over the time we had it installed.

So in a few hours our architecture has been changed, but it was setup for the very moment we were accepting requests.

18 June 2007

Pablo S. Torralba: IPMI

IPMI stands for "Intelligent Platform Management Interface", an interesting feature deployed on nowadays servers. I can't forget that question I made some months ago about an extra ethernet port on the IBM server machines we were working with on those days. The answer was quite simple: it is almost of no use at all; at most you can get some stats and diagnostics but it is mainly intended for hardware technicians.

Liars (or ignorants)! Anyway, it is quite useful. It is the IPMI port which can be used for several managements actions (even from the running system) such as power cycle the machine, get some stats, establish a watchdog interface and the like.

Uses?, are they need to be told?. As a first glance you can get reports about the machine from the operating system itself without the need of physical access to the datacenter. You can also restart a machine which is failing to reboot by itself in case you can login one more time in the system. But... even more, you can do all that (and more) from a remote system (don't exhitate, it is password protected, at least, in case you configure it so). So the next obvious uses are for cluster fencing and stonith (shot the other node in the head) without the need of power control hardware.

It is a pity we didn't knew that when we configured the SAP cluster in my previous job despite the serial cable almost did it work. Sure Mr Navas will be interested in knowing about this technology :-)

Oh, a simple example:

# ipmitool -I open chassis status
System Power : on
Power Overload : false
Power Interlock : inactive
Main Power Fault : false
Power Control Fault : false
Power Restore Policy : always-off
Last Power Event :
Chassis Intrusion : inactive
Front-Panel Lockout : inactive
Drive Fault : false
Cooling/Fan Fault : false
Sleep Button Disable : not allowed
Diag Button Disable : allowed
Reset Button Disable : not allowed
Power Button Disable : allowed
Sleep Button Disabled: false
Diag Button Disabled : true
Reset Button Disabled: false
Power Button Disabled: true


Another one:

ipmitool -I open chassis power reset

Ooooooops. Next post after crash :-)

16 April 2007

Pablo S. Torralba: Photo tech

In the last two weeks I've discovered (or was told about) some programs quite useful for an outdoor technician (amateur photographer):


29 March 2007

Pablo S. Torralba: ADN - Everything is connected

That's the company's slogan, whose offices we are working at. And I must admit it seems quite true.

Today, we have visited one of the data centers we are evaluating for our company hosting. It was a Tier 1 company, that is networking, connections... nothing special there. The amazing thing is one of the people we meet there was visiting Australia a year ago, and he is also a photograph passionated. I feel him a bit like a twin soul of mine as we are planning to visit Australia on our marriage trip where I will take a lot of pictures, of course. We were talking and he gave me some interesting URLs about his blog, travel agency and the like. So again everything seems connected, as Google knows so frightening well.

Anyway, we went there by motorbike which was a plus not connected to anything else, but too much funny in any case.

27 March 2007

Pablo S. Torralba: Keep going

I took this photograph last weekend at Consuegra where we went to observe the night sky, just for fun, as we used to do. I'm sure you don't need to be told that Polaris and Ursa Major are the start on the left and the constellation on the right side. And that's why I am not telling you ;-)

Anyway, the interesting thing for me here is the effect of the Earth rotation movement. Polaris is said to be in the Earth rotation axis prolongation (it is also said this will change with time, a lot of time indeed). But, by now, for us, it can be considered a fixed point in the sky: the north point which remains a point in the picture regardless of rotation. Every other star appears as rotating around Polaris, despite the truth is we are the ones rotating. I almost can imagine I see the Earth from outside.

19 March 2007

Amaya Rodrigo: An evening with Pablo: Real Life MIA Hunting

Nothing stops the MIA team! Maintainers beware! Resistance is futile. We might even knock on your door!

My dear friend Pablo, who I got involved into all this Debian craze, fun, cult, family... was a great maintainer until he gradually became MIA. In fact he has not had packages in unstable for almost a year and a half. His account is about to be deleted... I could not allow this!

So we spent Sunday together. Diana, his fiancee, made wonderful maki, sushi (yummm & yay!) and delicious tempura. We watched a strange, but hilarious movie: Laurel Canyon (warning: not recommended) and walked around Galapagar, a nice little place north of Madrid. Their house is absolutely cute, they are getting married and getting a kitten. We talked about the old times, the new times, the changes in our lifes... it was so great to see them again, it had been a long time!

It reminded me of the lifestyle choices we all make and made me think about mine. So far I am still happy single, cute-home-less and childless, although I must admit the clock recently began to tick at times, and I bug Holgi about it. Poor Holgi. Maybe it s time for a kitten for me too!

Read Pablo s side of the story here. He s looking for packages to adopt. I think adding him to Planet by surprise would be nasty, so I ll ask first. I already asked him to vote in the DPL election. I am so evil... /me works on a hackergotchi now.

N.P: Dani California - Red Hot Chili Peppers - Stadium Arcadium