Posts

Showing posts from 2011

Frequency, Period, Amplitude and Wavelength

Frequency is the number of waves per unit time. Period is the reciprocal of that - the duration of a single wave.  Amplitude   is the magnitude of the wave - how high it goes on the y axis.  Wavelength is basically the same thing as period - the length of a single wave on the x axis.

Dying Moslem see Jesus: Is Jesus the Son of God?

Muslim sees Jesus in Toronto, Canada by Geoff Waugh on Monday, September 5, 2011 at 6:34am Nasir Siddiki Left to Die By age 34, Nasir Siddiki, a successful businessman, had made his first million, but money meant nothing to him on his deathbed. Diagnosed with the worst case of shingles ever admitted to Toronto General Hospital , his immune system shut down and doctors left him to die. The next morning I woke in a sterile room on the eighth floor of the hospital, my skin burning as though someone had doused me in gasoline and lit a match. I felt on fire from the inside out. My doctor arrived and looked at me in wonder. “The blisters are multiplying so fast I can literally watch them grow,” he said. ‘”Your body isn’t fighting back.” The next morning, in addition to shingles, I had chicken pox from head to toe. I was put in strict isolation. That evening my temperature soared to 107.6 degrees — hot enough to leave my brain permanently scrambled. For days I continued to deteriorate. M

Using Oracle 11g thru VirtualBox appliance in Mac OS X Lion

Image
I just found that its quite a lot of handy work to make Oracle work in Mac OS X Lion. Currently, I have this quite cool machine with good memory anyway, so I decided to step the easy way, than the "too-much-time-to-work way". So, I just decided to use VirtualBox with Oracle's pre-built virtual appliance with Oracle 11g Enterprise Edition. To use this, I use the steps below. 1. Download VirtualBox at http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html 2. Download the virtual appliances at http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html then just follow the steps. 3. I added some specific ports, since I access it thru  NAT so whenever I am, it's easier for me just to hook up my virtual appliance and turn it on. So you can issue these command in your terminal, $> VBoxManage modifyvm "OTN Developer Days" --natpf1 "ssh,tcp,,2222,,22" $> VBoxManag

Steve Jobs very promising and inspirational legacy he left for us!

I just found this article posted  by  Horace Dediu For my own reference, I copied it because this is truly inspirational that I can get back and read this how many times, still very inspiring. Steve Jobs didn’t Steve Jobs did not create products. He created an organization that predictably and reliably created emotionally resonant products. Steve Jobs did not make movies. He made a company that predictably and reliably made blockbusters. Steve Jobs did not wrest market share from competitors. He created new markets that attracted and sustained competitors. Steve Jobs did not design anything. He gave others the freedom to think about what jobs products are hired to do. Steve Jobs did not re-engineer processes. He brought engineering processes to works of creativity and the creative process to engineering. Steve Jobs did not develop new management theories. He showed by example that innovation can be managed. Steve Jobs was not a visionary. He put the dots together and saw

objective-c: Do I have to release parameter objects or variable?

I was confused on this until I just realized that if the case is, -(NSString*)name:(NSString*) _name {     // I thought I need to do like [_name release];     return _name; } So instead, the _name paramater object anyway is being reference, so ideally, the releasing of the object from memory is outside, i.e. from the callers perspective. Like, NSString *stupid = @"Johnny Bravo"; [name setName:stupid]; [stupid release]; or I can do autorelease anyway.

This blog will be getting seriously and interesting on my following posts!!!

Hi All, I have just resigned from my previous work. The reason of my resignation is a decision that I am fully confident to pave my way into the real world of programming and technology. I am now hailing this time to be getting serious and create technologies that I am interested into. I blogged this out so that I could not forget the day I promised to do hard work and always push myself to achieve my goal and make people happy with my work. I hope I will be getting into my finish line, if God will provide, as I do trust him and I hope he'll always be with me and with my love ones. God bless us all!!! Regards, ToytoyGogie

LVM: How to remove a volume using pvremove

First, I encountered this error "Can't pvremove physical volume "/dev/sdc1" of volume group "nova-volumes" without -ff" (I'm actually using OpenStack but it's another story). So to remove this, do first, ~# pvscan   PV /dev/sdb1   VG nova-volumes    lvm2 [1.82 TiB / 1.82 TiB free]   PV /dev/sda5   VG cloudmaster     lvm2 [297.85 GiB / 12.00 MiB free]   PV /dev/sdc1                      lvm2 [1.82 TiB]   Total: 3 [3.93 TiB] / in use: 2 [2.11 TiB] / in no VG: 1 [1.82 TiB] Then, when I do, ~# pvremove /dev/sdc1  Can't pvremove physical volume "/dev/sdc1" of volume group "nova-volumes" without -ff So I need to, ~# vgreduce nova-volumes /dev/sdc1   Removed "/dev/sdc1" from volume group "nova-volumes" Then do `pvscan` again, ~# pvscan   PV /dev/sdb1   VG nova-volumes    lvm2 [1.82 TiB / 1.82 TiB free]   PV /dev/sda5   VG cloudmaster     lvm2 [297.85 GiB / 12.00 MiB free]   PV /dev/

Resizing Disk Images in Linux

To resize the disk image in Linux, do # sudo fsck.ext4 -f DISK_IMAGE_FILE # sudo resize2fs DISK_IMAGE_FILE This is very helpful specially if you are having an instance in the cloud and wanted to resize an image.

Mounting an EBS in Eucalyptus

First, do # fdisk -l to list the device available. You can identify what's the current device the Eucalyptus have avail for the current block storage given. Now, to mount this, do # mkfs.ext4 /dev/sda where my current filing system is ext4 and the availed virtual device is /dev/sda. Then afterwards, you can do # mount -t ext4 /dev/sda /path/to/mounted/directory Hope this helps.

Eucalyptus - Save current Instance as backup with the power of "dd" command

The current setup for this is that, I have this current instance in Eucalyptus and was already customized while its being in the cloud. This means like, installing packages and added extra configurations to some packages. While its time wasting if to go back and install those packages, doing a dd (disk dump) tool is very helpful. Below is the command I issued, #> dd if=/dev/vda1 of=jenkins.img conv=noerror,sync  I use the conv=noerror,sync which the sync to sync every input block and also its meta data. I've tried w/o that option and it didn't work.  After I run this into the cloud, I can ssh and I see the state before dd finished, it was there. It's really great! Hope this helps!

Delete a file with a leading "dash" or (-) in Linux

To delete a file with a leading dash, for example, # ls -al total 36195068 drwxr-xr-x  3 toor toor        4096 2011-06-15 16:46 . drwxrwxrwx 12 toor toor        4096 2011-06-21 14:11 .. -rw-r--r--  1 toor toor        6887 2011-06-10 13:01 -C do # unlink -- -C Hope this helps

Don't be a hypocrite! - One of my favorite gospel in the Holy Bible

Holy Gospel of Jesus Christ  according to Saint Matthew  6: 1-6.16 -18. Jesus said to his disciples: «Take care not to perform righteous deeds in order that people may see them; otherwise, you will have no recompense from your heavenly Father. When you give alms, do not blow a trumpet before you, as the hypocrites do in the synagogues and in the streets to win the praise of others. Amen, I say to you, they have received their reward. But when you give alms, do not let your left hand know what your right is doing, so that your almsgiving may be secret. And your Father who sees in secret will repay you. When you pray, do not be like the hypocrites, who love to stand and pray in the synagogues and on street corners so that others may see them. Amen, I say to you, they have received their reward. But when you pray, go to your inner room, close the door, and pray to your Father in secret. And your Father who sees in secret will repay you. When you fast, do not look gloomy like the hy

Eucalyptus - cannot find nodes

Previously, we just have bought a cool machines supposedly to be setup as Node Controllers for our cloud master machine (running Walrus Controller, Cloud Controller, Storage Controller, and Cluster Controller). The current setup we have is, SERVER1 - Cloud master running i3 with 12GB of memory SERVER2 and SERVER3 - running i7 3.0 with 16GB of memory With our setup, our ideal result must have 62 available instances to be run inside the cloud, however, due to the inconsistency we found (check this http://open.eucalyptus.com/wiki/EucalyptusKnownBugs_v1.5.2 ) with the problem with cloud master against NC's, issuing the command #> euca-describe-availability-zones verbose AVAILABILITYZONE kinten-cloud 122.2.1.4 AVAILABILITYZONE |- vm types free / max   cpu   ram  disk AVAILABILITYZONE |- m1.small 0031 / 0031   1    512    10 AVAILABILITYZONE |- c1.medium 0015 / 0015   1   1024    15 AVAILABILITYZONE |- m1.large 0007 / 0007   2   2048    20 AVAILABILITYZONE

Eucalyptus - authorizing a port

To authorize a port in Eucalyptus from the running instance, issue this command euca-authorize -P tcp -p 22 -s 0.0.0.0/0 default

IP Masquerading - To share internet connection within a private network

So I have this setup, SERVER1 - This connects to the LAN/Internet connection SERVER2 and SERVER3 is connected to SERVER1, where SERVER1 is acting their gateway. So SERVER1 is using CLASS A IP Address, using 10.0.2.45 while SERVER2 and SERVER3 is using CLASS C, having SERVER2 as 192.168.10.2 and SERVER3 as 192.168.10.3 and SERVER1 as their gateway using 192.168.10.1 IP. Server3 has 2 interfaces, one connects to the LAN and one connects to the private network of SERVER2 and SERVER3. So to achieve SERVER2 and SERVER3 must have internet connection, first in SERVER1, login as root and then check if the ip forwarding is enabled by, $> cat /proc/sys/net/ipv4/ip_forward if the result is 1, leave it behind, else, $> echo "1" > /proc/sys/net/ipv4/ip_forward then, do $> iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE I'm not going to explain fully what does the command do, you can check this by doing "man iptables". So the "

Singleton implementation in iOS on Objective-C

Just read this very helpful article on implementing a singleton in iOS. Below is a simple snippet that is thread safe, and is indeed, faster than @synchorize when is executed. +(MyClass *)singleton { static dispatch_once_t pred; static MyClass *shared = nil; dispatch_once(&pred, ^{ shared = [[MyClass alloc] init]; }); return shared; } dispatch_once() function is indeed mentioned in Mac Developer Library that is useful in implementing singletons or global data. Hope you found this helpful.

Reason why sizeof charstr adds another 1 byte in C Programming

Returning back to C programming again, now I was stumbling why does char o[] = "1" and sizeof o  returns 2, while char o = '1';  returns 1. Or If I do char o[] = "2345";  and sizeof o is 5. It seems that when char is an array/string, it adds 1. Then I just found the answer that when it becomes a string, it includes the '\0' or null character or 0 byte mark which indicates the end of the string. Some call it as zero termination. So in the example, char o[] = "1", it goes like {'1', '\0'}.

CVS - How to check the newly modified files against the repository

To check the modified files against the centralized repository, you can do cvs -nq update to specify the date, you can do cvs -nq update -D "20110120 20:00" The date format can be passed is "YYYYMMDD HH:MM"or by its relevant format of date. Hope this helps.

CVS: View History via terminal or CLI

I'm not really an expert with CVS, and unlike other VCS, running it's history would be easier, so I document this stuff which I'm forgetful when doing a history on CVS. Issuing, $> cvs history and encountered the error below, cvs history: Unknown method (`extssh') in CVSROOT. cvs history: in directory .: cvs history: ignoring CVS/Root because it does not contain a valid root. cvs history: No CVSROOT specified!  Please use the `-d' option cvs [history aborted]: or set the CVSROOT environment variable. So what I did, I use the -d option and achieve the below result, cvs -d :ext:username@hostname:/path/cvs/project history -e so the -e will do everything involve in its CVS history reports with all record types. Hope this helps.