Translate

Archive for October, 2009

Geek T-Shirt Collection #18 – sick PWNAGE!

Monday, October 26th, 2009

Geekshirt #18 - Sick PWNAGE! - MyBloop.com (front)

After working with Fitim and the crew at MyBloop, them being avid Starcraft, Diablo, WOW, Warhammer and many other RPG style games, they instilled in me the phrase “To Pwn” or “Pwnage” whenever we did something difficult in terms of programming or linux hacking when working on MyBloop.com. It was a way to say that we’d be superior to other developers who had no clue about the shit we were pulling off on that bare-bones-cheap-custom-hardware-file-server-cluster-web-app of ours.

Geekshirt #18 - Sick PWNAGE! - MyBloop.com (back)

When something was over the top we’d say “Sick Pnwage”. If we’d be coding during the weekend we’d say “I’ll be Pwning this weekend”, and so on.

I liked the phrase so much that had to make a t-shirt to commemorate it for years to come.

See the Previous T-Shirt

See the Next T-Shirt

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Book Attention Deficit Disorder

Wednesday, October 21st, 2009

After I started working from home, and not commuting I realized the best time I had to read every day was the subway ride to and back from work.

I guess it was sort of a guilty pleasure to sometimes wish for the subway train to not arrive so early so you could read a little more before you got to work.

Now, between work, marathon training and life, I barely have any time left to read and I sometimes feel guilty to take the time to read. Usually I do so right before I go to bed, and I can only keep my eyes open for maybe 10 minutes so I’m not progressing in any of these very much.

I guess public transit commuting wasn’t so bad after all.

What do you advise? Should I read one by one? take a whole weekend and do nothing but read? How do you fight sleepiness?

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Quick N Dirty way to Map Commands to remote servers via ssh

Saturday, October 10th, 2009

You may be running several independent but similar servers at the same time and wasting time by executing commands in all of them one by one.

Wouldn’t it be nice to send a command to all of them at once? or to monitor all of them at once.

The following script can be used as a building block to more complex automation tasks for a small size set of servers. (If you’re managing over 50 servers, I’d probably consider looking a different way to arrange servers (map/reduce cluster), but if you’re doing something below that number this might suffice)

#!/usr/bin/python                                                                                                                                                                                                                                                      

#########################################################
# Author: Angel Leon (gubatron@gmail.com) - October 2009
#
# Invokes a command locally and invokes the same command
# in all machines under the specified username, servers
#
# Requirement: Have a public ssh_key for that user on all
# the other machines so you don't have to authenticate
# on all the other machines.
#########################################################
import sys
import os

# set the username that has access to all the machines here
user='safeuser'

# add all your server names here
servers=['server1.mydomain.com','server2.mydomain.com','server3.mydomain.com']

if __name__ == "__main__":
  if len(sys.argv) < 2:
    print "Usage: ssh_map_command <cmd>"
    sys.exit(0)

  cmd= ' '.join(sys.argv[1:])

  #Execute locally first
  print cmd
  os.system(cmd)

  #Execute for all the servers in the list
  for server in servers:
    remote_cmd="ssh %s@%s %s" % (user,server,cmd)
    print remote_cmd
    os.system(remote_cmd)
    print

Save as ssh_map_command and chmod +x it.

Sample uses
Check the average load of all machines at once (then use output to mitigate high load issues)

$ ssh_map_command uptime

Send HUP signal to all your web servers (put it in an alias or other script… and that’s how you start building more complex scripts)

$ ssh_map_command ps aux | grep [l]ighttpd | kill -HUP `awk {'print $2'}`

Check if processes are alive, check memory usage on processes across different machines, grep remote all logs at once, svn up on all machines, rsync from one to many, hey, you can even tail -f and grep all the logs at once, you can go nuts with this thing. Depends on what you need to do.

Requirements

Security Advisory
Make sure only the desired user has read/write/execute access to it and keep your private ssh keys safe (preferably only read and execute for the owner, and no permissions whatsoever to anybody else chmod 500 ssh_mod_map), if possible change them as often as possible, for it may become a big security whole if an attacker can manage to write code on this script, specially if you have cronjobs invoking it. Your attacker would only need to change code here to mess up all of your machines.

Disclaimer and Call for Knowledge
Please, if someone knows of a standard way to map commands to multiple servers, please let me know in the comment section, in my case I needed a solution and I wrote a quick and dirty python script and tried to secure it as best as I could, by no means I’m saying that this is the best solution to mapping commands, in fact I believe it might be the least efficient way, however it works good enough for my personal needs.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Ubuntu/Debian Quick Reference: How To Change Your Server’s UTC Timezone on the command line

Saturday, October 10th, 2009

Just Type…
sudo dpkg-reconfigure tzdata

…and follow the instructions on screen.

The process should look something like the following:


Select your Region


Select a city on your time zone


You’re done.

Tip
You can always check the status of your configuration using
sudo debconf-show tzdata

You could for example map that command via ssh to several machines and grep for “*”, that way you could easily spot servers with wrong timezones very quickly.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Unboxing and PhotoReview of Macbook PRO 15-inch

Tuesday, October 6th, 2009

Click here to see and read the rest. Check out the descriptions and mouse over the images to learn the details.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Geek T-Shirt Collection #17 – error_reporting(E_STRICT)

Saturday, October 3rd, 2009

I made this one when I was at the peak of my PHP fever. It was an homage to perl’s “use strict”

See the previous T-Shirt

See the next T-Shirt

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Why I couldn’t go back once I had a Mac

Friday, October 2nd, 2009

Whenever I try to explain why I’m now a Mac user and why I certainly don’t intend to buy anything different than a Mac (unless something really superior comes along) and even though you could probably get a super duper machine with cheaper parts, I always say that it’s all in the details, and they’re so many that I can’t really answer people which are.

The purpose of this post, is to keep track of those “a-ha” details as I come across them. I’ll update this post as more details come along on my day to day.

  • The Power Adapter of the Mac is magnetically shielded. You can put it on top of your computer while it’s still on and you won’t be afraid of loosing data. Not IBM’s Thinkpad’s power adapters are magnetically shielded
  • The Ethernet port on the Macbook PRO makes regular ethernet cables work like Cross-over ethernet cables. This really comes in handy if you have another computer next to you and there’s not an ethernet switch nearby. You can just connect directly to that machine, share your internet, transfer files, no need to ask anybody for a cross over cable. This has been this way for years (at least since 2006), I’m not sure if HP or other laptops have these super duper ethernet cards in them.
  • Back-lit keyboard. A blessing when coding in the darkness for those of us that sometimes need to look down for a special key. Oh and it will light up when it’s actually dark, freaking awesome.
  • Multi touch touchpad (way before many other laptops started implementing it). Double finger tap for right click? can’t live without it
  • Awesome battery life, and this is a pretty known fact about macbooks
  • I haven’t had my OS crash in … I can’t remember last time it crashed fully
  • Very quiet fan
  • The power adapter connector has that little magnet, people can trip over it and it won’t pull your laptop to the floor

  • The power adapter is modular, basically you can decide whether or not to carry with you a long ass cable or keep the adapter with the smaller patch cord that goes to your computer. Also you can switch it’s connector to the European style connector which comes with the computer. It seems apple knows its user base might travel abroad sometime

  • The power adapter has these two ears which can open and close. Their purpose is to let you wrap the thinner cable that goes to the computer. It’s great if you don’t want to have too much cable laying around or when you’re on the go and you need to wrap up things inside your bag. Kudos to the designers of the Power Adapter

  • As for the OS goes, I consider it a Linux where everything works right off
  • In Mac OSX everything just works as expected or better. Some good examples of things that work better than in other OSes are Wireless configuration, Internet Sharing, Multiple Display configuration is amazingly intuitive to set up
  • My last Macbook PRO I’ve been using it for almost 3 years and there’s no real need to get a new one, it’s still pretty fast after 2 major Mac OSX upgrades
  • The Sleep and Wake up functionality actually work, I can’t say the same for my Alienware and Vista, where sometimes it will never wake up, or it won’t really be sleeping and it’ll get all hot and kill the battery
  • If you ever open the Macbook, it’s a like a “work of art” inside. The way they’ve arranged everything, changing a hardrive or the keyboard is very easy and quite fun
  • The native tool for screen shots is really convenient, not only for all the different ways in which you can snap your screen, but it’s also a nice pixel measuring tool for web developers and graphic designers
  • Having a console, which comes with all the standard linux tool makes you remember windows and it’s cmd.exe and laugh about how arcaic it is
  • Being able to have the Automator to Visually Script things like Resizing a Bunch of Pictures and copying them somewhere else once you’ve downloaded big resolution images from your camera and you want to upload them to flickr… priceless
  • /Applications/Utilities/Console.app – a debugging blessing to find out why things might be going wrong with a specific process. I should probably not brag about the software since that’s getting into Mac OSX realm and that’s a whole different subject of why you can’t go back, again Linux that works right off, or Linux for Dummies.
  • Pressing Space bar over files on the Finder brings that super fast preview for Images, PDFs, Videos and even audio files
  • Being able to Customize the Finder adding and removing buttons to simplify or specialize it (equivalent of Windows Explorer)
  • Burning CD/DVDs is amazingly simple, no need for 3rd party software
  • Typing on a Mac keyboard is addicting, feels really good on the finger tips, the sound of it is music to my ears
  • No more viruses to fear, or antiviruses to slow you down

[buzz href="http://www.google.com/buzz/gubatron2/gmt5cXWcr9P/Why-I-couldnt-go-back-once-I-had-a-Mac-http-www" liked="25"]

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)


  • Categories

  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • October 2009
  • September 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004