The future of blogging

… or at least the future of this blog.
It has been a while since I have last written anything on this blog, reason is, lately I have been retweeting more and sharing more stuff on Google+ than writing here.

There is a lot happening with technology, PHP and web development in general and even if I wanted to, writing about everything is barely impossible.

Considering this, I have decided to keep writing on this blog but when only the situation requer to. For example, if there is a new piece of technology, PHP feature, etc that requires a longer explanation or more words than 140 chars, it will be here, otherwise, check Twitter and Google+.

To make this feed easier to check I have added some of the social medias that I’m part of in www.mcloide.com . There you will find my twitter account, my G+ account and some other accounts like Github and Coderwall.

See you on twitter or till next post right here ūüėČ

Advertisements

ibuypower

I have just purchased a notebook with iBuypower.com. Truth is that I have never heard about them before or never knew anyone that had purchased any computer with them, still they were the few websites available that offered customized systems. This is my review of the notebook and their services thus far.

Searched through a few forums and finally I have found a good reference from them, they had systems to be sold in Newegg.com. Everyone knows Newegg.com.

This are the settings that I have asked for the notebook:

1 x Case (Battalion 101 W350ETQ 15.6″ Full HD 1920×1080 Widescreen LED TFT Laptop w/HDMI Port, USB 3.0 port, fingerprint Reader, Li-Ion Battery, Universal AC Power Adapter – Original Metallic black))
1 x Processor (Intel¬ģ Core‚ĄĘ i7-3630QM Mobile Processor (4x 2.4GHz/6MB L3 Cache)))
1 x Memory (16GB [8GB x 2] 1333MHz DDR3 SDRAM [Laptop Memory] – Corsair or Major Brand **FREE Upgrade to 16GB [8GB x2] DDR3-1600 G.Skill**))
1 x Video Card (NVIDIA GeForce GTX 660M 2GB GDDR5 Video w/ NVIDIA Optimus [W350ETQ]))
1 x Primary Hard Drive (256 GB ADATA SP900 SSD – Single Drive))
1 x Data Hard Drive (500 GB 5400rpm Serial-ATA Super Slim Laptop Hard Drive))
1 x Optical Drive (8x Dual Format DVD¬ĪR/¬ĪRW + 16x CD-R/RW Combo Drive [W350ETQ]))
1 x Sound Card (3D Premium Surround Sound Onboard))
1 x Network Card (Built-in 10/100/1000 Mbps LAN [Laptop]))
1 x Operating System (Microsoft Windows 7 Professional + Office Starter 2010 (Includes basic versions of Word and Excel) – 64-bit))
1 x Warranty (Standard Warranty Service – Standard One(1) Year Limited Warranty + Lifetime Technical Support))
1 x Rush Service (Rush Service Fee (not shipping fee) – Deferred Delivery (Ship Out in 15 ~ 20 Business Days) – 5% OFF on systems over $999 (Coupon Code: defer)))
1 x USB Ports (Built-in 1x USB 2.0 + 2x USB 3.0 + 1x USB 3.0 / eSATA Combo Ports [Laptop]))
1 x Video Camera (Built-in 2.0 Mega Pixels Digital Web Video Camera))
1 x Internal Wireless Network Adapter (Intel Advanced-N 6235 802.11 a/g/n 300Mbps Dual-Band Wi-Fi + Bluetooth Combo))
1 x Flash Media Reader / Writer (Built-in 9-in-1 Media Card Reader/Writer [Laptop]))
1 x Carrying Case (Free Deluxe Carrying Case))

I was waiting this notebook to be awesomely built and it is.

These are the pros:

  • extremely well packaged. It was so protected that the ratio for the box x contents was of 4 x 1 (the box was 4 times bigger than its contents and filled with foam and popcorn-foam)
  • beautiful body
  • onkyo speakers
  • extremely awesome resolution screen
  • came with a windows 7 recover dvd (and some other drivers installation dvds). I personally loved this because the last notebook that I have bought didn’t came with it and gave me a huge¬†headache to recover everything when the hard drive failed.
  • Their customer service rocks. Ok, they had a miss¬†communication¬†with me in one of the emails, but on the phone everything was¬†rectified.

So far these are the cons:

  • deferred shipping (I really did a very dumb decision when I have chosen this discount – dont do it)
  • battery runs out pretty quickly when using it on max power

 

I will be putting this note to the test today. Started downloading Guild Wars 2 and I will install a Virtual Machine with tunneling to use as my webserver.

In general, right now, I would buy from them again. I’m very satisfied with the notebook and they do deserve two thumbs up.


Simple MySQL Heartbeat monitoring

I had an interesting request today: create a script that would return a page header 200 or 500 for a heartbeat monitoring on a MySQL server for a site. The reason behind it was that the server was returning way too many MySQL connection errors during a small period of time for it to considered a simple app error.

This is what I have came for to help with the issue:


<!--?php
$dsn = "mysql:dbname={$dbName};host={$host}";
$user = 'mysql_username';
$pass = 'mysql_user_password';
try {
$dbh = new PDO($dsn, $user, $pass);
$dbh = null;
header("HTTP/1.1 200 OK");
} catch (Exception $e) {
header("HTTP/1.1 500 Internal Server Error");
}

With this simple code we can monitor the page status and if it returns 500 set an alert to tell us that MySQL server is down.

There are, off course, better ways to do this, but if you don’t have too many resources or is using a shared server, this might be a good solution meanwhile.


My overview on MongoDB

Recently I have done a online MongoDB certification developer course with 10Gen. Prior this certification I haven’t never tried or really used a NoSQL database and after it I can say that I would really think twice if I would only use a relational database on a big project.

There is a big change of concept here, differently from a relational database with MongoDB you are willing to give up on relationship and see data in a object way. Let me see if I can explain this better.

In a relational database you would have a set of tables like:

Users 1 – n Addresses 1 – n AddressTypes

In MongoDB you would have a Json Object that would have all data from the user including (or not) the addresses and it’s types. What you store for a given object is completely up to you and if you really want to keep a relation between objects (split the user from the address object for example) you can, but you would have to do it programatically.

It’s a bit hard of a concept to understand at first glance, another reason why I did really enjoy the online course that 10Gen gave, but once you understand it is only natural that you start reconsidering a lot of the decisions you had made with a relational database. It is not only a case of performance, it can also be a case of how you scope your objects and data on the database in a way that you can not only gain performance but also keep the necessary data in a single object.

Consider a real state agency website for example, A lot of the data that relates to a house can be hold into one single object. It not only could be held but also it can shrink the size of data since not every single house does offer the same standards or assets.

Aside of the concept that MongoDB brings it also brings 5 great features that can bring advantages depending of the project that you are dealing with:

  • Aggregation Framework (or it’s complex queries method) that use a concept similar to the Linux pipeline
  • 2D / 3D Geo-find – instead of doing insane big queries with math in it to find a geo-location, MongoDB already comes with this feature
  • Data connectors. It already have a ton of good connectors that works with some of the big languages (like PHP) and frameworks
  • GRIDFS or Blob Sharding ¬†– splits big chunks of images in several collections making it easier to save and gather the image
  • Server Sharding – It is almost ridiculous how ¬†easy is to setup several servers with voting capabilities to handle your MongoDB data, replication, etc

At the moment I’m not entirely sure if I could re-do a whole project only using MongoDB, but I would, given the time and goals, really consider it. The big reason is that I love the concept of storing an object instead of data parts.

Consider the following, if you need to store a whole session on the database which would be the best way to do it: a simple JSON object. With json_encode and json_decode from PHP, for example, you can easily create an array with the whole data.  If you can consider do this with a relational database, why not use a NoSQL database like MongoDB.

If you still have your doubts about MongoDB or even NoSQL databases I would give a check on the online training and their documentation. You probably will find it really fun to work with it.

Today I can say that I understand why MongoDB is becoming more and more popular by the day.


How to begin on Front End Development

A friend of mine asked me today how could he begin on front-end development without knowing anything at all of programming and bellow is what I have pointed out to him. These links should get anyone started with basic concepts of front-end development and learning should be easier after that.

Some links to get you started on HTML, CSS and JQuery (Javascript)

Med-advanced

Get used to concepts like Responsive CSS (it’s great) and for those you can use test tools like:¬†http://screenqueri.es/¬†to check if everything is ok.

Get into Twitter and Google+ and  follow me on those (you can get the links at www.mcloide.com) and you will see that there is a bunch of people that I follow that are in regards of CSS, HTML and Javascript. There is always a bunch of new things that you can learn from developers that work with front-end in a daily basis.

You can also check hubs like Coderwall and Geekli.st where you can find info, tutorials and tips on HTML, CSS and Javascript.

As tips remember this:

  • ¬†IE sucks -> it will break your design / css / html / etc so if it works on IE it works on everything else
  • Google is your best bud -> there is always someone with the same problem or a similar problem as the one you are having
  • in backend programming we use the concept of DRY (don’t repeat yourself). In HTML you might not be able to use it, but for both CSS and Javascript you can use it.
  • You can use JS Lints (http://www.jslint.com/) to check if your code is pristine
  • You can use Fiddles to test some stuff on the fly (http://jsfiddle.net/)
  • Use either Chrome or Firefox while developing, the Firebug and Chrome Inspector are excellent tools to check on javascript errors, small inline css changes, etc
  • The best way to practice and start, build a site, publish it and ask for a review on it from other dev’s / people – it will give you ideas of UX and if you need to improve your code.

I’m not a front-end developer, but these are the steps that I usually take when I need to code something for front-end. Either way is a good start for anyone that haven’t coded anything in front-end or is simply considering on starting on web-development altogether.


A scenario that should have failed

Today something happened to me that by chance I was luck enough to find out. By all means it was a scenario that should have failed and it did not.

I had an account and it was closed (so no more transactions were supposed to go to it) on the 19th. On the 29th I had ¬†a payment (Real Time Bank Transfer) ¬†with a vendor.¬†I forgot to update with the vendor the account details and a transaction was posted. I don’t think, in my widest nightmares, I would had a closed account accepting a transaction. It not only accepted a transaction over an closed account but also accepted a transaction over an account that had 0.00 as balance (this last is more acceptable since banks have overdraft fees).

Few days later, checking the balances on the new account (that was supposed to have the transaction), the transaction wasn’t there, so I have assumed that it had failed. Checked with the vendor and¬†surprisingly¬†enough the vendor was happy, wich means that the transaction went through. Checked with my dad, that received the transfer, and he also did had the amount. By exclusion it means that the transaction was posted on a closed account (simple troubleshooting came in hand).

Hold right there: How come a closed account have accepted a transaction?

That was my 1st question when I did go to the bank branch to check if the transaction went through on the closed account. After a 1 and half hour of trying to figure out the issue with the representative we got things sorted out. The bank admitted that they did a mistake. A mistake that in my opinion  is pretty bad one.

Just so you can have an idea: Foreach negative transaction there is an overdraft fee, charged per day, of $35.00. In 30 days that would had costed me: $1050.00.

Kind sucky to know that a system mistake would had cost me over a thousand USD in a month and a ridiculous amount in a year.

Things were sorted out. The bank now knows about the system error and for myself, I got a couple of documents proving that the account was closed and clean, so if any day I get someone to try to collect me anything, well, I have proof that things are ok.

I’m not sure what made me perplexed, knowing that this kind of error happened or knowing that this kind of sh** always happens to me. Who tested this sh**¬†?

 


Phil Sturgeon¬†‚Äʬ†Why some people hate PHP | Blog

A worth reading post:¬†Phil Sturgeon¬†‚Äʬ†Why some people hate PHP | Blog.


Brazil blocks port 25

In an attempt of diminishing the number of spams sent, Brazil Internet¬†Committee has decided to completely shut the port 25.¬† It is an attempt to diminish Brazil’s ranking on the list of countries with the highest amount of spam sent. Currently Brazil is the 5th in this ranking.

The port will be completely shut in December of this year and replaced by the the port 587.

Original Article: http://blog.netrevenda.com/2012/11/07/email-brasil-bloqueia-porta-25/

If you have a Reddit Account, you got check this discussion about the topic: http://www.reddit.com/r/technology/comments/15hvkc/brazil_blocks_port_25_indefinitely_in_attempt_to/

Update:

After seeing a good amount of comments on Reddit and a great amount of doubts, I have searched for the original resolution and with some help of a translation tool it can help to better understand the Port 25 block.

Here is the text: http://www.cgi.br/regulamentacao/resolucao2009-001.htm

 


Anonymous hacks Paypal and leaks 28K accounts info

You have already probably seen this all over the web by now, so a piece of advise:

– Go to Paypal.com right now and change your password

Don’t wanna give your bad-luck a chance do you?

Original article: http://thenextweb.com/insider/2012/11/05/anonymous-leaks-sensitive-data-from-alleged-paypal-hack-on-global-protest-day/


OWASP top 10


%d bloggers like this: