Monday, January 28, 2013

Kobe-like

Let's be Kobe-like. :)

Meaning, let's continue to adjust our game so we can counter whatever struggles that come our way.

We all know the game changes and it becomes more and more challenging as the years go by but if we have a Kobe state of mind, everything's going to be alright.



:)

Sunday, January 27, 2013

XForwarding With Putty On Windows Over SSH

So I was writing some scripts for my automated web functional testing using PHPUnit and I encountered an error that prevented me from opening the Firefox browser from the server.

When I tried to run my PHPUnit script, I was bothered by this error:

Error: no display specified


I tried running "firefox" on my CentOS CLI and it gave me the same error message. So I found out that my script is trying to run Firefox within the server but the GUI should pop up on the client side.

Apparently, I need to configure some stuff before I'd able to do this.

Problem: I needed to run Firefox from a Linux server remotely and display the GUI locally in my Windows client.

Solution: XForwarding

WHAT'S IN MY MACHINE: Assumptions

  • CentOS Linux

  • PHP 5.4.4

  • Yii 1.1.12


WHAT TO DO: Installations

Your server must have the following installed:

  • Firefox (if not installed, just run this: yum install firefox)

  • X Windows System (if not installed, just run this: yum groupinstall X Window System)


In your client (Windows 7), install the following:

Putty - for the SSH client

Xserver - to display X11 applications

The installation procedure is pretty straightforward so I won't write it here anymore.

THE TRICKY PART: Configuration

Once you've installed the applications, do the following:

1. Double click on the Xming shortcut on your desktop. Your X Server is now running.

2. Click Putty.

3. In Sessions tab, fill in the details:

Host Name (or IP address) - you should put here the IP address of your server
Port - 22
Connection Type: SSH


4. Expand the Connection tab and find and click the SSH branch.

Check the "Enable X11 forwarding"
Check the MIT-Magic-Cookie-1


5. Go back to Session branch and Save it and then click Open.

6. Log in using your account details and try running "firefox". It should be working by now.

Thus, your PHPUnit functional tests should be able to run using Firefox as well.

Generally speaking, you should now be able to run X applications from the server on your local desktop.

Also, make sure that the following are set to "yes" in your server's /etc/ssh/sshd_config

X11Forwarding


X11UserLocalhost


: )

Installing PHPUnit

WHAT'S IN MY MACHINE

  • CentOS Linux

  • PHP 5.4.4

  • Yii 1.1.12


HOW TO MAKE PHPUNIT WORK

1. You have to have PEAR installed and the version must be 1.9.2 or higher:

pear upgrade pear


2. Register PHPUnit with the local PEAR environment (pear.phpunit.de)

pear channel-discover pear.phpunit.de


3. Install the PHPUnit and its dependencies

pear install --alldeps phpunit/PHPUnit


4. You're done. To test it in your command line, just type:

phpunit


You should get something like:

PHPUnit ver. # by Sebastian Bergmann

: )

Happy testing!

Wednesday, January 9, 2013

Occam's Razor The Kolmogorov Complexity

Blah. I've never been good at explaining things especially when I am nervous or emotionally disturbed or uncomfortable. Or maybe, I just simply suck at it.

I'm not good at it at all. Sometimes I think I put too much detail on things and leave out the most important things. Other times I choose to just NOT explain at all or explain it too shortly because I get annoyed by the thought that I won't be able to explain it well anyway.

I have to learn how to "Occam's Razor" the "Kolmogorov Complexity" of my ideas.

Monday, October 29, 2012

kat_2012.log (pre post year report)

I'm thinking about writing on how bad this year has been for me. Kobe once said that a season without a ring is a wasted season. However, I'm not Kobe. So instead of treating this year as a flop, I am making myself believe otherwise.
Let me start off with the fact that I received a MEMO, re: habitual tardiness, at work. I've always been a fan of clutchness and I like to challenge myself by getting to work right on the dot but last month I got the shock of my life. I found myself having a memo from the HR. (finding memo). So basically I got this paper that was signed by many bosses and it kinda says something like, "We have a new and stricter rule. Get your ass to work on time." I'm not saying that I didn't deserve it. I mean, you know how I roll.

And then there's the actual work. Hmm so I've been dealing with a new team and totally different projects. Everything has been unfamiliar. It's like I had to start all over again with my skills and exp level. I can't say this was a bad move because I know that in the long run, it's going to be worth it. (it's going to be really advantageous,  I tell ya). Meanwhile, I just have to go with the flow for now and use every exp to my advantage. Who says I'm impatient now ha?

Aside from the tardiness issue and the learning curve, I feel like have not been able to impress my boss that much. Technically, maybe I am doing just fine like I finish things on time and contribute efficiently. However, my boss and I had some issues that I won't elaborate anymore but basically it's like this... I am stubborn and he got stressed. Haha.

Lets not forget that earlier this year I had to deal with some long distance thing that is super new to me. OMG. I may have cried almost every night thinking about it. Well not really. (hyperbole, anyone?) Anyway, so maybe it's not a challenge for everyone but it was a struggle for me. It still is but luckily I'm learning how to manage it. And guess what? We're halfway there.

I have about two months left before the world ends. I mean, before the year ends. In basketball, a lot can happen in two seconds so I guess I can't  say the game is over just yet.

Friday, October 5, 2012

Programming Blues

As a programmer who's not an expert but has been around for a little while, I fear that keeping up with technology might become difficult for me in the future.


It's not that it's hard to keep up with the new technologies, it's more of that by the time I've invested into mastering a technology and be really proficient in it, something new comes along.

*insert Kanye song here*
And it all falls down.

I'm all for new things. Every close friend of mine knows that. I AM A SUCKER FOR NEW THINGS. (I do say this a lot of times.) New things excite me. But whenever I start on something new and do something about it, I feel less productive. It's like taking a huge step back when it comes to productivity.

Sometimes it demotivates me.

That's the sad part about it.

Another depressing thing about learning programming is when you realize how far behind you are when you zoom out of your own little world. You'll be surprised how many technologies are there and you'll always feel like a NOOB.

Every. Single. Time.

I guess they're right. Learning never stops.