Posts

Why Hotmail SmartScreen Should do Better

Image
Got this spam mail that looks as if its from my other email account (Yahoo Mail). Further inspect on the header reveals that the mail is from hotmail_631448ecb4add0e [at] hotmail.com. And the mail server is actually from the IP 179.89.131.27. Why Hotmail SmartScreen not doing its job SmartScreen should have filtered the email content, based on EITHER one of the following criteria, that can be implemented by checking just the email header. 1. The email content is obviously spam content. Nuff said. 2. The sender is obviously from a "anonymous" email that pretends to be another email. 3. The IP (179.89.131.27) of the mail server is OBVIOUSLY hosted on a spam source. This can be easily detected by cross-check with one of the spam database out there. For example http://www.dnsbl.info/ . These are simple methods to provide minimal layers protection for Hotmail users.  (Notice I haven't even go into advanced SPAM fighting techniques like using  DMARC ) Takea...

Bootstrap Tools

Image
Biggest Mistakes The biggest mistakes for new (or inexperienced) developers, like me, is to jump straight into coding a website. There are so many bootstrap tools (or so caller boilerplates) out there for you to start, without falling into the pitfalls of bad (really bad) designs. I'm speaking from my personal experience, with Lunchsparks . Along the way of "designing" and coding, both at the same time, I poorly designed the elements in the website, from layouts (grids, containers, tables) to buttons (color, states). The Tools These are two tools that I came across recently, which I think its awesome! These tools encapsulated the almost (if not all) the elements for designing a great (responsive) website. Bootstrap, from Twitter Bootstrap, from Twitter A very clear demo site that demonstrate what the tools (javascripts, and css) does. Recommended for new learners. HTML5 Boilerplates HTML5 Boilerplates By Paul Irish . A very cool Googler that I fo...

[CodeIgniter] MySQL NOW()

Was trying to do insert/update using CodeIgniter Active Record helpers, and realize the usual way of inserting doesn't work, because the helper functions actually escaped the values to prevent SQL injection. So we can't do the just group all the data together the easy way. $data['field1'] = $data1; $data['field1'] = $data2 $data['created_date'] = 'NOW()'; $this -> db -> insert($this -> tables['some_table'], $data); There are two possible ways to go around this. 1. Use CodeIgniter $db -> set() function, with the additional FALSE parameter to prevent data from being escaped. $this -> db -> set('created_date', 'NOW()', FALSE); $this -> db -> insert($this -> tables['some_table'], $data); 2. Use PHP data function to generate datetime string. The only thing to note with this method is, in most cases, the PHP server time and the MySQL time is different. $data['created_dat...

[Template] Javascript Functions

Been dealing with Javascript functions lately, I find that these are the most-frequently-used input parameters for all a typical function: data url (optional)  callback (optional) A good JS function should readily accept these parameters. And a typical Javascript function call would be like: somefunction( {data: value, data2: value2 }, [url], [callback()] ); We know that in PHP we can use the following method to write a "optional" second (or third) input parameter. function somefunction( $data, $callback = FALSE); This way, if the second argument is not supplied, $callback  will be automatically assigned to FALSE . Its a good practice to set a default value for a variable. After Googling around, I found that Javascript is event better at handling such case. We can take in as many optional input parameters, in no specific order . But the trade-off is, we need a check for the input parameter type. Stackoverflow has this excellent post on the template for...

CSS text-overflow

Image
Notice : This is a beginner post (that some of you might think is a waste of time) CSS3 has tons of awesome improvement, which a lot of them I don't know or notice. Today, I discovered " text-overflow " style, which is super handy for hiding overflowing text. I discovered while browsing the source for Gmail.com. (Actually I was looking a the scrollbar for the side panel wondering how it works and accidentally stumble upon this :p ). Notice the the longer text "Acquaintances" changes to "Acquaintan" when the width of the parent container shrinks. The style behind this is overflow: hidden; text-overflow: ellipsis; white-space: nowrap; You might wonder why I'm so excited about this? Because in the past, I used to do a lot of text-length-checking on the server side before outputting the text, reducing the number of characters and append "...". Now this can be done easily on the browser part using just CSS! No more inef...

[ROM] Galaxy S2 i9100DXKL3 Firmware

Image
New (Dec 2011) official firmware (South East Asia) for Samsung Galaxy S2. PDA: i9100DXKL3 PHONE: I9100DXKL1 CSC: I9100OLCKL2 Build Info: Thu Dec 15 18:59:02 KST 2011 Firmware Download : GT-I9100_XSP_I9100DXKL3_I9100OLCKL2_I9100DXKL1.zip FAQ: Q: How to check the  current  firmware version of  my phone? There are several ways: 1. Key in  *#1234#  in the dialer. You'll get the PDA, Phone, and CSC version of your firmware, or 2. Download  Z-Device Test  from Android Market.

DirectAdmin Upgrading CSF Firewall

(This post is meant for DirectAdmin beginners, like me.) Finally got the chance to play with one of the production server - to upgrade the CSF Firewall. For this, I have to SSH to the server because upgrading CSF needs root access. Due to restrictions in "DirectAdmin you must login to the root shell" to upgrade csf using csf -u So I SSH-ed to the server and ran the command " csf -u ". But this time, I get the following error. -bash: csf: command not found Okay, the path to CSF is not correct, so just need to cd /usr/sbin/ Then gain root access, su - That's it, can upgrade CSF using the command " csf -u " automatically! :)