aggregated thinking http://tech.doblados.net mashed bits that go well with coffee, code, and servers posterous.com Sat, 24 Jul 2010 05:00:00 -0700 How to count instances of an IP address in a log file http://tech.doblados.net/how-to-count-instances-of-an-ip-address-in-a http://tech.doblados.net/how-to-count-instances-of-an-ip-address-in-a

I was looking for a quick and painless way to determine what IP addresses used our web app the most and stumbled across this excellent post. I got reminded of the power of the command-line interface and that often, I underestimate the way these commands are supposed to make a sysad's life easier.

So here's a quick tip for counting unique visitors to your web app. Locate your web app's log file and do a quick scan of the last few lines. In my case, this is what I saw:

112.198.79.223 - - [10/Jul/2010:00:57:29 -0400] "POST /v2/api/execute.php?method=upload_time&ver=win1.1.15 HTTP/1.1" 200 116 "-" "Mozilla/5.0"
117.241.112.254 - - [10/Jul/2010:00:57:30 -0400] "POST /v2/api/execute.php?method=timestat&ver=win1.1.15 HTTP/1.1" 200 288 "-" "Mozilla/5.0"
80.249.84.105 - - [10/Jul/2010:00:57:29 -0400] "POST /v2/api/execute.php?method=offtime&ver=win1.1.15 HTTP/1.1" 200 19 "-" "Mozilla/5.0"
117.241.112.254 - - [10/Jul/2010:00:57:32 -0400] "POST /v2/api/execute.php?method=get_defaults&ver=win1.1.15 HTTP/1.1" 200 77 "-" "Mozilla/5.0"

In this log format, the IP address appears first, so we will only need to get the first set of characters, separated by a space. In order to count instances of an IP address, we sort the IP addresses so similar IP addresses are grouped together, then count them. Then we sort them again so that the sums are arranged. The number of unique IPs may give you pages of standard output, so optionally, if you only want to see which IP addresses accessed the web app the most, we look at the top results only.

So these are the commands used, piped one after the other, with the output:

[root@server2 ~]# cat /var/log/httpd/access_ssl.log | awk '{print $1}' | sort | uniq -c | sort -nr | head

71612 216.157.78.237
34094 120.28.205.244
30091 119.93.97.54
25078 120.28.214.104
18949 120.28.195.151
17929 58.107.64.40
14877 212.98.174.235
14752 117.241.112.143
14429 120.28.247.74
12864 117.241.113.183
[root@server2 ~]#

Happy counting, err reporting!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Sat, 24 Jul 2010 03:59:00 -0700 The things Miguel does on a usual day http://tech.doblados.net/the-things-miguel-does-on-a-usual-day http://tech.doblados.net/the-things-miguel-does-on-a-usual-day

(4400 KB)
Watch on posterous

In a month or so he'll be too big to fit in his laundry basket. He has his eye on the bigger hamper in our room.

(3453 KB)
Watch on posterous

He runs around and does the "happy feet". He also likes running while on top of the air bed, but I can't get any video of that yet as I'm too busy going after him lest he bounce too hard and hit the wall.

(8047 KB)
Watch on posterous

And he demands his time for "computer work". :)

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Fri, 09 Jul 2010 19:18:10 -0700 Ever wondered how I look like after pulling an all-nighter? http://tech.doblados.net/ever-wondered-how-i-look-like-after-pulling-a http://tech.doblados.net/ever-wondered-how-i-look-like-after-pulling-a

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Thu, 10 Jun 2010 12:24:13 -0700 Putty on my phone FTW! ISP was acting up and was able to get Apache to work sometime past 3pm. Post-mortem shortly. http://tech.doblados.net/putty-on-my-phone-ftw-isp-was-acting-up-and-w http://tech.doblados.net/putty-on-my-phone-ftw-isp-was-acting-up-and-w

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Thu, 03 Jun 2010 07:51:00 -0700 Being a Systems Administrator @37signals (Podcast) http://tech.doblados.net/being-a-systems-administrator-37signals-podca http://tech.doblados.net/being-a-systems-administrator-37signals-podca
 I use Basecamp a lot. Kudos to these guys for making my job as a Systems Administrator more bearable than usual. :p

Episode #12: Being a Systems Administrator at 37signals

Time: 22:50 | 04/13/2010 | Download MP3 | Link to this episode

Mark, Joshua, and John on life as a 37signals Sys Admin

The Sys Admin team discusses hosting the 37signals apps, working with programmers, helping support, telecommuting, dealing with vendors, improving speeds in Europe, and more. Related links:

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Mon, 31 May 2010 16:11:00 -0700 How big is a Yottabyte? - Holy Kaw! http://tech.doblados.net/how-big-is-a-yottabyte-holy-kaw http://tech.doblados.net/how-big-is-a-yottabyte-holy-kaw

And I got a long way to go. My next step doesn't happen in the next couple of months, and that's when I purchase a terabyte external hard drive for storage purposes.

Remember back in the 1970s when 200MB was the size of a tire? Now we live in a world of gigbytes and terabytes, and the future will bring zettabytes and yottabytes in everyday life. Hello, future!

k to view large

Download full size (80 KB)

Via Digital Kamera.

Tons of tech.

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Sat, 29 May 2010 07:41:00 -0700 New theme, needs more work http://tech.doblados.net/new-theme-needs-more-work http://tech.doblados.net/new-theme-needs-more-work I'm doing some major cosmetic changes with this blog; and I'm sort of working off this to-do: 1. come up with a manageable set of tags 2. update posts with appropriate tags 3. look for any form of twitter integration Yes, I think I'll be blogging more now. More than anything else, I need the writing exercise.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Sat, 29 May 2010 02:22:47 -0700 After a busy afternoon of play, Ate Kysa attended to her brother and shared a meal with him. http://tech.doblados.net/after-a-busy-afternoon-of-play-ate-kysa-atten http://tech.doblados.net/after-a-busy-afternoon-of-play-ate-kysa-atten

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Fri, 28 May 2010 06:48:00 -0700 Miguel's first giddyap! http://tech.doblados.net/miguels-first-giddyap http://tech.doblados.net/miguels-first-giddyap

(2578 KB)
Watch on posterous

Spur of the moment thing. I was never really good with "anticipation" so didn't take a better recording gadget with us. We didn't think Miguel was going to point at the carousel since he would normally ignore this. I guess he's starting to appreciate things around him more, now that he's walking...and running...and stumbling.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Mon, 17 May 2010 10:27:00 -0700 Kickstarter - Decentralize the web with Diaspora http://tech.doblados.net/kickstarter-decentralize-the-web-with-diaspor http://tech.doblados.net/kickstarter-decentralize-the-web-with-diaspor http://kck.st/9QC2zk

IMO, this is the answer to all your privacy-related concerns on Facebook. Can’t wait til it launches.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Tue, 27 Apr 2010 22:44:14 -0700 Stop Jejemon Bashing http://tech.doblados.net/stop-jejemon-bashing http://tech.doblados.net/stop-jejemon-bashing

It’s not my business, but I’m really tired of all of these jejemon-bashing stuff I’m seeing in twitter and facebook. Why not make an effort to educate these language-challenged people?

Come on people, this monster’s been around a long time. It just took on a new name. Let’s do something productive. ^_^

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Wed, 24 Mar 2010 08:59:23 -0700 Untitled http://tech.doblados.net/19384376 http://tech.doblados.net/19384376

Mindanaoans have already contributed hundreds of hours for Mother Earth in the last month. Spare us.

pinoytumblr:

lights out..

reblog. :)

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Sat, 20 Mar 2010 15:08:54 -0700 Fever and what-not's http://tech.doblados.net/fever-and-what-nots http://tech.doblados.net/fever-and-what-nots

I dare not say what we hope our daughter didn’t get that’s causing her on and off high fever since Tuesday night. We’re still hopeful that it’s some ordinary viral infection that’s been plaguing kids these hot El Nino days.

My wife and I are in distress due to lack of sleep, but we’re still hopeful. We were advised to wait until 6pm tonight to get another CBC exam. That’s because aside from her fever, she hasn’t been showing the other symptoms, e.g. nausea/vomiting, joint pains, tummy pains, etc.

Well, she’s known to not complain about pain unless it’s caused by a needle. So we’re not taking chances. After all, you’d do everything for your kids, right?

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Thu, 18 Mar 2010 16:31:10 -0700 ang pinoy at ang Starbucks. Latte Loco? ERR. (source: teentalk) http://tech.doblados.net/ang-pinoy-at-ang-starbucks-latte-loco-err-sou http://tech.doblados.net/ang-pinoy-at-ang-starbucks-latte-loco-err-sou

pinoytumblr:

modifyyona:

1. Only in the Philippines will you see people ditching the comfort of sipping a cup of Starbucks coffee inside the airconditioned store and preferring instead to sit outside and be soaked dry by the heat of the tropical sun.

The reason? Kailangan makita ng friends/classmates/kakilala ko na nandito ako sa Starbucks! Magpapakasosyal na lang, e di i-todo ko na.

The lesson? Sit where you would be seen easily the most.

2. Only in the Philippines will you see people bringing their laptops inside the Starbucks store and staying there for hours and hours just to avail of the free Wi-Fi.

The reason: Para mukha talagang sosyal, kailangan busy-busyhan gamit ang laptop habang sip ng coffee. Makikisaksak pa yan para maki-charge at naka cross legs pa sa upuan para feel at home. Feeling bahay ko na itong Starbucks. I own it, you know?

The lesson: Make sure to bring your laptop no matter how heavy it is. The attention you will get is priceless, anyway!

3. Only in the Philippines will you see people giving strange names when asked by the barista for their personal name to be written on the cup. The names oftentimes teeter at the brink of being lewd and/or profane (e.g. Lucky T T or Ba Hoko).

The reason: Siyempre kapag sinigaw ng barista yung name, magtatawanan kami ng circle of friends ko. I got the attention I am so craving for again. They are all looking at me o! Bwahahaha!

The lesson: Be prepared with the most attention-grabbing name (those with sexual innuendos are most recommended) to be written on your cup and later on to be shouted by the drop-dead gorgeous barista who would melt in front of everybody after shouting Lucky T.T. or Ba Hoko.

4. Only in the Philippines will you see people taking pictures of themselves all the time and from all possible angles while sipping their favorite ice-cold frapp. You will be surprised to see how the Starbucks logo is almost always part of the frame!

The reason: I need to upload this in my Multiply, Friendster, Facebook, MySpace, Flickr, Blogspot, Faceparty, hi5, Livejournal, Plurk accountssss-sssssss! I need to anonymously view and comment para maraming views at laging nasa top ako ng page sa updates! My friends need to see na nag Starbucks ako! Sayang P120 ko kapag hindi nila nakita picture ko! Huhuhuhuhuhu….

5. Only in the Philippines will you see people getting a lot of extra sugar, cream and tissue. And when I say a lot, it means its damn too many!

The reason: I paid P150 for my venti java chip mocha frapp, I should at least deserve to get a year’s supply of that fiber tissue with the Starbucks logo on them! Sagarin ko na yung binayad ko, and mahal kasi eh! Penge na rin extra, extra, extra sugar ska super extra, extra, extra na cream [Tapos biglang tago sa bag!]

The lesson: Everybody knows that the coffee is overpriced. So get your money’s worth! Grab as much fiber tissue, sugar and cream sachets that can fit in your bag! And dont forget to bring a huge bag to begin with!

6. Only in the Philippines will you see people gulping on twenty venti cups of frapp in one night just to get the oh-so-precious Starbucks planner!

The reason: !@#$, lahat may naka display na Starbucks planner sa kamay nila! Dapat ako rin! [Sabay tungga ng dalawampung cups ng venti frap] Kahit mejo tinamaan doon sa coffee overdose, makikipila pa rin para ma claim ang Starbucks planner [khit gaano pa ito ka-cheap tingnan]

The lesson: Secretly ask your friends for their stickers to complete your collection. In that way, you won’t be spending 2500 pesos for a stupid-looking planner which you do not intend to write on anyway. Your life is a mess dude! What on earth would you do with a planner/organizer you dumbass!

7. Only in the Philippines will you see people holding on to their Starbucks tumblers while they are, well, practically everywhere - on the streets, inside the train, inside the comfort room, etc. What is ironic is that when nobody is watching, they put in their Nescafe 3-in-1 coffee mix inside their Starbucks tumblers and drink their heart away to cheap coffee. Aaahhhhh, sarap talaga ng 3-in-1!

The reason: Basta may Starbucks logo, sosyal! Kaya kailangan dala-dala ko ito lagi! Keber b nila kung Nescafe 3-in-1 yung nasa tumbler ko! Starbucks ito o! Ayan yung logo, tingnan mo!

The lesson: Never ever let anyone catch you put that Nescafe 3-in-1 coffee mix into your Starbucks tumbler. That will so ruin your reputation among all the Embassy-going folks and ecstasy-sniffing elites out there.

Just as when hundreds of Starbucks stores have started to close shop in every major city around the world, at least three new stores open their doors in Manila [or at least in a lighted street corner somewhere around the city] every month. A bit anomalous isn’t it? The truth is that we are perhaps just in the middle of a brewing (pardon me for the intentional pun) coffee craze, or perhaps Starbucks obsession / Starbucks mania / Starbucks phenomenon - call it by any other monicker, but Filipinos are definitely in love with the Seattle-based coffee chain. Now, how on earth could an American export selling coffee for P120 per cup be such a hit in a third world country like the Philippines where half of the population lives on less than P100 a day?

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Sat, 13 Mar 2010 06:32:43 -0800 Untitled http://tech.doblados.net/19384383 http://tech.doblados.net/19384383

Goes to show that at this hour, they’re outsourcing kings! (via @bleepster)

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Sat, 13 Feb 2010 11:04:06 -0800 How a Web Design Goes Straight to Hell - The Oatmeal http://tech.doblados.net/how-a-web-design-goes-straight-to-hell-the-oa-47 http://tech.doblados.net/how-a-web-design-goes-straight-to-hell-the-oa-47 http://theoatmeal.com/comics/design_hell

Well I’ll be! Just exactly how things go (but not with our current company, thank God). Goes to @Bambi @Lee @jenipur and all my web designer friends. ^_^

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Fri, 12 Feb 2010 17:36:08 -0800 Untitled http://tech.doblados.net/19384388 http://tech.doblados.net/19384388

Amp! Dammit. It’s a conspiracy! Good thing I’m not alone reading this! LOL

ejpadero:

jonizzzle:

(via xamists)

lmfao.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Fri, 12 Feb 2010 08:57:35 -0800 Etymology of the term "uyab" http://tech.doblados.net/etymology-of-the-term-uyab http://tech.doblados.net/etymology-of-the-term-uyab http://www.villageidiotsavant.com/2010/02/etymology-of-uyab.html

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Fri, 12 Feb 2010 06:08:35 -0800 Untitled http://tech.doblados.net/19384399 http://tech.doblados.net/19384399

Miguel on a shopping cart

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados
Thu, 11 Feb 2010 13:09:00 -0800 Using non-standard SSH port with TortoiseSVN http://tech.doblados.net/using-non-standard-ssh-port-with-tortoisesvn http://tech.doblados.net/using-non-standard-ssh-port-with-tortoisesvn

Some of my students reported that they were having problems connecting to their repositories using TortoiseSVN. At first, quick checks from my end didn't reveal what caused these, but I realized soon that it wasn't a server issue. It seems like the client software that they were using (TortoiseSVN) didn't know what to make of the svn+ssh://[user]@[ip]:[port]/[repo] URL.

I use RabbitVCS on my Linux boxen and get the same "Network connection closed unexpectedly" message. A colleague at work suggested that since a non-standard port for SSH is used, I should modify my /home/<username>/.subversion/config , look for the [tunnels] section, and append -p [port number] for the svn tunnel named ssh. Since this particular repository is just one among the dozens I access, I can't modify the default svn tunnel. Instead, I added a custom tunnel for each of the servers that use non-standard SSH ports.

 

For the repo that my students were trying to access, I used ssh2212 = $SVN_SSH ssh -q -o ControlMaster=no -p 2212. So the URL now looks like svn+ssh2212://[user]@[ip]:2212/[repo] and I was able to connect successfully.

In Windows, there are several ways to do this. Since the OS doesn't have a native SSH client executable, users will rely on Cygwin, Putty, or on TortoisePlink.exe (in newer versions of TortoiseSVN).

You can try any of the following solutions (they're all searchable in the Internets) and see if you can get around the problem. I've tried them all on a Windows guest OS on VirtualBox and only the last three solutions worked.

  • Using Putty: Use saved session name from Putty in the URL: svn+ssh://[user]@[saved putty session name]/[repo]. Make sure that you configure the session to already use the correct port.
  • Using Putty: Alternately, use IP:port format for the Putty saved session name so that you still use the svn+ssh://[user]@[ip]:[port]/[repo] URL format, but you're actually calling the saved session name.
  • c. Using client packaged with Tortoise. In TortoiseSVN settings -> Network, change SSH client to "C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe" and use standard svn+ssh://[user]@[ip]:[port]/[repo] URL.
  • d. Same as d., but for the SSH client, append -P [port number]
  • e. Using a wrapper script, such as the one provided here (excellent solution btw), and use it as the SSH client executable in TortoiseSVN settings -> Network.

Hope any one of these work for you. As an inside joke from one of my sysad friends, it was also suggested that I save myself the troubles and just log in to the server and revert to the default SSH port. LOL.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/576016/dobsm.jpg http://posterous.com/people/37qTaFWamjkd Jon Doblados Jon™ Jon Doblados