Weirdly — I remember that day in every detail,
The thin brown book packaging (I don’t know what it was called – you know the one that we used to use to wrap our text-books in Elementary School :D). The huge smile on my face when I receive it, the smile of a tired father just get back from work. My muddied hands – just get back from the field playing with other kids. “the happy birthday” greetings, and my mom was smiling in the corner.
How I immediately open that packaging with huge curiosity.
That packaging wrap a lot of Donald-duck, Bobo and mix of
magazines, one I remember the most amongst others is a manually bundled pack of Donald-duck comic magazine – those are second hands (I concur probably bought from pasar Cikapundung – one famous for second hand books) – we were not really what you call well off
back then – but things were simpler.
I didn’t remember whether I say thank you to my father back then, I probably just run to my room with those mags and voraciously read everything to the last letter. You know — kids.
That gift, It opened a whole different world and perspective for me, It introduce me to reading
— and I learn a lot.
Amongst others — How donald always go to Timbuktu
to escape from things, How bad-ass Paman Gober (Scrooge Mcduck) get his initial wealth from gold mining. Kwak, Kwik, Kwek, Lang-Ling-Lung, Goofy, Miki, Mini, Clarabela, Nirmala, Oki, Bona, Rongrong, paman Janggut and so many others.
For me that was the greatest gifts ever. The greaaaatest!
Many years later when the well off-ness
kind of improved, I remember I receive a NES gaming console, a 286 PC and many other things after that – but I cannot remember details of those days as clear as the day I receive that brown package full of old magazines.
So yeah parents – introduce your children to the joy of reading
https://www.smithsonianmag.com/smart-news/growing-surrounded-books-may-bolster-skills-later-life-180970523/?no-ist
]]>I setup the drive to auto-mount on boot using fstab
.
One day, because I use one of the USB stick, it stopped working. It seems that the system check and wait for the missing drive (since it’s declared explicitly on fstab)
UUID=XXXX-XXXX / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
tmpfs /tmp tmpfs defaults,nosuid 0 0
/var/swap none swap sw 0 0
UUID="XXXX-XXXX" /mnt/usb auto user,umask=000,utf80 0
UUID="XXXX-XXXX" /mnt/hdd exfat defaults,auto,umask=000,users,rw 0 0
The fix is to add nofail
option to your fstab
entry. Refer to man systemd.mount
nofail
With nofail, this mount will be only wanted, not required, by local-fs.target or remote-fs.target. This
means that the boot will continue even if this mount point is not mounted successfully.
So my fstab
entry modified into:
UUID=XXXX-XXXX / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
tmpfs /tmp tmpfs defaults,nosuid 0 0
/var/swap none swap sw 0 0
UUID="XXXX-XXXX" /mnt/usb auto user,umask=000,utf80,nofail 0
UUID="XXXX-XXXX" /mnt/hdd exfat defaults,auto,umask=000,users,rw,nofail 0 0
Now I can freely remove the removable drive without causing boot to stuck.
]]>nginx+php5.5+mysql
and I’ve been reading about hhvm
and it`s 100% compability with WordPress.
So it’s worth to test.
OK, what I was doing is basically installing hhvm
using this guide
sudo apt-get install software-properties-common
sudo apt-key add --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
sudo add-apt-repository 'deb http://dl.hhvm.com/ubuntu trusty main'
sudo apt-get update
sudo apt-get install hhvm
Since hhvm
is also fastcgi
compatible, all I do is changing my nginx sites configuration to
location ~ \.(hh|php)$ {
fastcgi_keep_conn on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param $SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Restart hhvm
and restart nginx
to make sure the configuration got reloaded. And done!
The setup is simple, nothing fancy.
It’s using tricky simple presence detection – a.k.a detecting MAC address of my phone and trigger scripts based on that. The weakness of it that it will need DDWRT
router use other router that list connected clients MAC address, but you will need to adjust the scrapper code to login and scrap your router interface)
Install DDWRT on your router. Make sure the setting to expose info
page
After this is enabled. It will expose Info.htm
that you can use to scrap for information about your router. See the Wireless clients table on the bottom of the Info.htm
page
Create daemon that check DDWRT status page on some interval and check for the existence of specific MACs. If some specific MACs is detected, go to a folder and run all scripts.
The daemon itself is a Nodejs script that run on my Raspberry Pi. It run using cron on some certain interval.
I use Nodejs script for easy development effort :). For request Nodejs have Request and for scrapping it have Cheerio that makes all scrapping needs as easy as creating jQuery selector. For the DDWRT info page.
var request = require('request');
var cheerio = require('cheerio');
request('http://10.0.1.1/Info.htm', function (error, response, body) {
if (!error && response.statusCode == 200) {
var $ = cheerio.load(body);
var clients = $('#wireless_table tr');
// loop for clients - do the necessary MAC detection here. Don't forget to save it to external flag file so you can create event
// `onEnter`, `onExit` etc
// I save list of MACs that need to be checked in a simple JSON file
}
});
When the above script detect an event, it will try to list all executable script in a folder – For example I have /opt/MYMACADDRESS/enter.d/
and /opt/MYMACADRESS/exit.d/
so when my MAC is detected as entering, it will executes all executable scripts in /opt/MYMACADRESS/enter.d/*
In Nodejs, it’s as easy as
// loop for scripts and execute it using the code below
child = exec(scriptFileName, function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
So I can create many scripts using shebang
notation in the folder and those will be executed accordingly.
The scripts are fine tuned to my home setup. But it can be anything. Here’s some Ideas
transmission
torrent client to unlimited /usr/bin/transmission-remote -D && /usr/bin/transmission-remote -U
(when I am at work)transmission
to 0kb/sec /usr/bin/transmission-remote -d 0 && /usr/bin/transmission-remote -u 0
(when I am at home)powerwake 10.0.1.100
Well the idea can be applied to other router interface. Most router use basic authentication
to access the internal web application. In Nodejs it’s as easy as (or use basic auth bearer Token)
request.get('http://192.168.1.1/').auth('username', 'password', false);
And then tweak your scrapper accordingly to harvest for MAC address or static IPs.
]]>
80% done is not done. Be honest of your progress. Do not think “I can do this at night or on weekend” is an healthy attitude. It will burn you and (always) the team. Share difficulties that you may find. Be honest and be clear — Your peer cannot read minds! enforce them to read REWORK if necessary! smirk
We will finish this specification, then when it is done and approved by QA, then you have my permission to DONE – Bane
Read point number one – and back to this point again. Re-read point number one and then continue.
Misspelling is wrong – even if it’s a comment or variable name e.g. Transatcion. If you let this happen. OCD devleoper will sufre (no seriously – this will be hard to rafector) – did you notice my deliberate misspelling? feel irked about it?
Always prefer SuperLongVariableNameButMeaningfull
compared to foo
.
Even though we don’t compensate for code-quality (even if we do we still deliver quality). If you think that a code is a ‘compensation of quality’ – Ask Fellow Dev. There’s no compensation of quality
– everything must have a reason.
There’s no such thing as Junior or Senior Developer. There’s Experienced and a young pandawan. Good Experienced developer will not let young pandawan to to experience the same mistake. So learn from your experienced peer — as for the experienced – learn the new minds from the young pandawan. Read this in Morgan Freeman’s Voice “We are equal” (OK. I know it’s Padawan – but Pandawan sounds better)
Embrace changes
, consider it as a challenges. Yes you may found most of the time we curse ‘Change Request’ – but that from realistic business point of view. From Dev Point Of View — given unlimited money and unlimited time — it is all possible (yes this is a sarcasm – but the point is – do not swim against the current – you will break)
List your to-do list. On a paper, task-list, issue-tracker, book, post-it or your bleep smart phone. Seriously.. make a list.
Post-Mortem you past success or failure. Why? so you can identify What is Wrong – Fix it – or if it’s irreparable – brace yourself for future problems (TODO: put brace yourself … is coming meme here)
One working cool feature is nothing – test it – show it – keep calm and move on. It’s nothing compared to the Pride that your solid work is being used and affecting life of real
people – so finish it. Keep Calm and revamp that hidden easter egg.
Put yourself in other’s shoes. Specially your user. If a feature is a pain in the ass to use. Then it’s a pain in the ass to use.
Testing – Make an automated test if it’s necessary. Go wild. e.g. What if there’s no internet connection? naah.. that only happen in 3rd world countries — oh wait. We are in it.
Design — always design a full state. a half-full state and a blank-state. Remember your Pinterest-like thumbnail layout can look like crap if there’s no content.
Do not put NSLOG, Log.error, debugger on production code. Do not put commented code on production code – seriously – we live in the age of distributed source control – where you can just type or click-click-click to get the previous source-code.
Deployment – Murphy’s Law. Things will go wrong on the most epic timing possible. Brace for it — Expect for the best and prepare for the worst.
Bug – each time you find intermittent bug. Chant this in Liam Neeson’s voice
I don’t know where you are, I don’t what you intention are. If you are looking for ransom, I can tell you I am working for a new/poor/equity-promise startup that promise me things even without any legal-written-agreement. But what I do have are a very particular set of skills; skills I have acquired over a very long sleepless-nights-streak. Skills that make me a nightmare for bugs like you. If you let my software go now, that’ll be the end of it. I will not debug for you, I will not pursue you. But if you don’t, I will debug for you, I will locate you, and I will fix you
It’s a long chant – but trust me. It works! wink
Burn Out! it is the greatest enemy of Software Engineers, if it’s there – then – it’s hard to cure. It will creeping out on you. Specially if you have a long-unfinished-dull-project or shitty-project-managers. It’s the major reason of retention and major reason for lack of quality. People will leave because of this. I don’t have any good advice in curing this – but I mention it in this list for you to avoid it. As for me – I always tried to creeping in something new in my projects to makes things interesting.
Even the best Developer will make mistakes – Even your super perfect dream team will go clumsy on some details and forget things. Peer Review is not act of underestimating-intelligence – it’s the act of guarding each other’s back as a Team.
Really, when you find people with a lot of experiences. Observe and Listen to them. Make them a Mentor – learn from their past mistakes and absorb their wisdom (sometimes.. your current processing power will not understand. It’s OK. Keep the learning data somewhere in your brain – and someday it will just snap! as if you have an upgrade in your brain of something). I know – I’ve experienced the enlightenment in Project Management because of this learning data from my previous Senior Project Manager
And then when that it just SNAP!
happen – don’t forget to thank them.
No seriously, this is a long unforgiving place of multiple of despair. It’s not the idea – Try to lookup for many failed startups in your City and you’ll realize that it’s not always about the idea. It’s primordial soup of execution, people, luck and destiny entwined by chaos and uncertainties. So it will need good physique and mentalities of run the run, walk the walk and fly the flight. Behind overnight success of 1 billion club of startups – there’s multitude of failures.
]]>You will get wrong all the time, but eventually .. you will right one-or-two times.
I remember it was 1995, I was young, around 10-11 years old kid with identity issue. What Identity issue you may ask? One example is – I used to ask myself Who Am I?
What is the purpose of living?
. I used to identify it as an identity issue because when I ask that kind of question to older people. most of them shrug, laugh or telling me that someday I’ll figure it out (with loud laugh or simple smirk of course)
Is it wrong for a 10 years old to get the answer of it? the purpose of their life? How old a person can get the real answer of their purpose of life? 20? 30? 40? or by the deathbed?
If I remember closely – those days feels like living trough a 3rd person view of me. Like I am watching myself behind a steel-barred thick window. A thick window that limit real me
and the outside world.
Well, due to those haunting existentialism questions – it cause the feeling of non-belonging. That I am not belong here – that I am not born normally from the usual human deal – but with just ZAP! ZAP! ZAP! suddenly exists with flash of light, epic music and pop! I am exists!
28 years old now – and still stuck with the same questions. At least my parent has made it to convince me that I am not born with flash of light and epic music playing in the background, disappointing truth don’t you think?
Used to have imaginary friends, when I said imaginary friends – it’s not 1 or 2 or 3 entity. But legion of shadows around me – hundreds of entities.
When I walk alone to school (used to walk 1-2km to school) those legion of shadows will surround me and say hello – Well those shadows actually never speak anything but their existence always means hello
, good day
or good morning
– funny things is those shadows never appear at night.
From that many shadows there’s one that is closer than other – when I am lonely or haunted by the feeling of not-belong-to. That closest shadow always looks like it care – not really have face but I know it is trying to smile. Not really have hands but I know – in it’s every inch of pitch black is trying to engulf me with darkness. A hug. Not really have existence since I know it’s imaginary but it’s there – along with hundreds-of-hundreds legion of shadows.
I don’t remember when exactly those shadows stopped to following me around – kind of miss them in a weird way.
To tell you the truth – Sometimes I still see one of them follow some random kids. Hugging and Smiling and I smile back at them.
]]>