Not Really a Blog

July 6, 2010

Easy way to stop the annoying popups from snap.com

Filed under: Internet — Tags: — jroncero @ 20:08

Get annoyed by them? Me too. A lot. And it seems you can’t disable them by using their interface. Or at least it doesn’t work for me.

Hot to fix this? Well, just like with any of these things, they usually load a javascript file. So, let’s just not load it:

First of all, edit /etc/hosts and add a line like 127.0.0.1 spa.snap.com:


sudo vi /etc/hosts

which should end like:


127.0.0.1 spa.snap.com

Better now!

April 15, 2010

Social Engineering at Work

Filed under: Fun, Life, ¿Pero qué coño? — Tags: , — jroncero @ 19:39

I’ve never had social engineering done at me, but recently there was this guy who phone me by directly calling MX Telecom‘s number. He said he was calling from DHL and that he had a package to be delivered for me. He wanted the name of two other people who would sign the delivery report in case I was not there. I complied and later a colleague told me that this is most likely a recruiter collecting names from the companies. Aha!

So, I had another call yesterday and this time I was quicker to react. The conversation went like this:

Hi, Could I speak to Jesús?

On the phone.

Hi, I’m a promoter who is organising an event at the O2 Arena for Playboy Magazine.

Playboy?

Yeah, the adult magazine, have you ever heard of it?

Barely, go on.

Well, they are organising this event for IT professionals and they wanted as many IT professionals to attend this event. I’ve got 6 tickets so if you could give me 5 names I’ll send them to you guys.

Sure, jot down please:

Juan Perez and Joseph Garcia, they are americans and have just arrived to the company.

Oh, sure. Is there any lady there who would like to attend?

To a playboy event? Yeah, I know of one: Ana Botieso, a nice Spanish girl.

is that all?

Yup, thanks a lot, I’m really looking forward to having those tickets.

No problems bye.

bye.

All of this while my mates at work were looking at me and giggling. Obviously the two first names were made up. The girl’s name stands for “An Erect Penis” in Spanish if you put it all together.

So you know, guys, if you ever receive such a suspicious call, you can be playful and have a bit of fun. You never know if you are going to get a call from one of these dicks.

March 24, 2010

Amdocs buys MX Telecom

Filed under: Life — Tags: , , , — jroncero @ 09:27

So, the company I work for, wammux, has been bought by Amdocs, the super mega corporation that owns openmarket, in order to merge us with them. The deal has been $104 million in cash !!!

Don’t really know how that’s going to affect us. We shall see.

More information about Amdocs in wikipedia.

February 18, 2010

Alan Wilder live with Depeche Mode at the Royal Albert Hall

Filed under: Music — Tags: , — jroncero @ 02:42

Tonight I had the honour to attend a Depeche Mode concert at the Royal Albert Hall in London. It was a special night (not that they usually perform at the Royal Albert Hall, usually The Wembley Arena or the O2) as they were performing for a charity, Teenage Cancer Trust.

So I got there by chance as Luis (many thanks), a friend from Spain who had an extra ticket. he’s spared it with me in exchange of accommodation in London. I wasn’t expecting something very unusual in this concert apart from a couple of changes in the set list. It all when good until they had a few guys with violins for 3 of the songs (something they did back in 1993). But, to my surprise and to the surprise of a few thousand people at the venue, Alan Wilder appeared on stage and played the piano with Martin L. Gore to perform Somebody.

Apologies for the quality of the recording, it’s all I could get.
So, for those of you who might find this boring, Alan Wilder left Depeche Mode in 1995, after a devastating (but glorious) Devotional Tour during which many weird things happened (among them, David Gahan on drugs, etc). Lots of people considered this as a turning point in Depeche Mode’s career as Wilder was probably a musical genius that brought everything together: Martin’s nice lyrics and ballads, Gahan’s voice and front lead, Andy’s face (pun intended) and Wilder’s sounds. It hasn’t been the same since.

But tonight, he was playing on stage, with Depeche Mode. Something that many have wished it came true. Too good to last though, as it seems like a one-only thing, kind of special occasion. People have moved on though. They (Depeche Mode and Alan Wilder) have moved on too. You can tell by their concerts. You can tell by the people who attended tonight (I felt very young among today’s crowd, and I started listening to Depeche Mode in 1989). They don’t attract new people these days, people get moved on by the good old classics from 15 years ago, people rock and dance with them in their concerts, not that much with the new stuff.

Anyway, people who know me know that I moved on as well. I no longer listen to much Depeche Mode these days. For me it’s like the memories of an ex-girlfriend for whom I was in love a long time ago. It brings nice memories, but nostalgic memories as well. And that’s why it needs to remain there, where it’s still sweet, otherwise…

However, tonight’s concert has moved me. To say that I’m excited is an understatement. Here I am, unable to get any sleep and writing this blog entry because I had the chance to watch something unique and something that’s moved me after all these years. I really enjoyed tonight, it’s been like making peace with that ex-girlfriend (yeah, but not what you are thinking, I can see you coming here… :-) )

So, thank you Depeche Mode.

I hope you guys enjoy the video.

As a side note, I found this with unseen footage from 1998, recorded by MTV which has also reminded me of the days I started listening to Depeche Mode. Hope you like it.

February 6, 2010

The effect of temporary tables on MySQL’s replication

Filed under: System Administration — Tags: , — jroncero @ 23:05

The other day I needed to set up a new set of MySQL instances at work what would replicate from an existing node. I was setting these up because the master node is running out of disk space and is very slow.

Usually, when you need to restore a database you do it in three parts:

  1. Install the binaries
  2. Load the initial data from the most recent MySQL backup.
  3. Set it replicating from one of the nodes by specifying the binary log file and position from which you want it to replicate (which usually corresponds to the day you took the backup).

Now, because we usually compress the binary logs and because the master didn’t have enough disk space to have all these binary logs uncompressed (such that the new slave could replicate by connecting to the master and talking the MySQL protocol), I needed to transfer them to the new slave and pipe them into MySQL from there. Seems simple, huh?

Everything went fine on point 1 and 2. But then, while piping the contents of the MySQL binary logs into the new databases, it all went wrong. What I used to pipe them was:


for file in master-bin* ; do echo "processing $file" ;    ../mysql/bin/mysqlbinlog "$file" | ../mysql/bin/mysql -u root -ppassword  ; done

Which is how you usually do these things, but this is what I got:


db@slave:~/binlogs$ for i in master-bin* ; do echo "processing $file" ;    ../mysql/bin/mysqlbinlog "$file" | ../mysql/bin/mysql -u root -ppassword  ; done
processing master-bin.1853
processing master-bin.1854
processing master-bin.1855
processing master-bin.1856
processing master-bin.1857
processing master-bin.1858
processing master-bin.1859
processing master-bin.1860
ERROR 1146 at line 10024: Table 'av.a2' doesn't exist
processing master-bin.1861
ERROR 1216 at line 1378: Cannot add or update a child row: a foreign key constraint fails
processing master-bin.1862
ERROR 1216 at line 22825: Cannot add or update a child row: a foreign key constraint fails
processing master-bin.1863

So, table av.a2 does not exist. WTF?

Investigating a bit about this table, it seems there’s a script which executes the following stuff on it everyday:


...

if test $ZZTEST -lt 300000; then
 echo "ERROR: Less than 300k"
 exit 1
fi
cat > sql << EOF
create temporary table a1 (mzi char(16) default null, key mzi(mzi));
create temporary table a2 (mzi char(16) default null, key mzi(mzi));
create temporary table a3 (mzi char(16) default null, key mzi(mzi));
EOF
cat v | grep ^447.........$ | awk '

...

Now, create temporary table, if you read about it on MySQL docs you’ll see that temporary tables are only visible to the current connection and are dropped automatically when that connection finishes. There are a few problems with replication and temporary tables, but this could not possibly be the same problem as these were the binary logs from the master. So, what’s going on here?

The problem here comes from the binary logs being rotated and the way I was inserting them. It just happened that the three SQL statements:


create temporary table a1 (mzi char(16) default null, key mzi(mzi));
create temporary table a2 (mzi char(16) default null, key mzi(mzi));
create temporary table a3 (mzi char(16) default null, key mzi(mzi));

were created at the end of binary log file master-bin.1859 and then there was a SQL statement which made it fail on file master-bin.1860 (inserting data into av.a2) because it was expecting those temporary tables to exist (and they didn’t). This happened  because we are using a for loop in bash to insert the binary logs, so there’s one mysql connection for each binary log file and thus, when file master-bin.1859 finished it automatically made MySQL drop the three temporary tables (that connection was finished) and then on the next connection (file master-bin.1860) these tables were missing.

There are a few ways in which you can work around this.

One approach is to get one big sql file and pipe that into MySQL, something like:


for file in master-bin.1* ; do echo "Using $file" ; ../mysql/bin/mysqlbinlog "$file" >> all.sql; date  ;  done
cat all.sql > ../mysql/bin/mysql -u root -ppassword

Alternatively, doing something like:

(for file in master-bin.1*; do echo “Using $file” 1>&2; ../mysql/bin/mysqlbinlog $file; date 1>&2; done) | ../mysql/bin/mysql -u root -ppassword

If you want to avoid creating one big fat file.

Which should work as in this case it’s only going to be one connection.

But, these ways have an obvious setback, which is that you cannot have a look at what failed (well, sort of, but extremely difficult) if something goes wrong; It’ll fail on one of the files and then will fail with the rest of them.

The better approach, as discussed on High Performance MySQL is to use a log server, that’s it, a MySQL server that would not use any storage but will only be used to replay binary logs, so you won’t have this problem and also, it will let you interact with the server and its diagnostic messages in case something goes awry.

Use temporary tables?

My advice here would be to encourage you not to use CREATE TEMPORARY TABLE because it can break replication in mysterious ways, but that could be too harsh. There are a few workarounds that can be done from an application level that you can read in http://www.xaprb.com/blog/2007/05/11/how-to-eliminate-temporary-tables-in-mysql/ which I think they could be worth thinking about.

Any experience with these problems?

January 9, 2010

My personal review of T-Mobile’s Pulse

Filed under: review — Tags: , , — jroncero @ 02:38

Last month I bought a T-Mobile’s Pulse running Android by a bit more than £80, quite a bargain, considering that it’s a Pay as You Go phone. Not that I wanted to use it as my main personal phone, but because I wanted a second phone where to receive crap sms from work, and also because I wanted to play with the Android platform. So, I’ve used it for a month, and I’m not happy. I promise I googled before hand to read a few reviews and in most of them they talk about it in good terms. I have a different opinion.

It makes me wonder if this is just me who thinks this phone is particularly shit in general or if it’s just the model I’ve got (and, of course, if these reviews are paid anyway). This phone is based on a Huawei handset. You can go to any of the links above to read about the specs. So…

Things I do not like about it

  • It’s very slow and unresponsive. Both the touch screen and the physical buttons. Sometimes it’s actually unbelievable that you have to swipe your finger a few times just to get it. I wonder if it’s the screen or it’s just that the phone can’t cope with it?
  • Applications crash continually (Yeah, I know, it’s not a problem with android per se, but even the Servo Search included with the phone is all the time resurrecting.
  • It has not much memory. Phone becomes sluggish.
  • Battery life is awful. I mean, I thought that iPhones had it bad, but how worse can it be if you have a full battery and it runs out in 6 hours. Seriously.
  • Battery charging is comical. It comes with a USB cable which you connect to either the mains or a computer. It takes hours to no end (and I mean 4, 5, 6 hours, etc). Why?
  • More stuff, but I’ll keep my mouth shut not to be too picky.

Things I do like about it

  • I like the operating system. Seriously. I like that it’s open, based on Linux and highly customizable. Not only that, I like the aspect, widgets and general feeling (if only it were faster)
  • I like the community around it and all the apps (Android Market as opposed to iPhone Store).
  • You can hack it (yeah, iPhone’s too)
  • I like the way you can have different, say, SMS applications and choose the one you prefer to do all the notifications, readings, etc. This is clearly something you cannot do with an iPhone.
  • I love the browser and the google apps within it. Really nice.

And I could go on. General feeling is that I wouldn’t like it to be my main phone. And there are a ton of things I haven’t tested. Almost no phone calls, no music, no camera. You tell me.

So, if you are thinking of buying this phone, please, think it twice and look for someone who has it and use it and ask his opinion about it. I’m not sure this is a general problem with Pulses or my particular model, thus this piece of warning. Go and do your research. And, I refuse to believe that Android sucks, I think there are wonderful phones out there with Android, running newer versions and generally using better hardware. Dunno, I have tried a HTC Hero and seems a lot better. But so far, no way this is comparable to an iPhone.

Nexus One? I’d love to try one, so if you spare one, send it in my direction ;)

Have a T-Mobile Pulse? You happy with it? Let me know how, please.

November 25, 2009

Tired of remembering complicated passwords?

Filed under: Computers — Tags: , , , , — jroncero @ 16:41

My colleague Mat showed me a nice little trick today. Say you are bored or tired of using different password in all your websites you use, or maybe you don’t want to use the same password on these sites. Simple and easy if you use a Linux computer. You only have to use, and more importantly remember, simple words or combination and a little command in the shell to generate a really difficult to guess password.

Say you want to access your Google account and you want to use google as the password. So I’ll go and use the SHA hash algorithm to generate an interesting password like:


% echo "google" | sha1sum
d662cc72cfed7244a88a7360add85d5627b9cd6c  -

Or just go and use your hash algorithm of choice. And if it’s too long for the website you want to use, get the 10 first characters or something.


% echo "google" | sha1sum | cut -c1-10
d662cc72cf

And that’s it, copy and paste and you are done. Yes, it’s a bit of a faff, but, well, you want something secure, don’t you?

Simply brilliant. Thanks Mat.

November 17, 2009

XFS and barriers

Filed under: Linux, System Administration — Tags: , , — jroncero @ 09:33

Lately at work, we’ve been trying to figure out what the deal with barriers are, either for XFS or EXT3, the two filesystems we like most. If you don’t know what barriers are, go and read a bit on the XFS FAQ. Short story, XFS comes with barriers enabled by default, EXT3 does not. Barriers make your system a lot more secure to data corruption, but it degrades performance a lot. Give that EXT3 does not do checksumming of the journal, you could also have lots of corruptions if it’s not enabled. Go and read on wikipedia itself.

If you google a bit you’ll see that there are lots of people who are talking about it, but definitely I haven’t found and answer to what is best and under which scenarios. So, starting with a little test on XFS, here are the results, totally arbitrary on a personal system of mine. System is an Intel Core 2 Duo CPU e4500 at 2.2 GHz, 2GB of RAM and 500GB of HD in a single one XFS partition. I’m testing it with bonnie++ and here are the results. First, mounting by default (that’s it, barriers enabled)

# time bonnie -d /tmp/bonnie/ -u root -f -n 1024
Using uid:0, gid:0.
Writing intelligently...done
Rewriting...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
kore             4G           54162   9 25726   7           60158   4 234.2   4
Latency                        5971ms    1431ms               233ms     251ms
Version  1.96       ------Sequential Create------ --------Random Create--------
kore                -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
 files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
 1024   260  11 489116  99   299   1   262  11 92672  56   165   0
Latency               411ms    3435us     595ms    2063ms     688ms   23969ms

real    303m50.878s
user    0m6.036s
sys    17m52.591s
#

Second time, after a few hours, doing a

mount -oremount,rw,nobarrier /

we get these results (barriers not enabled):

# date ;time bonnie -d /tmp/bonnie/ -u root -f -n 1024 ; date
Tue Nov 17 00:43:53 GMT 2009
Using uid:0, gid:0.
Writing intelligently...done
Rewriting...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
kore             4G           66059  12 30185  10           71108   5 238.6   3
Latency                        4480ms    3911ms               171ms     250ms
Version  1.96       ------Sequential Create------ --------Random Create--------
kore                -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
1024  1830  85 490304  99  4234  17  3420  24 124090  78   402   1
Latency               434ms     165us     432ms    1790ms     311ms   26826ms

real    67m21.588s
user    0m5.668s
sys     11m30.123s
Tue Nov 17 01:51:15 GMT 2009

So, I think you can actually tell how different they behave. I haven’t created graphs from these results to show them graphically, but let me show you some monitoring graphs from these two experiments. The first test was run yesterday in the afternoon. The second one was run just after midnight. You can see the difference. Here showing you the CPU and load average graphs.

I’ll try to follow up shortly with more findings, if I find any ;-) . Please, feel free to add any suggestion or comments about your own experiences with these problems.

CPU Usage

CPU Usage

Load Average

Load Average

November 16, 2009

Nice Firefox and Thunderbird themes

Filed under: Internet — Tags: , , , — jroncero @ 09:12

I’ve found two themes for firefox and thunderbird that I’m so pleased with them I have to promote them a bit :-) . They are Charamel and Silvermel created by Kurt Freudenthal. I discovered them thanks to Chewie. So, what I like about them is:

  • Works with newer versions of Mozilla firefox and thunderbird (Including version 3 beta 4)
  • It’s got really nice colours and  a nice layout.
  • It works fine under linux and Mac OS X. In the latter it lets you have small icons in the bookmark bar, whereas the default theme does not allow you to do that. See image to see what I mean.
  • You’ve got two different colours to choose from.

So go and buy the guy a beer so he can work more on them :-) .

November 15, 2009

Monitoring data with Collectd

Filed under: System Administration — Tags: — jroncero @ 18:50

I’ve been using collectd for quite a while just to monitor the performance of my workstation. I’ve tried other solutions (cacti, munin, etc) but I didn’t like how it all worked or the graphs it created, the amount of work required to have it working, or any other reason, finding collectd to be overall a good solution for my monitoring needs (which are basically graphing and getting some alerts). I like it because it generates nice and good graphs (among other things):

But what I like the most about it is the architecture it’s got for sending data and its low memory footprint.

Today I’ve been playing with it to use the network plugin and I quite like it. The network plugin allows you to have clients sent the monitoring results to a central server, just like the picture below. It sends the data using UDP, which then is captured by the server which will store the data in rrd files and thus having all the data centrally stored. This way, it guarantees that the server it’s not going to block on sending this data. Obviously we want to make sure our connection is reliable.

Collectd Architecture

Which means that you can have collectd running on a number of computers and having them sending the data to a server which can be used to store all this data and display it. The magic about it is that the memory footprint is very small (it’s written in C) and that it can send the data to a single server or more than one, even sending them using a multicast group, which is very nice.

Things that it, allegedly, doesn’t do very well is monitoring and generating alerts (but last version it claims it can have simple thresholds). Also, the web interface collection3 written in perl is a major liability.

So, I’m planning on spending a few more hours playing with this and possibly coming up with an article on how to set it up integrated with my systems and trac. Such that I :

  1. Have a plugin to display graphs on a wiki page, on trac possibly.
  2. Have it sending the data via openvpn (although the latest version supports encryption and signing) for clients behind a firewall.
  3. Make the most use of the plugins.

Any suggestions for a better web interface for collectd?

Older Posts »

Blog at WordPress.com.