Saturday, December 26, 2015

set symbols

I was about to pick up an algorithm book to read ... "Computational Geometry", and found out that there is some gap that I am missing.......

I don't understand the symbols of the formula in the book.

After some search thru the Internet, got to know that those are actually called the "symbol set".
and here is a very good site that explains it




Here is the cheat sheet from one of the above pdf file:-



Friday, November 27, 2015

Debugging Flow For A Process

I've been stucked with a job which took a lot longer than what it is suppose to take to complete. A friend of mine shared his gems of tricks on how he troubleshoot it, and with a little bit of tweak to my taste, I've came up with a flow(well, almost all of it still from him :p) which I'm logging it here so that I won't forget it.


#1 Find the offending process id (_pid_)

ps -aux | grep job_name


#2 Look at the entire hierarchy of the pid and look at where it stops

pstree -pulna _pid_


#3 Look at the trace of the running program.

strace -t -s 22222 -p _pid_


#4 Look at the read/write IO activities 

cat /proc/_pid_/io







Useful Links

http://www.linux-tutorial.info/modules.php?name=MContent&pageid=84
http://chadfowler.com/blog/2014/01/26/the-magic-of-strace/

Friday, November 20, 2015

Quotes Within Quotes In Linux

I keep forgetting this every time even though I have stumbled across this so many times.
I'm now gonna stick this here so that I can refer it back and hopefully remember this for good.




Basically, the idea is to ....
always just replace each embedded single quote with the sequence: '\'' (that is: quote backslash quote quote) or '"'"' , which closes the string, appends an escaped single quote and reopens the string. 
 https://stackoverflow.com/a/1315213/335181


Putting the above into a perl script works wonder:
#!/usr/bin/perl -pl
s/'/'\\''/g;    ### or s/'/'"'"'/g;
$_ = qq['$_'];



Thursday, November 19, 2015

Ocean 2nd steroid jab this year

Ocean's gingivitis has come back 3 weeks ago.
It had became worsening until the stage that he hasn't been eating for yhe past 3 day.
We decided to bring him in to Hope Vet for another steroid jab. The previous one he had was slightly 2 months ago.

He has been improving a lot ever since. He even asked for food, which is a good sign. But having steroids every 2 months is really not a good thing for thr organs. We hope that could change.

We bought a tube of OROZYME. It is something like a toothpaste. All you need to do is squeeze 1cm out and rub it on him hand, so that he licks it. According to the doctor it acts like an enzyme which kinda breaks down dental plaque and weaken the bacteria.

We r giving this to Hiro and Nala too. Let's see how it works in another month or two.

Sunday, October 18, 2015

Nala ' s blood test

We just received Nala 's blood test results last Friday from Hope Vet.
It doesn't look good.
The vet wanted to do more tests to her. And we asked some questions, the vet said that Nala ' s case isn't going to get better.

That's when we decided not to let her have to go thru any more stress unnecessarily.  We want her to enjoy and stay happy all the time. And that's what we will be doing.

From now on, I'm going to spend more time with Nala. I've Uninstalled my smartphone game. And I'm gonna spend more time with nala and see her thru. I have confident that Nala will have many many more happy years to go.

I plan to journal down all the sweet memories that we will be having.

Monday, May 11, 2015

Introducing Hiro to our home cats - Day 8

Today's interaction.

We decided to let all of them eat together without any barrier.

It all went quite well at first. Before food were served Nala even sniff at Hiro 's ass and allow Hiro to smell him back.

But somehow at one point after the food are all finished, I think, Hiro proceed to approach Nala too quickly and that triggered Nala to get agitated and showed Hiro some hissing and scratching.

We quickly separated them again.

And then, Danielle suggested that we let them sniff at each other by putting Hiro in a cage.


Everything seems to be going quite well. I was afraid that Hiro might get stressed up, but somehow he was quite calm all the while. Nala and ocean were the ones that showed their ears backwards instead, especially Nala.

But the good thing is there was not hissing and aggression showed for thr entire 30min exercise, until at one point where Nala tried too hard, and Hiro started hissing,  and that the point where we decided to call it for the day.


https://youtu.be/YLgVKV7D1VI

Sunday, May 10, 2015

Introducing Hiro to our home cats - Day 7

Decided to let Hiro meet with Ocean and Nala face to face. ....but with tight supervision.



That room is Hiro ' s room. And I'm holding Hiro tightly as he seems to be very eager to wanna approach Nala and Ocean.


Surprisingly Ocean suddenly came over and walked past us, entering into Hiro ' s room. I'm not sure if that is a good thing, but no hissing from Hiro and Ocean, so I'm taking that as a positive progress. :)


With Ocean in the room , I carried Hiro out and let him stay put on a side , so that Ocean has a larger space to exit the room , and also Hiro has a better view of both Nala and Ocean.


After a while, Ocean decided to leave the room and sit down at the hall, 3 feet beside Nala. Both of them seems at ease and relaxed :)


I kept holding Hiro all the time, and after a while we decided to call it for a day.

We plan to continue with this exercise for the rest of the week, before letting them get Contact and sniff each other at freely.

Here is a Video taken from outside of the room of Hiro.

https://youtu.be/bm8qmB58M3M

Friday, May 8, 2015

Introducing Hiro to our home cats - Day 6

I decided to post the progress of introducing our new 1 year old cat, Hiro, to our house cats Nala (8 yrs) and Ocean (9 yrs).

For the past few days, hiro was left in our study room with water , food, sandbox and toys available to him.

They only interact thru the small opening from the bottom of the door.

The first few days saw some hissing from Ocean. And occasionally Nala too.

On the 3rd day, Hiro peed on my pants and due to some stupid thing that I did, that odor get transfered to the entire house. This eventually made Ocean very unhappy, and he made a lot of hissing and angry sounds, which later on attacked me (well...actually my foot).
I guess the urine smell of Hiro on my leg wasn't very pleasant and comfortable to him.

The hissing gets lesser for the past 2 days. And last nite, we didn't hear a single hiss.

This morning I decided to take it a small step further. As usual I fed ocean and nala right in front of the study room, and then proceed on to feeding Hiro in the study. But today, I decided to leave the study room open while feeding so that 3 of them have the chance to look at each other.


Everything seems cool. They have that stare at first, but continued on eating. I decided not to push thing too fast, and so I closed the door and let them eat separately after a while.

After having my breakfast, I tried something new again. Sitting behind thr study room door, I opened the door, but stopped it and maintained the opening at a very small space, just enough for them to see each other and have their paws thru.

Ocean doesn't seem to be very interested. Nala seems very keen. He kept peeping and trying to push open the door. Hiro seems very excited and ran towards the door. Nala .... I think....he didn't anticipated for that sudden surprise, and made a huge hissing sound and some paw punching. Hiro backed off 3 steps and looked confused. And after a while hiro calmed himself, sits down, and keep watching at Nala.

They both watched each other for quite some time, with occasionally Nala making some strange sound (not hissing) and hiro chirping.

Eventually Hiro went back to his playground and was happy again playing with his toys. I decided to call it a day.

I personally see that as a good progress. Its the same in pur lifes.
Some see Conflicts as a negative thing. I choose to view conflict as something positive.
Conflict exists because there is a disagreement between a communication of 2.
If there is no conflict, it doesn't mean that the disagreement isn't there. It just means that the problem is simple swept under the rug.
When there is communication , there is a chance for resolving the disagreement. the process might or might not be a pleasant one, but at least, there is a chance for resolving the disagreement. That is the first step to peeling of the problem one at a time.

How To Bypass Kerberos(kinit) Authentication

Whenever you try to setuid and impersonate as someone else to run something, it is very likely that you will run into kerberos/kinit issues....