make it simple, let go :)

A lot of things happened to me personally for the past few months that I basically forgot about writing on my blog. The past months has been nothing but blissful to say the least :)

The first thing that I thought when I logged in to my WordPress account was: how can I make this simple? It doesn’t make sense anymore to maintain multiple blogs… It’s an overhead.

It’s time to delete. Let go. :)

P.S. It’s good that the Import/Export functionality of WordPress worked flawlessly :)

QuickFix: Cleaning up Puppet master’s report logs

OK… Our puppet master’s disk is slowly filling up with logs… We have around 70+ nodes already so no wonder it’s filling up at a high rate:

marionette-disk

I’ve known about the problem since 2 weeks ago but I always had an excuse to put it in my “next” to-do pile….

Well, today I can’t ignore it anymore since it’s almost full :)

So off to Google and do a little searching… And this is the best answer that I got:

tidy { "/var/lib/puppet/reports":
  age => "1w",
  recurse => true,
}

Duh! Use puppet to clean-up Puppet logs! *facepalm* (I felt stupid when I realized this…)

After knowing a new puppet type, I was excited to do a test run: puppet agent -t

Well… The ruby process ran for a few a minutes but it did nothing! Hmmm… I figured maybe because the number of files is staggering that’s why the puppet run can’t handle it. After all, I have >4GB worth of log files in /var/lib/puppet/reports/.

So a little help is needed then. I ran these commands to give puppet a hand:
find /var/lib/puppet/reports/ -type f -ctime +7 | xargs -P 4 -n 20 rm -f

And the next succeeding puppet runs worked like a charm :)

marionette-disk1

QuickFix: Can’t install puppetdb via puppet modules in AWS Linux

I was trying to install PuppetDB for my Puppet deployment using this guide.

And then when I ran puppet agent -t, my terminal was full of red error messages:

Notice: /Stage[main]/Postgresql::Initdb/Exec[postgresql_initdb]/returns: creating directory /var/lib/pgsql/data ... initdb: could not create directory "/var/lib/pgsql": Permission denied
Error: /usr/bin/initdb --encoding 'UTF8' --pgdata '/var/lib/pgsql/data' returned 1 instead of one of [0]
Error: /Stage[main]/Postgresql::Initdb/Exec[postgresql_initdb]/returns: change from notrun to 0 failed: /usr/bin/initdb --encoding 'UTF8' --pgdata '/var/lib/pgsql/data' returned 1 instead of one of [0]

My quick fix:
[root@-----]$ cd /var/lib/ && ln -s pgsql9/ pgsql

HW: Upgrading the workhorse from 4GB to 16GB – Macbook Pro 2012

It’s really been a while since my last post. A lot has changed since then. I have been thinking on how can I start writing again for a while. I decided to start with something light.

I was assigned with a stock MBP 2012 in my new job. Core i5, 4GB… blah blah.. just stock specs. It was OK for a while but I started hitting the 4GB ceiling when I started playing around with VMs or if I’m processing 19k+ photos in Aperture.

Things just got sloooowww…. It’s a no brainer that I really need to add more RAM. Lots of it.

So I started checking online if where can I buy RAM with best bang-for-the-buck. I paid a visit to that trusty TipidPC site. I decided to get this item. It’s a Crucial 16GB (8×2) CT2K8G3S160BM memory sticks. I managed to buy it yesterday for 4,400PHP (109USD). And after a series of meetings at work, I finally got it installed last night when I got home.

This is how it went…

First, I checked for a good tutorial, iFixit has a good step-by-step guide here.

I removed the back panel as indicated in the guide…
IMG_6261

Then I disconnected the battery. I had to do this slowly, wiggling it side to side (slowly) until it got loose.
IMG_6262

When I checked the memory (Samsung M471B5773DH0-CK0), I was surprised to see a “Made in the Philippines” sticker :)
IMG_6263

Removing the top RAM module is easy. Removing the second one will require some finesse and a little patience.
IMG_6265

Now that the “old” modules are out, I replaced it with the “new” ones.
IMG_6266

Time to close it and cross fingers when I press the power button.
IMG_6267

So I guess it worked!
IMG_6269

Just to be sure I ram memtest for Mac OS X as well. I used this site as reference. After running memtest, no red flags were raised. That’s good! :)

Screen Shot 2013-03-13 at 8.27.53 PM

References:

rsyncd won’t bind problem, determine what pid uses a port

We had a problem with one of our server. It’s rsyncd is not responding anymore. It’s listening to the port but it’s not accepting requests.

Here’s what the log says:

[root@SERVER ~]# tail /var/log/messages
Jun 21 13:19:46 SERVER xinetd[28270]: Swapping defaults
Jun 21 13:19:46 SERVER xinetd[28270]: readjusting service amanda
Jun 21 13:19:46 SERVER xinetd[28270]: bind failed (Address already in use (errno = 98)). service = rsync
Jun 21 13:19:46 SERVER xinetd[28270]: Service rsync failed to start and is deactivated.
Jun 21 13:19:46 SERVER xinetd[28270]: Reconfigured: new=0 old=1 dropped=0 (services)
Jun 21 13:21:34 SERVER xinetd[28270]: Exiting...
Jun 21 13:22:09 SERVER xinetd[32476]: bind failed (Address already in use (errno = 98)). service = rsync
Jun 21 13:22:09 SERVER xinetd[32476]: Service rsync failed to start and is deactivated.
Jun 21 13:22:09 SERVER xinetd[32476]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
Jun 21 13:22:09 SERVER xinetd[32476]: Started working: 1 available service

We tried stopping xinetd but there is still a process bound to the 873 port:

[root@SERVER ~]# service xinetd stop
Stopping xinetd: [ OK ]
[root@SERVER ~]# telnet localhost 873
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
^]
telnet> quit
Connection closed.

If only we could determine what process is still bound to the 873 port…

Well, there’s an app for that: lsof -i tcp:<port>

[root@SERVER ~]# lsof -i tcp:873
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
rpc.statd 1963 rpcuser 7u IPv4 4798 TCP *:rsync (LISTEN)
[root@SERVER ~]# kill 1963
[root@SERVER ~]# kill 1963
-bash: kill: (1963) - No such process
[root@SERVER ~]# telnet localhost 873
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused

Now that the process is dead, we restarted xinetd…

[root@SERVER ~]# service xinetd start
Starting xinetd: [ OK ]
[root@SERVER ~]# tail /var/log/messages
Jun 21 13:21:34 SERVER xinetd[28270]: Exiting...
Jun 21 13:22:09 SERVER xinetd[32476]: bind failed (Address already in use (errno = 98)). service = rsync
Jun 21 13:22:09 SERVER xinetd[32476]: Service rsync failed to start and is deactivated.
Jun 21 13:22:09 SERVER xinetd[32476]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
Jun 21 13:22:09 SERVER xinetd[32476]: Started working: 1 available service
Jun 21 13:23:06 SERVER xinetd[32476]: Exiting...
Jun 21 13:25:18 SERVER rpc.statd[1963]: Caught signal 15, un-registering and exiting.
Jun 21 13:25:18 SERVER portmap[3556]: connect from 127.0.0.1 to unset(status): request from unprivileged port
Jun 21 13:25:31 SERVER xinetd[3912]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
Jun 21 13:25:31 SERVER xinetd[3912]: Started working: 2 available services

… and that solves the problem. :)

References: