tag:blogger.com,1999:blog-70213272009-07-11T10:55:53.395-03:00I, AdminTechnical dump of a professional Systems Administrator.Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.comBlogger49125tag:blogger.com,1999:blog-7021327.post-58414694310436460162009-07-04T16:13:00.003-03:002009-07-04T16:42:39.995-03:00My preferred Android applicationsI bought an HTC Magic a few weeks ago. One of the its coolest thing is the sheer number of apps in the Android Market. There are actually too many and finding the good ones requires lots of searching and testing. These are the ones I use the most so far:<br /><br />- <a href="http://wapedia.mobi">Wapedia</a>, which greatly optimizes the wikipedia display for mobile devices.<br />- <a href="http://pixelpipe.om">Pixelpipe</a>, to upload media to Flickr easily.<br />- QuickDic German, by Thad Hughes (a googler, by the way)<br />- <a href="http://ichi2.net/anki/">AnkiOnline</a>. Not actually an app, but a mobile-friendly web site that is always synced with my desktop Anki database. I use it to study german vocabulary while commuting. Pretty cool.<br />- <a href="http://newsrob.com">NewsRob</a>, a Google Reader client (suggested by Cesar from <a href="http://pinguinsmoveis.blogspot.com">Pinguis Moveis</a>)<br /><br />Soon I'll hopefully expand this list with an I app I wrote myself, but I've been very lazy lately, so who knows.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-5841469431043646016?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-75312314900715937532009-06-14T19:46:00.005-03:002009-06-14T20:29:22.460-03:00Sometimes I miss doing Linux end user support workLast October I set an Ubuntu desktop for <a href="http://whodsay.blogspot.com">Carla</a>'s family. We live very far away from them, so it was important that their system was resilient, otherwise it wouldn't last long. They are all beginners in this internet thing, so installing Windows for them would have been a bad idea.<br /><br />And I was right. Things ran pretty smoothly, we talked via Skype very often, with no signs of virus or crashes. I even found this file in their system:<br /><blockquote>clica-aqui.exe (click-here.exe, in Portuguese)</blockquote><br />After many months of usage everything was still working fine, until the computer stopped booting.<br /><br />Helping them from the phone was a challenge. They had to read the error messages in English for me (and they don't understand this language), while we tried to fix GRUB. In the end I assumed the hard disk was just dead.<br /><br />I asked my good friend <a href="http://marcelolemos.blogspot.com/">Marcelo Lemos</a> for help and he burned an ISO image of Ubuntu and sent them by mail. I live in Switzerland and it would take ages for the package to get there. The customs in Brazil are a black hole. <br /><br />The CD got there after a couple days but, of course, since the worst case scenario always apply, the computer was not set to boot via CD-ROM, so we had to fix that - all by phone, while the girls spell each CMOS setup word for me.<br /><br />Now the Ubuntu Live CD system was finally up, I logged in via a reverse SSH connection (I gave them commands via Gmail that they would run via terminal) and fixed the filesystem errors. But the kernel still showed too many I/O errors from that hard disk. The only safe thing to do was to backup their remaining personal files somewhere while the system is still up, then reinstall everything with a new hard disk.<br /><br />I needed a safe place to send all their stuff but my amazing friends and former colleagues at <a href="http://rimuhosting.com">RimuHosting</a> do not offer the cheapest disk space plans, unfortunately. So I remembered that a RimuHosting customer once said great things about rsync.net (awesome name, by the way), and I gave them a try.<br /><br />I ordered a one-year 4Gb quote with them and my account was setup in a few minutes, even before I send them the payment, which is really awesome. I got all login details by mail, and started rsync'ing everything right away. Pretty neat. So it turns out that <a href="http://rsync.net">rsync.net is a decent secure offsite backup service</a> that I strongly recommend so far. They even have servers here in Zürich :-).<br /><br />The rsync is still running inside a <span style="font-style:italic;">screen(1)</span> session as I write this, and it's going to take a while to finish. I just hope the disk is not too damaged and that it copies the most important files. Otherwise how would they live without the <span style="font-style:italic;">clica-aqui.exe</span>?<br /><br />So much adrenaline! Only end-user support work gives me that. I miss that a little bit.<br /><br /><br /><br /><br /><br />NOT!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-7531231490071593753?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-2921035690227442302009-06-09T21:22:00.004-03:002009-06-14T20:27:53.707-03:00Fixed my first bug in C++. PROFIT!I'm still <a href="http://i-admin.blogspot.com/2009/06/having-fan-while-trying-to-learn-c.html">trying to learn C++ by fixing bugs</a>. Well, the bug I wanted to fix in Ekiga had already being solved upstream (should I be happy or sad?), but I had fun trying to debug it anyway.<br /><br />Luckily I found another one to fix today. After 1h30m playing around with gdb and adding debug messages everywhere, I fixed a <a href="http://bugzilla.gnome.org/show_bug.cgi?id=582789">bug in Gnote where preferences were not being set unless you restarted the program</a>.<br /><br />The biggest challenge was to find out that all code was written already, it just wasn't working. I initially thought I'd have to write the callback methods myself, but then I saw references to "gconf...notify" in the code, which would normally be enough.<br /><br />Reading the gconf API docs was sufficient for me to find the culprit. <a href="http://git.gnome.org/cgit/gnote/commit/?id=22e48c6de1373c73f64196b29f7d1b274d1300b4">2-liner patch submitted</a> ;-).<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-292103569022744230?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-21412246392964023162009-06-08T21:16:00.004-03:002009-06-09T17:33:39.695-03:00Having fun while trying to learn C++I've been trying to learn C++ lately. I read a few chapters of a few books, but I got tired of just reading so now I am trying to fix bugs in free software out there.<br /><br />The first step was to install Ubuntu on the Macbook Pro that I use. Second step was to find useful software written in C++ that needs small bugs fixing.<br /><br />First I tried to fix a <a href="http://bugzilla.gnome.org/show_bug.cgi?id=581080">bug in gnote</a>, but I wasn't persistent enough and the lead developer fixed the bug himself after many days without any update from me. The lesson learned here is <b>do not just propose a fix a go walkabout. Stick to it until the end.</b><br /><br />Now I'm trying to fix an bug in Ekiga. Actually, I think the bug is in the libopal, but I'm not so sure. The symptom is a segmentation fault in SIPHandler::SendRequest() and it only crashes when I set an outbound SIP proxy. Maybe I'm setting an invalid proxy, but well, it shouldn't be crashing.<br /><br />Let's see how far I'll go this time.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-2141224639296402316?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-84564869947016679912008-12-29T16:55:00.007-02:002009-01-11T18:21:51.560-02:00Being naïve about Python object identities, references and sizes.I'm ashamed of how naïve and ignorant I stand regarding Python stuff. At least this time, I've learned a great lesson about object identities, references and sizes. Hopefully you won't make the same mistake as I did.<br /><br />Here's what I wanted to do: write an in-memory simplistic log keeper for my application, that would be used as a poor man's brute force protection. The details don't matter much. All this meant is I'd have to keep, say, all the last 10 authentication attempts for all users, for as long as needed, in memory.<br /><br />I was then a bit worried about memory usage, so <span style="font-weight:bold;"> I got creative</span>. I'm probably the <a href="http://everythingsysadmin.com/2008/10/system-administration-needs-mo.html">electrician sysadmin that Tom referred</a>. Sometimes the wires burst in flames when I get creative.<br /><br />A normal (and sane) person would write something like this:<br /><br /><pre><br />UserLog(object):<br /> def __init__(self, auth_result, auth_timestamp, client_ip):<br /> self.auth_result = auth_result<br /> self.auth_timestamp = auth_timestamp<br /> self.client_ip = client_ip<br /></pre><br />It's a simple class type object. It would be used this way:<br /><br /><pre><br />lastlog = UserLog(True, 1231700497, '127.0.0.1')<br />print lastlog.client_ip <br /></pre><br /><br />But then I looked at the object names, "client_ip", "auth_result", "auth_timestamp". And I thought: OMG, I'd have one UserLog object instance for each auth event, for each user. I don't want to waste so many precious bytes by keeping these <span style="font-weight:bold;">object names </span>in my structure!<br /><br />So this stupid person had the following reasoning to try and save memory.<br /><br />Instead of keeping a proper structured and clean "log" object with each log component with their names, I thought I should throw everything inside a list, and use the index numbers to reference to each member. For example:<br /><br /><pre><br />user_logs['yves'] = [False, 1231700497, '10.0.0.33']<br /></pre><br /><br />In order to add mnmemonics for this stupid structure, I'd use some constants that I could use to refer to the indexes. Eg:<br /><br /><pre><br />AUTH_TIMESTAMP = 1<br /><br />for log in user_logs['yves']:<br /> print log[AUTH_TIMESTAMP]<br /></pre><br /><br />Although this hideous code is common for C programmers, it's a deadly sin for Python programmers. What kind of creature would NOT use a dictionary to store this data? That creature is me, Yves, and I ask for your forgiveness.<br /><br />Of course I should have used a dictionary. A class type object would be even cleaner. So I rewrote that portion of the code.<br /><br />The truth is the overhead for keeping 1 million instances of the string constant 'client_ip' is not as big as I thought, even when compared to keeping 1 million instances of the integer 2. Why is that?<br /><br />It's simple. As we know, Python uses references for keeping its objects. We'd have 1 million references to "client_ip", yes, but they all point to exactly the same object: the string constant "client_id" is kept just once in memory, for all our instances.<br /><br />It's easy to see this happening:<br /><br /><blockquote><br />>>> a = 'gggggggggggggg'<br />>>> b = 'gggggggggggggg'<br />>>> c = 'xxxxxxxxxxxxxx'<br />>>> id(a)<br /><span style="font-weight:bold;">154424848</span><br />>>> id(b)<br /><span style="font-weight:bold;">154424848</span><br />>>> id(c)<br />154424888<br /></blockquote><br /><br />Note how a and b refer to the same object id. One can even compare them by using 'is'.<br /><br /><blockquote><br />>>> a is b<br />True<br /></blockquote> above<br /><br />So although a and b are independent containers, they point to the same string constant, which is only saved once in memory. Interesting, hun? This is called <a href="http://en.wikipedia.org/wiki/Common_subexpression_elimination">common subexpression elimination</a> and it's a well-known optimization technique for compilers.<br /><br />Obviously, although we don't have to worry about repeated string constants for the keys in our multiple dictionaries, there's still a storage overhead of using a dictionary compared to using a list to keep objects, but this is also minimal.<br /><br /><span style="font-weight:bold;"><br />Bottom-line: don't bother too much about creating your own "memory efficient" data structure instead of using a good and old dictionary (or similar, such as a class type). It's usually not worth trouble.</span><br /><br />Curiously, I noticed the common subexpression elimination does not <span style="font-weight:bold;">always</span> happen, and sometimes identical string constants are stored in different places in memory:<br /><br /><pre><br />>>> a<br />'my string'<br />>>> b<br />'my string'<br />>>> a is b<br />False<br />>>> id(a)<br />154424808<br />>>> id(b)<br />154424928<br /></pre><br /><br /><br />Something to discuss in a later post, I guess.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-8456486994701667991?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-90569576276121676802008-11-30T13:22:00.001-02:002008-11-30T13:27:01.436-02:00Sharing the USB 3G serial network of a Mac OS X with a VirtualBox guest machineWhen configuring networking on VirtualBox for Mac OS X, I got stuck because it didn't give me the option to use the "Host Interface" option with my ppp0 connection. The ppp0 connection is my "dial-up" Internet connection using a 3G USB modem.<br /><br />The solution is so obvious, that I'm surprised I couldn't think of it before finding <a href="http://forums.virtualbox.org/viewtopic.php?p=37658&sid=485edee6410389582ef8d79e0419e280">this post</a> on the VirtualBox forum: just use the (amazing) Internet sharing option of the Mac.<br /><br />- First, configure VirtualBox to use "Host Interface", and pick the "Ethernet" device down below.<br />- Then, Boot your guest OS (for example,<a href="http://debian-live.alioth.debian.org/"> Debian Live</a>, or <a href="http://haiku-os.org/">HaikuOS</a>) and use DHCP to configure the network.<br />- Finally, configure Internet sharing on the Mac OS X. Just share the "connection from: " .. "To computers using: Ethernet". Wait a few seconds, then force a reload of the DHCP configuration on the guest OS, and it's done!<br /><br />Now, the trick is how to make the network work on HaikuOS :-).<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-9056957627612167680?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-36674288211806307012007-07-26T01:02:00.000-03:002008-01-21T14:38:32.606-02:00Setting the default locale (language) in TurboGearsThe TurboGears <a href="http://docs.turbogears.org/1.0/Internationalization">documentation</a> only mentions this <span style="font-style: italic;">en passant</span>. It's easy to change the default locale (language) of your TG application.<br /><br />In your project/controllers.py, in you can add:<br /><br /><blockquote>def locale_pt():<br /> return 'pt'<br /><br />turbogears.config.update({'i18n.get_locale' : locale_pt})</blockquote><br /><br />I have this in the top namespace of my controllers.py file, not inside the Root class. I'm not sure if this is the prettiest way to make this work, but hey, it works for me. If you have any better suggestion, please leave a comment.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-3667428821180630701?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-48391897054844949422007-06-18T16:45:00.000-03:002008-01-21T14:39:13.759-02:00linux group passwords<p style="margin: 0px;"><span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-stretch: normal;font-family:Helvetica;font-size:100%;" >Group passwords is a sort of obscure feature most people don't use. It is safer *not* to have passwords set for groups.</span></p> <p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"><br /></p> <p style="margin: 0px;"><span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-stretch: normal;font-family:Helvetica;font-size:100%;" >By setting a password to a group, you allow an arbitrary users to be part of that group as long as they know the password. That generally doesn't make any sense unless you need to grant a shell user temporary access to a certain group. I don't even know if it works as advertised.</span></p> <p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"><br /></p> <p style="margin: 0px;"><span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-stretch: normal;font-family:Helvetica;font-size:100%;" >If you see this at webmin for example, you can safely ignore this option. For more information, see:</span></p> <p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"><br /></p> <p style="margin: 0px;"><span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-stretch: normal;font-family:Helvetica;font-size:100%;" ><a href="http://tldp.org/HOWTO/Shadow-Password-HOWTO-7.html">http://tldp.org/HOWTO/Shadow-Password-HOWTO-7.html</a></span></p> <p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"><br /></p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-4839189705484494942?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-1126218096847307892005-09-08T19:15:00.000-03:002005-09-26T10:44:11.783-03:00Suriproxy - Release soon"Release Soon, Release Often".<br /><br />Com esse mantra na cabeça, estou disponibilizando o Suriproxy, uma ferramenta anti-spam e, principalmente, anti-phishing.<br /><br />O suriproxy é um PROXY SMTPD para o Postfix, que filtra as mensagens<br />recebidas pelo daemon smtpd e repassa a outro daemon, seja um amavis ou outro<br />smtpd do postfix.<br /><br />Ele faz consultas URIBL de DNS quando encontra algum link nas mensagens,<br />ele consulta se o domínio deste link está nas listas URIBL (inclusive na<br />uribl.cetico.com).<br /><br />Veja o exemplo. Você recebe o e-mail com o seguinte texto:<br /><br /><a href="http://www.blable.net">CLIQUE AQUI</a><br /><br />ou ainda<br /><br /><a href="http://www.blable.net/virus-mal.scr">CLIQUE AQUI</a><br /><br />O Postfix pedirá que o Suriproxy verifique essa mensagem. Este, por sua vez,<br />irá consultar seus dominios URIBL (uribl.cetico.com e multi.surbl.org),<br />para ver se "blable.net" está em alguma dessas listas.<br /><br />Caso esteja, antes mesmo de se terminar a conexão SMTP, o Postfix mostrará<br />uma mensagem de erro, informando que aquele e-mail não foi aceito. Isso<br />evita que mensagens sejam perdidas, mas por outro lado não gera BOUNCES ou<br />tráfego desnecessário para você.<br /><br /><br />A instalação pode ser um pouco complexa para usuários iniciantes, principalmente porque ainda não tive tempo de escrever uma documentação bem detalhada.<br /><br />Além disso, em alguns casos, um bug ainda não resovido faz com que a ferramenta aja de forma inesperada, fechando conexões antes da hora, o que faz com que o servidor remoto tenha que enviar a mensagem novamente. Isso geralmente só acontece quando o host remoto envia mensagens lentamente.<br /><br />Para pegar o Suriproxy, <a href="http://www.cetico.org/suriproxy-0.13.tar.gz">siga este link</a>. Veja o README sobre instruções de instalação. Qualquer dúvida deixe um comentário aqui, que responderei assim que possível.<br /><br />Muito obrigado a todos pelo interesse :-).<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-112621809684730789?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com1tag:blogger.com,1999:blog-7021327.post-1126015008434808202005-09-06T10:38:00.000-03:002005-09-06T11:01:58.280-03:00Release do Mozilla Calendar 0.3a1 está próximaAparentemente, acompanhando o <a href="http://www.babylonsounds.com/blog.html">blog do Sipaq</a> e o <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=298936">tracking bug da release 0.3a1</a>, a nova versão pública está próxima.<br /><br />Na versão atual, o Sunbird tem muitos bugs sérios, que atrapalham a integração com serviços WebDAV. No meu caso, o Mozilla Calendar é item estratégico no projeto de migração de uma plataforma Microsoft Exchange. Sem um sistema de calendário robusto, é impossível deixar de usar o combo "Exchange+Outlook".<br /><br />O <a href="http://wiki.mozilla.org/Calendar:Home_Page">Wiki</a> é outra fonte de informações sobre o projeto.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-112601500843480820?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-1124854133907193712005-08-24T00:25:00.000-03:002005-08-24T00:39:26.803-03:00Como usar o Google Talk no seu cliente Jabber preferido para Windows<a href="http://www.cetico.org/blog/2005/08/how-to-use-google-talk-using-your.html">English</a><br /><br />O Google irá lançar o <a href="http://talk.google.com">Google Talk</a> amanhã, mas você já pode se conectar.<br /><br />Basta usar um cliente Jabber completo, como o <a href="http://gaim.sourceforge.net">Gaim</A> ou Exodus.<br /><br /><a href="http://ufpr.dl.sourceforge.net/sourceforge/gaim/gaim-1.5.0.exe">Download do Gaim</a><br /><br /><a href="http://exodus.jabberstudio.org/daily/setup.exe">Download do Exodus</a><br /><br />Os dados que voce precisa são:<br /><br />Servidor: talk.google.com<br />Porta: 5222<br />Usuario: seugmail@gmail.com (com domínio)<br />Senha: sua senha do gmail<br /><br />Boa sorte!! :-)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-112485413390719371?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com1tag:blogger.com,1999:blog-7021327.post-1124853905223901962005-08-24T00:17:00.000-03:002005-08-24T00:25:05.230-03:00How to use Google Talk using your preferred Jabber Client for WindowsGoogle will launch tomorrow its instant messaging service.<br /><br />You can connect to it using any Jabber full client for Windows, like Gaim or Exodus (I could not make it work with Miranda, a great client).<br /><br />You need to setup the following:<br /><br />Server: talk.google.com<br />User: youremail@gmail.com (with the domain part)<br />password: yourpass<br />port 5222<br /><br />Add me if you want :-) yves.junqueira@gmail.com<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-112485390522390196?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-1122593247077575322005-07-28T20:24:00.000-03:002005-07-28T20:34:37.063-03:00CACIC - Agente para Linuxhttp://www.cetico.org/cacic/cacic-agente-linux-1.0rc1.tar.gz<br /><br />Essa é a versão 1.0RC1 do agente para Linux. Acredito que ela está<br />praticamente pronta para ser disponibilizada publicamente - por isso é<br />o Release Candidate 1.<br /><br />Algumas mudanças dessa pra última, são:<br /><br />- Criado script de instalação "install.sh" (não serve para<br />atualização, apenas para a primeira instalação).<br /><br />- Melhor consistência nas mensagens de saída e interatividade com o usuário.<br /><br />- Melhor organização do código.<br /><br />- Agente irá entender a configuração "MACs Inválidos".<br /><br />- Agente irá entender quando uma determinada "etiqueta" da coleta de<br />patrimônio for desativada.<br /><br />- Corrigidos outros bugs. (Ver bugzilla).<br /><br /><br />Sugestões de metas para a próxima versão:<br />(por favor, dêem palpite também)<br /><br />- Atualização automática<br /><br />- Coletar informações de placa de vídeo, etc<br /><br />- Coletar informações de "compartilhamentos" Samba e NFS.<br /><br />- Melhorar organização do código (argh).<br /><br /><br />Eu pessoalmente prefiriria, entretanto, começar a mexer no gerente.<br /><br /><br />Mais informações sobre o desenvolvimento em:<br /><br /><a href="http://www.cetico.org/wiki">http://www.cetico.org/wiki</a><br /><br /><br /><a href="http://listas.cidades.gov.br/cgi-bin/mailman/listinfo/cacic-agente-linux">http://listas.cidades.gov.br/cgi-bin/mailman/listinfo/cacic-agente-linux</a><br /><br /><a href="http://www.governoeletronico.gov.br/cacic">http://www.governoeletronico.gov.br/cacic</a><br /><br /><br />- Yves Junqueira<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-112259324707757532?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com1tag:blogger.com,1999:blog-7021327.post-1118879478137117502005-06-15T20:49:00.000-03:002005-06-15T20:51:18.136-03:00Delete print jobs in cups - cupsdTo delete print jobs in cups in a Linux system you should use this command:<br /><br /># lprm <job id><br /><br />Or, to cancel all jobs:<br /><br /># lprm -<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-111887947813711750?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com1tag:blogger.com,1999:blog-7021327.post-1118879368299055372005-06-15T20:48:00.000-03:002005-06-15T20:49:28.300-03:00list print jobs in cups or cupsdTo list print jobs in cups, issue:<br /><br /># lpq -a<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-111887936829905537?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-1118879293784231672005-06-15T20:47:00.000-03:002006-08-01T17:29:23.513-03:00tdb(/var/cache/samba/printing.tdb): rec_free_read bad magic 0x0 at offset=21104[2005/06/15 20:33:36, 0] tdb/tdbutil.c:tdb_log(531) tdb(/var/cache/samba/printing.tdb): rec_free_read bad magic 0x0 at offset=21104<br /><br />If you find something like this in your logs, and you can't print, just remove the file and restart samba.<br /><br />Visit my sponsors if you find this information and their ads useful hehe.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-111887929378423167?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com2tag:blogger.com,1999:blog-7021327.post-1118254128544016952005-06-08T15:03:00.000-03:002005-06-08T15:08:48.550-03:00Jun 8 14:57:50 rinetd[21939]: accept(0): Socket operation on non-socketFor the record.<br /><br /><blockquote>Jun 8 14:57:50 <host> rinetd[21939]: accept(0): Socket operation on non-socket</host></blockquote><br /><br />I had this syslog message filling my hard disk due to a configuration problem of rinetd.<br /><br />I was setting it to list in a IP address which was not set to the network interfaces. I usually setup many IP's for external interfaces in a host. I had disabled a certain IP for some time (ip addr del ..) and rinetd got crazy.<br /><br />Fix: check what IP it is trying to listen in.<br /># /etc/init.d/rinetd stop<br /><br /># tail -f /var/log/syslog |less<br /><br />in another screen:<br /><br /># /etc/init.d/rinetd start<br /><br />You will see:<br /><br /><blockquote>Jun 8 14:57:48 <host> rinetd[21939]: couldn't bind to address <ip.ip.ip.ip> port <port> (Cannot assign requested address)<br />Jun 8 14:57:48 <host> rinetd[21939]: Starting redirections...</blockquote><br /><br />Then just go and remove that reference in rinetd.conf and you're done.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-111825412854401695?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-1118158195549495102005-06-07T11:40:00.000-03:002007-01-24T11:32:33.423-02:00PF-Graph - Solução para análise de logs do Postfix<span style="font-size:85%;">Estou desenvolvendo uma ferramenta para análise de logs do Postfix. O PF-Graph, além de gerar relatórios com base em remetentes ou destinatários (incluíndo busca por domínios), cria gráficos coloridos sobre o status do serviço.</span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;">Veja abaixo algumas screenshots:</span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;"><a href="http://img212.echo.cx/my.php?image=pfgraph9lj.png" target="_blank"><img alt="Free Image Hosting at www.ImageShack.us" src="http://img212.echo.cx/img212/2430/pfgraph9lj.th.png" border="0" />PF-Graph, mostrando o sumário de gráficos.</a></span><br /><br /><br /><br /><a href="http://img279.echo.cx/my.php?image=pfgraph23dm.png" target="_blank"><img alt="Free Image Hosting at www.ImageShack.us" src="http://img279.echo.cx/img279/4962/pfgraph23dm.th.png" border="0" /><span style="font-size:85%;">Resultado de busca </span></a><br /><br />Entre os recursos do PF-Graph, incluem-se:<br /><br />- Capacidade de auditar todas as mensagens recebidas e enviadas em um ou mais servidor de e-mail, em tempo real.<br /><br />- Um daemon/agente rodando nos servidores de e-mail é responsável por coletar as informações em tempo real, e atualizar o banco de dados.<br /><br />- Capacidade de mostrar total de bytes trafegados para um usuário, domínio ou qualquer termo de busca(exige Amavisd-new ou Suriproxy).<br /><br />- Escrita em Perl, com integração nativa para MySQL, mas possível de se adaptar para outros bancos de dados, conforme a necessidade.<br /><br /><br />Assim que eu der uma "limpada" no código do PF-Graph, o mesmo será disponibilizado sob a licença GPL. Caso esteja interessado nessa ferramenta, deixe um comentário!<br /><br />Até mais!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-111815819554949510?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com9tag:blogger.com,1999:blog-7021327.post-1118124947223396722005-06-07T03:13:00.000-03:002006-07-29T17:22:02.906-03:00004 dk.eos.net.FtpError: Login incorrect.If you get this error in blogger, even if you are using blogspot.com, not FTP:<br /><br /><div class="error" id="verboseStatus" style="display: block;"><blockquote>004 dk.eos.net.FtpError: Login incorrect. </blockquote><br /><br />You can fix it by cleaning your browser cache, or just using a different browser temporarily (ie <-> firefox).<br /></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-111812494722339672?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com12tag:blogger.com,1999:blog-7021327.post-1118123207879938382005-06-07T02:18:00.000-03:002007-02-09T10:30:03.323-02:00How to crack Windows Terminal Services 3 month trialHOW TO RESET WINDOWS TERMINAL SERVICES 3 MONTH TRIAL<br />Warning: greyhat content.<br /><br />Thanks to a Microsoft article, I've found out that it is very easy to extend your Windows Terminal Services 3-month trial or experience time. It's so easy that I'm sure many administrators have done this in their own systems, while waiting for their managers or financial staff to buy the definitive licenses (not being hypocrite here).<br /><br />Following these instructions, you don't have to crack any program. You won't mess with your system. The magic is to only delete the licenses databases both in the server and the clients, and let windows re-create them for you.<br /><br /><br />----<br /><br />Make sure you've installed "Terminal Services Licensing". By the way, this method only makes sense if you need to use Terminal Services in Application Mode, which is the one that requires licensing.<br /><br />The idea is quite simple.<br /><br />First, disconnect all users from the terminal. If you need to do this remotely, you can also disconnect yourself, and access the files remotely.<br /><br />Go to %WINDIR%\system32\lserver<br /><br />Notice the file TSLIC.edb. Rename it to tslic.old<br /><br />In every client computer, remove the CAL TS registry keys, located at:<br /><br />HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing<br /><br />Restart your server.<br /><br /><br />Finally, if you need more information about how to crack terminal services, <a href="http://support.microsoft.com/?id=839878">go check at Microsoft's web site.</a> See the "Cause 2" steps. :-)<br /><br />Shouldn't MS improve the security for TS Licensing in the next versions of Windows (2003 with SP1 is also easy to "crack")?<br /><br />PS> I am definitely against software piracy. I strongly believe that Microsoft should strength their anti-piracy policy. Only then they could theoretically lower their licensing prices. The biggest result, though, would be a huge increase of free software popularity. Only then we, FOSS proponents, would have the opportunity to prove our paradigm is superior (now I'm being hypocrite, I guess).<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-111812320787993838?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com99tag:blogger.com,1999:blog-7021327.post-1118120711035806822005-06-07T02:01:00.000-03:002005-06-07T02:05:11.036-03:00New home: cetico.orgGreat. As GoDaddy's prices are so low, I've decided to pay for a web hosting (so cheap!) and host this blog there.<br /><br />Unfortunately I've lost my old site's layout, so I'll have to start that from stratch. Argh. It's so painful to draw web sites. I'll see if Macromedia can give me hand (Fireworks, Dreamweaver, etc).<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-111812071103580682?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-1116970274769386682005-05-24T18:12:00.000-03:002005-06-07T01:11:26.526-03:00tail-nagios information and source codeHi.<br /><br />Some fellows from nagios-users list have requested more information about my solution to integrate nagios 2.0 with mysql, so here it is.<br /><br />Since nagios 2.0 doesn't have built-in support for mysql, we have to find another way to integrate this software with a custom interface that reads a database.<br /><br />A way to do that is to use service performance data (service_perfdata).<br /><br />You'll need to setup service_perfdata_file to a "log" of service perfomance data, and design a service_perfdata_file_template.<br /><br />In my case, I used:<br /><br />service_perfdata_file=/usr/local/nagios/var/service-perfdata<br />service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t<br />$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$<br />\t$SERVICEPERFDATA$\t$SERVICESTATETYPE$<br /><br />(singe line)<br /><br />Then, after restarting nagios, and if you don't forget to check permissions for that perdata file, nagios will start to append service check output to this file.<br /><br />The next step is to read this file and update a database as we want.<br /><br />In my case, I've designed a simple table that will list every server and service and their latest status combined in a "object" row.<br /><br /><br />> describe status;<br />+--------+--------------------------+------+-----+---------+-------+<br /> Field Type Null Key Default Extra <br />+--------+--------------------------+------+-----+---------+-------+<br /> objeto varchar(45) PRI <br /> tipo varchar(45) <br /> status varchar(45) <br /> output varchar(255) <br /> time int(16) unsigned YES NULL <br /> hard int(1) unsigned zerofill 0 <br />+--------+--------------------------+------+-----+---------+-------+<br /><br /><br />> select * from status limit 1;<br />+-----------------------+---------+--------+------------------------------------------------------+------------+------+<br /> objeto tipo status output time hard <br />+-----------------------+---------+--------+------------------------------------------------------+------------+------+<br /> adsl-router.LINK_ADSL servico OK HTTP OK HTTP/1.0 200 OK - 1.113 second response time 1116971094 1 <br />+-----------------------+---------+--------+------------------------------------------------------+------------+------+<br /><br /><br />"objeto" means "object" and "tipo" means "type" (unused, actually).<br /><br /><br /><br /><br />The script to read the logs and update the database is:<br /><br />---------------------------------------------------------------<br />#!/usr/bin/perl -w<br /><br /># tail-nagios<br /># v. 0.001<br /># Yves Junqueira - yves.junqueira AT gmail.com<br /># License: GPL<br /><br />use strict;<br /><br />use DBI;<br />use File::Tail;<br /><br />my $driver = "mysql";<br />my $user = "nagios";<br />my $password = "mypass";<br />my $database = "nagios";<br /><br />my $oldlogs = 0;<br />my $verbose = 0;<br /><br />my $name = '/usr/local/nagios/var/service-perfdata';<br />my $file = File::Tail->new(<br />name => $name,<br />interval => 3,<br />adjustafter => 5,<br />tail => -1<br />);<br /><br />print "Tail Nagios\n";<br />my $dsn = "DBI:$driver:dbname=$database";<br /><br />my $dbh =<br />DBI->connect( $dsn, $user, $password, { RaiseError => 1, AutoCommit => 1 } )<br />or die "could not connect $!";<br /><br />my $sth =<br />$dbh->prepare(qq[select time, objeto from status order by time DESC LIMIT 1]);<br /><br />$sth->execute();<br /><br />my ( $lasttimestamp, $lastobjeto ) = $sth->fetchrow;<br /><br />$lasttimestamp = 0;<br />$lastobjeto = 0;<br /><br />my $count = 0;<br />my $nextok = 0;<br />my $lastcommit = 0;<br /><br />my $sth2 = $dbh->prepare(<br />qq[<br />replace into status (objeto, tipo, status, output, time, hard) values<br />(?,?,?,?,?,?)]<br />);<br /><br />while ( defined( $_ = $file->read ) ) {<br /><br />#[SERVICEPERFDATA] 1111058462 roteador-cpd1 PING OK<br /># 4.008 0.135 PING OK - Packet loss = 0%, RTA = 1.32 ms<br />s/[\n\r]//g;<br /><br />my (<br />$i, $time, $maquina, $servico, $status,<br />$checkduration, $latency, $output, $etc, $statetype<br />)<br />= split /\t/;<br /><br />if ( ( $time < $lasttimestamp ) && ( $oldlogs != 1 ) ) { #print "."; } else { if ( ( $time > $lasttimestamp ) ( $oldlogs == 1 ) ) {<br /><br />my $hard = ( $statetype eq "HARD" ) ? 1 : 0;<br /><br />if ( $verbose >= 1 ) { print "Insert this!\n"; }<br />$sth2->execute( $maquina . "." . $servico,<br />'servico', $status, $output, $time, $hard )<br />or die "Argh $!";<br />}<br />}<br />}<br />if ( $verbose >= 1 ) { print "Finish. Will commit\n"; }<br />print "1\n";<br />$dbh->commit()<br />or print "oh no! $!\n"<br />; # I don't even need this since AutoCommit is on. But someday I can turn it on...<br />print "2\n";<br />$sth->finish() or print "sth finish booo $!\n";<br />print "3\n";<br />$sth2->finish() or print "sth2 finish aaaaaaaaaa $!\n";<br /><br />print "4\n";<br />$dbh->disconnect();<br />print "end\n";<br /><br />#1;<br /><br /><br />---------------------------------------------------------------<br /><br />This script is not a daemon actually, but I run the following script in the crontab, that checks if it's running, and starts tail-nagios if necessary.<br /><br />-------------------- tnagios-monitor.sh -----------------------<br />#!/bin/sh<br />pidof -x tail-nagios 2>&1 > /dev/null (echo "Starting tail-nagios" ; /usr/local/bin/tail-nagios &)<br /><br />---------------------------------------------------------------<br /><br />A desirable /etc/crontab follows:<br /><br />*/5 * * * * root /usr/local/sbin/tnagios-monitor.sh<br /><br /><br />Well that's almost all you need.<br /><br />Sorry if it's a mess, but it serves my needs.<br /><br />If you need more information, or maybe is interested in the perl+apache user interface that shows services status, please let me know.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-111697027476938668?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-1116852183609345672005-05-23T09:11:00.000-03:002006-06-12T03:23:43.933-03:00Sistema de monitoramento de serviços e servidoresMonitorar o status de serviços e servidores de TI é uma tarefa complexa, mas bastante importante.<br /><br />Para um administrador - pelo menos para mim - ser o último a saber que um serviço saiu do ar é extremamente constrangedor. Com essa preocupação, planejei um sistema de monitoramento de serviços que fosse confiável e flexível. O primeiro desafio, entretanto, seria adaptar a feia interface do Nagios a um sistema mais "visual" e intuitivo.<br /><br />Uma interface mais simples, flexível e bonita. Se tudo corresse como planejado, no final do processo poderíamos até utilizar equipamentos de monitoramento, à vista de todos no prédio da administração da empresa. A idéia era dar maior transparência na adminstração de TI, porém sem deixar de lado os cuidados com a segurança de informações.<br /><br />Utilizei a nova árvore 2.0, ainda beta, do nagios, para que o projeto pudesse acompanhar melhor as futuras versões desse software.<br /><br />Para isso, foi necessário desenvolver um sistema de "conexão" do nagios 2.0 com o mysql, visto que não havia nada pronto nesse sentido, quando o projeto foi iniciado.<br /><br />Um processo daemon é utilizado para monitorar as verificações do Nagios, e atualizar o banco de dados com as informações necessárias.<br /><br />Além disso, há grande disponibilidade de plugins para monitoramento de serviços e servidores. Havia a opção inclusive de utilizar softwares que fizessem uma maior integração com os servidores Windows, inclusive via WMI, mas preferi não aumentar a complexidade da estrutura já existente.<br /><br />Veja os resultados:<br /><br /><a href="http://img229.echo.cx/my.php?image=nagiosui2wk.jpg" target="_blank"><img alt="Free Image Hosting at www.ImageShack.us" src="http://img229.echo.cx/img229/8452/nagiosui2wk.th.jpg" border="0" /></a> <span style="font-size:78%;">- Interface para o Nagios, utilizando ícones funcionais do MS Visual Studio. (utilizando em Full-screen, mas mostrando barras do IE apenas para contextualização)</span><br /><br /><br /><a href="http://img267.echo.cx/my.php?image=nagiosmon4lt.jpg" target="_blank"><img alt="Free Image Hosting at www.ImageShack.us" src="http://img267.echo.cx/img267/5052/nagiosmon4lt.th.jpg" border="0" /></a><span style="font-size:78%;">- Ao fundo, monitores mostram o status de serviços essenciais de TI.</span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-111685218360934567?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com1tag:blogger.com,1999:blog-7021327.post-1106728906235670942005-01-26T06:33:00.000-02:002005-01-26T06:41:46.236-02:00Good news - Batman Begins is from a decent director: Christopher NolanBatman Begins, the next movie about Batman to be released soon, was directed by Christopher Nolan, the director of Memento, which was a really great movie, and Insomnia.
<br />
<br />Although it can be better than those terrible prequels, we shouldn't not expect the quality of Tim Burton's now classics Batman and Batman Returns.
<br /><h1></h1> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-110672890623567094?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0tag:blogger.com,1999:blog-7021327.post-1106728368493264842005-01-26T06:30:00.000-02:002005-01-26T06:32:48.493-02:00ArghJoel Schumacher is the worst movie director in hollywood.
<br />
<br /><a href="http://www.imdb.com/name/nm0001708/">Check his filmography at IMDB.</a>
<br /><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021327-110672836849326484?l=i-admin.blogspot.com'/></div>Yves Junqueirahttp://www.blogger.com/profile/00104361785049371212yves.junqueira@gmail.com0