Monday, June 08, 2015

Getting Started with R

The easy way to get started with R is to use RStudio. You will need to install both R and RStudio. Here are the software packages you need to install:

Windows
Mac OSX
You will need access to the internet to download R packages. If you need to configure a proxy, in RStudio, you will need to edit the environment text file:

file.edit('~/.Rprofile')

In that file, you will need to add the following settings:

Mac OSX:

Sys.setenv(http_proxy="http://proxy:8080")


Windows:

http_proxy=http://proxy:8080

Instructions were based from the following articles:

Once you have set up internet access, you should be able to install R packages. The yhat blog lists 10 R packages they wish they'd known about earlier.
  • sqldf (for selecting from data frames using SQL)
  • forecast (for easy forecasting of time series)
  • plyr (data aggregation)
  • stringr (string manipulation)
  • Database connection packages RPostgreSQL, RMYSQL, RMongo, RODBC, RSQLite
  • lubridate (time and date manipulation)
  • ggplot2 (data visulization)
  • qcc (statistical quality control and QC charts)
  • reshape2 (data restructuring)
  • randomForest (random forest predictive models)

Friday, May 16, 2014

Classifieds Scam

Here's an actual scam attempt that I encountered. The pattern is similar and looks believable. The general steps:
  1. Scammer will signify interest in purchasing item.
  2. Scammer will say he is working for some non-profit and wants to buy the item for a fiance who is in South Africa. He will ask you to calculate the shipping cost via Fedex and will say he plans to pay by PayPal.
  3. Once you give the shipping cost, he will ask for the email where he will send the PayPal payment.
  4. He will then say he will make the payment now and ask you to check your email for the PayPal.
  5. You will receive an email from service@paypal. If you are using Gmail, this will likely be flagged as a phishing email in the Spam folder. Notice that the email will have typos and will ask that you send the tracking number to ppalonlinecare@mail2consultant.com or something other than paypal.com. The general content of this bogus email is that this is a new PayPal policy and that the funds will only transferred to you once the shipment tracking number is submitted.
  6. He will then say he has made the payment and it has been deducted from his account and that you should ship the item and send to PayPal the tracking number.
  7. If you ignore him, he will ask what is causing the delay in shipment and that the money has been deducted from his account already.
Here's the actual email exchange:

I posted an ad to sell my iPad on Sulit OLX and I got an inquiry asking if the item is still available. I said yes and he replies:
From: Micheal San Filippo
I'm glad to hear from you.My name is Micheal San Filippo. i work with United Nations and i want to buy the item for my Fiance she just travel to south Africa for missionary.

Am okay with your price and i will be including the shipping cost via FedEx.

calculate the total amount with the item and get back to me. i will be paying you via paypal payment

I ask him what the shipping address is and he replies:
From: Micheal San Filippo  
here is the shipping address bellow

Name. Onunkwo Anthony Emeka
Address. Toulon building Sunny-side
city. sunny-side
state. Pretoria
Zip code. 0002
Country. South Africa

I tell him the quote and he replies:

Okay sound good. get back to me with your paypal email address so that i can make the payment as soon as possible

I give him my email and he replies:

Okay. thanks for getting back to me with your paypal email address. i will make the payment now and let me know as soon as possible you have receive payment notification mail from paypal and i will get back to you

You'll receive several emails from service@paypal. This is email #1:

Subject: ***Notification Of An Instant Payment From Micheal San Filippo(michealsanfilippo@gmail.com) Approved

Dear       dfadfa@gmail.com

You have an Instant Payment of P13,830.80 PHP  from Micheal San Filippo (michealsanfilippo@gmail.com)

Payment Details

Purchased From: dfadfa@gmail.com,

Transaction ID: 36427630DM419481W   

Email #2

Subject: ***SHIPMENTS TRACKING NUMBER IS NEEDED IMMEDIATELY***

Dear  dfadfa@gmail.com
We received a message from you regarding the payment that was made by MICHEAL SAN FILIPPO  "(michealsanfilippo@gmail.com) today  which has not appeared in your PayPal  account . In answer to this, we want you to know that the payment is already pending in your account but will not be visible to you until we receive  your response to the payment  that  was made by the buyer of the item. This is due to the new policy of PayPal So we strongly advise  you to ship the item to the buyers address giving to you  and send the Scanned Receipt and the TRACKING NUMBER  to prove that you send the item in less than 48 hours so that we can release the money in to your account.
We want you to know that as soon as we receive the tracking number/reference tracking number that was requested from you, the money will be credited to you account within the next 24 hours of your response to the payment.
Ensure you get back to us because we do not want any delay in crediting your account.
For response email us at ppalonlinecare@mail2consultant.com

Thank you for using PayPal!
The PayPal Team
Email #3

Subject: You've Made A sale - Please Ship Out The Items(s) Sold To Micheal San Filippo

Please follow these 2 easy steps to confirm the order and complete this sale

Step 1. Pack your Order

Be sure to package the item correctly. Use a sturdy package such as a padded envelope, CD mailer, or cardboard box . When appropriate, protect the item(s) with packaging material such as bubble wrap, foam peanuts , or crumpled newspaper.

If you are using your own label, be sure that it is legible. Use a printed label, or address the package by hand using large, block letters but you are advised to take the item to the shipping company office your self so as to make a safe shipment.

Please use your address as the return address.

Step 2. Ship Your Order

You are required to mail this package no later than the next 48 hours . Failure to comply may result in loss of shipping allowance, poor seller rating or suspension of seller privileges.

Shipping Method: FedEx  Express Mail Service
Email #4:
Subject: *** Payment Is Confirmed *** Shipping Details Is Required Before We Post Funds Into Your Account ***

PayPal is your partner in transaction on line

Dear Customer, dfadfa@gmail.com,
         
This message is originated from PayPal company.We have received an order from our client Micheal San Filippo  regarding the payment of   P13,830.80 PHP, that was made to your PayPal account.The payment has been successfully made but due to security reason we have to receive the shipment tracking number before the next 24 hours for the processing of your order.

This a new measure we are taking to protect both our sellers and buyers against fraudulent customers.Once you have shipped the item, send us the shipment tracking number for verification after the number has been verified, your account will be credited instantly. 

This PayPal® payment has been deducted from the buyer's account and has been "APPROVED " but will not be credited to your account until the shipment reference/tracking number is sent to us for shipment verification so as to secure both the buyer and the seller.Below are the necessary information requested before your account will be credited. Send tracking number to us  through this mail :  ppalonlinecare@mail2consultant.com

Scammer will now follow up the shipment from you:

Hello, i have made the payment PHP 13,830.80, and the money have been deducted from my Paypal account and have gotten the payment confirmation mail from Paypal please kindly check your Paypal email address dfadfa@gmail.com inbox and spam inbox
you should have gotten the payment  notification mail from Paypal

here is the shipping address bellow

Name. Onunkwo Anthony Emeka
Address. Toulon building Sunny-side
city. sunny-side
state. Pretoria
Zip code. 0002
Country. South Africa

A few hours later he will follow up again:
what is still causing the delay for you to ship out the item i have made the payment and the money have been deducted from my paypal account . please kindly ship out the item today and get back to paypal with the shipment tracking number and scan receipt for the verification of shipment so that paypal will release all the money into your account immediately.

Hope to hear from you soon.........

The best thing you can do at this point is go back to all the emails and report it as Phishing in Gmail so that the email address or content is blocked for other users. You will notice the scammer doesn't attempt to negotiate or ask details about the item being sold.

Monday, December 23, 2013

Batch renaming of files in OSX using Automator

While I was organizing my photos, I encountered many instances where the filenames of different photos were the same, so I couldn't place them in the same folder without renaming them. It was fine at first when there only a handful of duplicate filenames, but there had to be better way. There was another scenario where I wanted to insert the year before each video so that I could easily group them.

In OSX, there is a built-in tool called Automator, which is found in Applications. Just open it and create an Application. When it opens, just search for rename and drag "Rename Finder Items" to the main window, which will ask you if you want a copy or not. In my case, I did not need a copy. You can change the parameters to something like below. Then save it to your Desktop for easy access.
Inserts the year in front of the files.
To use this, in Finder, select the files you wish to rename and drag them to the Automator icon that you just saved in your Desktop. I have two such icons handy: Append isodate and Prepend Year. After dragging the files from Finder to the Automator icon, your files will have been renamed.


Sunday, December 08, 2013

Android KitKat 4.4.1 on Nexus S (CM11)

My Nexus S was on CM 10.2 (Android 4.2) for a while and held off upgrading to 10.3 (Android 4.3) because there was little difference in the upgrade. Kitkat (Android 4.4), on the other hand, promised good performance on devices with as little as 512MB, so I jumped at the chance when the first Nexus S (crespo) KitKat nightlies started appearing on Cyanogenmod.

I encountered just one hitch in the upgrade and it was related to the clockwork recovery I had. Here are the steps to upgrade from CM 10.2 to CM 11 Nightly.

Backup your phone data
  • Backup your SMS messages. I used the SMS Backup and Restore app.
  • Backup your photos. Just copy the \DCIM\Camera folder to your drive.
  • Backup your phone ROM. Just boot to recovery (Power off, Hold Power and Vol Up button until the recover menu comes up) and do a backup.
Download the following files on your PC
Install Clockwork Recovery
  • Follow instructions on download.cyanogenmod.org/?device=crespo to install the Clockwork Recovery to your phone. (See Installing recovery using fastboot)
  • Note that I didn't wipe the data anymore. I just wiped the cache. All my apps and setting remained intact.
Install CM11
  • Follow instructions on download.cyanogenmod.org/?device=crespo to install the Clockwork Recovery to your phone. (See Installing CyanogenMod from recovery).
Enjoy your Kitkat!

Monday, August 05, 2013

Your car key remote got wet, what now?

My car key fell into a street drain where it lay there for at least 5 minutes before somebody was able to fish it out. The first thing you need to do is remove the battery and dry out the electronic parts. I used tissue paper to blot out all visible moisture. When everything appeared to be dry, assembled the key back and tried to open the car. Fortunately, it worked. A couple of hours later, it didn't work anymore. When I checked the battery again, there was a little water and it appeared that there was still moisture inside the casing.

The best thing to do here is to find silica gel or a dessicant which you can find inside new shoes or bags. If you can't find any, you can go to a supermarket and buy a pack of rice crackers. I knew One One Rice Crackers had a large pack of dessicant inside. That's the one on the left below. I found the one on the right from a Case Logic bag. Just pack these together with the electronic component of the car key in plastic bag. Seal it and leave it alone for at least 2 days. The objective here is to remove all moisture from the electronics. My key worked again after this. I am still keeping the key with the silica gel bags at least for the week to be sure. Hope this helps.

Silica gel or dessicant from shoes, bags or rice crackers.

Thursday, April 11, 2013

PDI Kettle 4.4.0 Missing MySQL and Oracle

Pentaho Data Integration (PDI) Kettle does not include all database JDBC drivers by default beginning with version 4.4.0. Oracle and MySQL, in particular are have been taken out. That means all your transformations and jobs that access those databases will not run until you copy the jdbc drivers to the libext folder.

The following table shows the comparison between an older version of PDI. The highlighted rows are no longer bundled by default, so you'll have to copy the drivers over from an previous version or download from the database vendor's website.

Sunday, March 03, 2013

To Do Lists and Task Managers

I have tried several apps to help manage my To Do list and so far cannot find the optimal system for managing tasks. If you've read Getting Things Done by David Allen, the key to an effective system is to have only one entry point for all tasks. To guide you on the path I had taken, here are the tools that I've used so far:

  • Google Tasks - Web. Officially available only on the web but handy because you are already logged in to Gmail, if you use that.
  • GTasks - Android. Syncs to Google Tasks, handles offline but syncing is slow. 
  • Astrid - Android. Syncs to Google Tasks, handles offline but syncing is slow.
  • Taskos - Android. Syncs to Google Tasks, handles offline but syncing is slow.
  • NoNonsense Notes - Android. Syncs to Google Tasks, handles offline but syncing is slow.
  • Any.Do - Android/iOS. Syncs to Google Tasks, handles offline but adding new items and syncing is slow.
  • Wunderlist - Android/iOS/Mac/Windows/Web. Syncs to own server. Handles offline. Fast to enter items. Does not handle nested tasks.
  • Evernote - Android/iOS/Mac/Windows/Web. Syncs to own server. Handles offline. Many taps to enter a task.
  • Trello - Android/iOS/Web. No offline mode. Very good visualization for teams.
  • Do.com - Android/iOS/Web. No offline mode. Ability to create templates to create a set of tasks for a new similar project.
My verdict: Wunderlist. You want to be able to enter items fast even when offline because keeping a task in your mind goes against GTD principles and increases the chances of it being left out. Wunderlist has the disadvantage of having to create another account but using the desktop app makes using it more convenient. The smaller feature set of Wunderlist forces you to keep your list clean and manageable, which is really the point of having a task manager in the first place.