Agaw-liwanag

No Comments

The camera phone might not have captured it properly but the picture below is meant to capture the dusk of a stormy day.
More

Docker image cleanup

No Comments

Running docker frequently can lead to mysteriously disappearing space. I kid, its not mysterious. Each image builds a layer which in turn eats up space. Logical but PITA!

Put this in your .bashrc or run it as cron on your docker host to clean up.


docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f “dangling=true” -q)

or do it in one alias (use at your own discretion)


alias docker_janitor='docker rm -v $(docker ps -a -q -f status=exited);docker rmi $(docker images -f “dangling=true” -q)'

sounds too easy..

ciao!

Ubuntu 15.04 hanging boot-up issue

No Comments

Last weekend I reinstalled my Linux system (and not because I want to rename it as Pyg!) which is a very bad decision as it is the same time that my pitiful internet connection fails to transmit any data beyond a few bytes. The new install to Ubuntu 15.04 (Vivid Verve) gave me the confidence to start using btrfs which is being touted as the next generation file system for linux systems. Bad move and very short-sighted on my part. 🙁

The btrfs is supposed to provide enhancements to ext4 file system since it (btrfs) is built from the ground up but with the useful features already present in ext4. The ext4 filesystem is basically being viewed as an aging hack on a hack since it builds on ext3 which is a tack-on improvement for ext2. Btrfs might be delivering on some of its promised features but those who use it should still be wary of it as it is still not considered as ready for “production” or real-world use[1]. I wish I knew this before I chose it as the filesystem for my home directory. 🙁

For those that will have the misfortune of encountering it, the gist of my predicament follows (which is based on how I remember it):

  • I upgraded my system using dist-upgrade.
  • I encountered a severe freeze which left me with no choice but to reach for the power button.
  • System bootup hangs. The last entry goes something like this:
  • A start job is running for /home… (10s /no limit)

  • Eventually the bootup hangs and it drops the control to an emergency shell.

It was unnerving for me since a reinstall means I would need to re-download the upgrade packages on my #@$@#$ Smart LTE connection. The light-bulb moment for me was that /home is the only partition in the sequence that is using btrfs. The working theory is something borked during the forced shutdown which should have been handled by the journalling features. Thanks to an alternate albeit slow alternative connection, I was able to google enough to do the following:

  • Boot the machine and press F12 after the BIOS/UEFI prompt.
  • Selected the menu option for Ubuntu Advance options.
  • Selected the option for “(recovery)”
  • Selected the “drop to root shell” option.
  • Remounted the root system in r/w mode. I dont think this is needed but this is what I have done and it won’t hurt anyhow.
  • # mount -o remount,rw /

  • Did a btrfs file system check on the home partition
  • # btrfsck /dev/sda4

  • When nothing popped out, I went for the repair option.
  • # btrfsck --repair /dev/sda4

The repair option is always accompanied by a cautionary warning as it can delete information so having a proper backup is recommended. In my situation that is like adding salt to the injury. When I ran the repair option it reported that the cache and super generation areas do not match and that it cleared the space cache. After doing so I ran another btrfsck on the partition and rebooted the system which thankfully landed me on a working system with no (identified) data loss.

The moral of the story is to select btrfs only for the filesystems that you can afford to lose data; or have a good backup scheme. Using it for /tmp is going to be an overkill but to each to his own. Now Im thinking if I want to convert my home partition back to ext4. 😀

ciao!

[1] https://www.wikivs.com/wiki/Btrfs_vs_ext4

Tamang pananalita: Top One at Top Three

No Comments

Tagalugin ko para mas magkaintindihan.

Kung sa pagmamalaki sa iyong anak ay ipinangangalandakan mong siya ay “Top One” ay ibig sabihin ay TANGA KA. Oo matalino ang anak mo pero kitang-kita na di nagmana sa iyo. Mabuti na lang mareremedyuhan pa yang katangahan na yan. Maipapayo ko sumabay ka pag grammar ang lesson. Mas mahaba lang sabihin pero subukan mong sabihin na “Top of the class” ang iyong anak. Ito ay isang tanggap na idiyoma (idiom) para sa isang nangunguna sa pangkat.

Ngayon kung sakaling di naman siya ang nangunguna pero kasama sa grupo ng mga nangununa sa kanilang klase ay huwag mo naman sabihing halimbawa na “top three”  ang anak mo. Hindi naman triplets yan kasi di mo naman sinabing “mga” anak mo. Third of his/her class ang tamang pananalita na kailangang gamitin, o kung ano mang pwesto ang kinabibilangan nya. Pwede din sabihin na “kasama siya sa top five” kung gusto mong magpakumbaba at hindi tahasang sabihin kung ano ang pwesto ng anak mo (pwedeng siya ang una o pang-lima). Pero pakiusap, itigil na sana sa ikasampu. Kung lagpas na sa sampu ay wag ng ipagpilitan para lang makapagyabang. Suportahan mo na lang ang anak mo kung gusto nyang umabot at mapabilang sa “top ten” ng klase nya.

Huwag din sanang tawaging valedictorian o salutatorian ang inyong mga anak kung di naman pa siya graduating o gumradweyt ng elementary o high school. Meron lang iilang lebel o baitang ng pag-aaral na pwedeng gamitan nito. Saka ang valedictorian ay yung taong nagbibigay ng talumpating pamamaalam (valedictory coming from the root word valedictum o “pertaining to leave-taking”) habang ang salutatorian naman ang nagbibigay ng talumpating panimula (salutation). Nagkataon lamang na sa Pilipinas ang top two sa nakuhang grade point average ang binibigyan ng karangalan na gawin ang mga ito.

Ulitin natin:

  • Top One : para kang tanga pag ginagamit mo ito. Nangunguna sa laban na iisa lang ang kasali? Parang solitaryo lang ba?
  • Top three : gagamitin lang kung gusto mong ipatungkol ng sabay-sabay dun sa tatlong pinakamataas.
  • Valedictorian at Salutatorian : ginagamit lang sa mga miyembro o naging miyembro ng isang graduating class. Pwedeng isang mag-aaral, guro o kahit sinong bisita.

Ngayon kung estudyante ka pa pero gumagamit ka ng ganitong pananalita ay maipapayo ko na: anak mag-aral-aral din paminsan-minsan at hindi puro facebook at computer games lang ang inaatupag.

ciao!

Mandaluyong Central Post Office – Contact number

80 Comments

Most internet search hits are still showing up with the Mandaluyong Post Office number which is +63 2 719 0716. This number is no longer operational. If you need to call them to validate postal notifications then the following number was provided by the PhilPost customer care: +63 2 8535 2131.

NOTE: The number is ringing and no longer responsive. The PhilPost site also removed the numbers in their web page. This is a disappointing turn of events. 🙁

[CAVEAT] I am not affiliated with the Philippines Postal Service. I am an ordinary private Filipino citizen who uses their service and publishes this blog entry as a public service.
(Paunawa: Wala akong kinalaman o koneksyon sa Postal Service ng Pilipinas. Ako ay isang ordinaryo at pribadong mamamayan ng Pilipinas na gumagamit lang din ng serbisyo ng Post Office. Itong post na ito ay isang kawanggawa lamang sa akin blog.)

[UPDATE 2016/09/19] Visitor Monica said the 535-2131 number is not working last July. I called the Mandaluyong Public Information Office and they confirmed that the post office still has that number. The number is ringing when I tried it but I didnt have the time to wait for somebody to pick it up. If the number remains non-functional then please try calling the main office using the numbers posted at https://www.phlpost.gov.ph/

Realization

No Comments

It will pass away
The feeling of uselessness
My reality.

Facade

No Comments

A fortress inside
Hiding my thoughts and desires
Self-imposed prison

Law of diminishing distance

No Comments

There is an implicit law and unseen forces in nature that increases the intensity of the urgency to take a crap as the distance decreases between your vehicle/position and your home or the nearest toilet.

Ever heard of the male trick of thinking about other things to delay “satisfaction”?It doesn’t work against the law of diminishing distance.

MongoDB find vs findOne

No Comments

I got hit by this newbie bug. The exercise entails getting a specific record from the database, storing it in a variable, updating it a few times and saving it in the database after each update. Sounds simple, until I am perplexed that I cannot view the variable more than once. The second invocation is just showing or returning an empty string.


> var myobject = db.products.find({_id : ObjectId("507d95d5719dbef170f15c00")})
> myobject
{ "_id" : ObjectId("507d95d5719dbef170f15c00"), "name" : "Phone Service Family Plan", "type" : "service", "monthly_price" : 90, "limits" : { "voice" : { "units" : "minutes", "n" : 1200, "over_rate" : 0.05 }, "data" : { "n" : "unlimited", "over_rate" : 0 }, "sms" : { "n" : "unlimited", "over_rate" : 0 } }, "sales_tax" : true, "term_years" : 2 }
> myobject
>
> //why cant i display the object contents again?
>

It turned out that I should have used db.products.findOne instead. The findOne function returns an actual document record while the find function returns a cursor. Yes, the cursor moved the pointer on the next record after each read request which means that subsequent read calls to it are getting nothing since the cursor was already pointing to the “end of cursor” location after the first read, if I correlate that correctly with how cursors in relational databases work.

Great to know. I want my 15 minutes back. 🙂

ciao!

Shopping and Shipping from the US

No Comments

Online shopping and buying credits presents one of the most alluring temptation combo known to the modern man. There are a few local online shops that have established their own brand but nothing beats the variety of what is available in the US market. Unfortunately not all of the US shops deliver directly to the Philippines, and some who do are expected to either leave a scorching mark on one’s wallet or are in danger of not arriving in your doorstep if its valuable enough to catch the fancy of those in the courier/custom/postal service.

Here comes to the rescue a variety of maildrop services in the US. Their services basically provides you with a US address or PO box, and then handle shipping it to the Philippines at a nominal cost. Searching for them is easy enough but I will detail something that I have used in the past, mostly because of their affordable price and convenient arrangement for somebody who doesn’t always have somebody left in the house to receive packages: Johnny Air Cargo.

More

Older Entries Newer Entries