Archive for December, 2013

Database PDF Manafacture

Wednesday, December 11th, 2013

Database PDF Manafacture

Their comes a time when people want stuff printed, and no matter what you do, it will still have to be printed, and if your running big events, then that printing can get pretty troublsome, I was involved in building a little bit of a site, where we wanted to reduce people input in to generating printed documents. Essentially taking the copy and pasting out of the job, and as the posh people say “structering the data”.

 

 

So this meant HTML form to PHP to Databases and then to PDF’s

I used PDF’s as webpages don’t normally print very well and PDF’s are almost everywhere, they give a nice printed page, which you can print, and the most important thing is people understand them.

Tools used

  • jquery
  • PHP
  • MySQL
  • tcpdf
  • HTML

The jquery was use in form validation, as show in a earler post http://patrickrice.net/blog/2013/10/form-validation/

PHP was used to process the forms, in the standard way and then insert the code in to the database, but using Prepared statements and stored procedures (http://php.net/manual/en/pdo.prepared-statements.php)

Then using the database and tcpdf (http://www.tcpdf.org/), you could generate pdfs on the fly from the data base, here is a sample of the code below.

CryptoLocker virus/ransomeware

Tuesday, December 10th, 2013

Just to make people aware, there is a new virus (technically ransomware (http://www.microsoft.com/security/resources/ransomware-whatis.aspx) ) that is doing the rounds. It’s been in the wild for a while, but seems to be getting more media attention these days.

Basically once you click on a e-mailed link it will encrypt files it can access on your hard drive. The engineering beauty of this virus is that it encrypts your files, and then contacts you to demand a ransom in the form of bit coins (http://bitcoin.org/en/) to decrypt your drive. So it becomes a case of pay up or your data is gone, if you have backups on another drive you should be able to restore to that drive, however if your do not have backups your data is basically gone as the encryption is uncrackable at the moment.

The above has a less chance of happening if you are running non system administrative privileges, You can read more about how a US police force had to pay to get there data back on the link below, it’s a pity they didn’t have backups. http://www.theguardian.com/technology/2013/nov/21/us-police-force-pay-bitcoin-ransom-in-cryptolocker-malware-scam

You can read more on: http://www.f-secure.com/weblog/archives/00002640.html