Mindblown: a blog about philosophy.
-
shell_exec silent error
This is likely a common error yet might be hard to detect. If you run shell_exec(), make sure to use the full path to the binary file. It might be obvious but many for convenience does not do so, including myself at times. You forget that .bashrc does these for you while running PHP script…
-
Wget/cURL – Pretend to be a real browser
wget -d -S –referer=”http://…” –user-agent=”Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13″ –header=”Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8″ –header=”Accept-Language: en-US,id-ID;q=0.8,id;q=0.6,en;q=0.4″ –header=”Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3″ –header=”Keep-Alive: 300″ –header=”Connection: keep-alive” –load-cookies cookie.txt –save-cookies cookie.txt –keep-session-cookies “http://…” curl -v -L –referer “http://…” –user-agent “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24” –header “Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5” –header…
-
Blueberry Varieties
With my small garden in San Jose (Northern California, South Bay Area), I found blueberries to be quite easy to maintain in the containers and good for the kids. I’ve been harvesting 20lbs since early May 2011. I’m collecting blueberry varieties and these are the ones I have with my comments and sources. I will…
-
Firefox 4 – AJAX JavaScript Execution
Upgraded to Firefox 4, it’s alright, may feel a bit faster (advertised placebo?). It looks a lot like Safari. I guess there is a convergence of best practices going on. Anyway, here is the point of this post: – Firefox 3: innerHTML will execute any JavaScript code inside it (normally loading via AJAX). Other browsers…
-
Investing lessons from a market sell-off
As a beginner in stock investing, I’ve learned some basic lessons, hopefully not too painful to shun stocks all together. They sound very simple but are not easy for amateur investors to avoid. So you would need to be constantly reminded. In your portfolio, there will be stocks that are going up/down since you bought…
-
Demand from a Natural Disaster
With the strong 8.9 quake just happened in Japan and living in California, I would have to think really hard about what happens before, during and after a natural disaster, more specific, a quake. Let’s imagine what people and businesses would have to deal with and who can benefit from the increased demand. I’ll be…
-
Recommended software
Some software I cannot live without: – Keepass (Mac/PC) – TrueCrypt (Mac/PC) – Terminal (Mac), Putty (PC) – ExFAT (for read/write an external HDD for both PC+Mac
-
Security camera
Here is a wonderful combination: an IP camera (SharX, LTS, YCam), FTP server (VSFTPD), online image browser (http://minishowcase.net/). You don’t have to install fancy tools, just go online, browse the archive images when you receive a motion detection email alert from the camera. Gotta love technology
-
Tips for beginners with Puppet (server automation)
Since Puppet is written in Ruby, some of its syntax are Ruby-specific (I would not know for sure since I have not learned about Ruby yet). I’ll try to update this post so beginners to Puppet and strangers to Ruby can get pass the unwanted headache. Case-sensitivity Case-changing is one of the source of confusions.…
-
DIsplay return code of a shell command
If you need to determine the return code for shell scripting, you can use “$?” # ifconfig | grep eth0 >/dev/null 2>&1 # echo $? 0 => good/found # ifconfig | grep eth1111 >/dev/null 2>&1 # echo $? 1 => bad/not found
Got any book recommendations?