Archivi categoria: Programmazione

Digging through the Navionics API v2

Phew, it’s been a really long time since I even looked at this blog.

So now I’m running on the same Arch Linux I’ve had for five years now, I got a surgery and I am recovering.

My mom opened her site at least, and she’s doing great. She got a FB page too. Ah, Facebook… if only Diaspora* took over the world might be a better place now.

I thought it would be really cool to embed Navionics maps on her site, since the head of nearly every post is: “how to get to that beautiful Mediterranean bay without sinking your sailboat on an underwater rock“.

Navionics did a good job documenting the API to embed a map on your website. It looks all beautiful and dandy until you try to request the key from their form, get redirected to a 404 page and receive this email:

Dear Partner,
Thanks for your interest in our Web API.

Download the Web API instructions here: http://webapiv2.navionics.com/index-api.html
Download the Terms of Service you agreed to here: http://www.navionics.com/en/web-api-terms-serviceen .
Don’t hesitate to contact us at apisupport@navionics.com for any technical questions.

Best regards
Navionics

UPDATE: to get the key you only need to request it at the email address provided above. They will check the website you intend to host the map on before giving you the key. Fair enough. If only a simple sentence (like “we’ll examine your site asap and if it looks nice by us we’ll be pleased to email you back with your API key”) was present, all the techniques I described in this post wouldn’t have been necessary.

Their ToS don’t allow you to tamper with their code: exactly what I did in this blog post. Since their business (aka: how they pay their meals) is to sell the maps they’re so kind as to give us free, I feel somehow morally obliged to respect their rules.

Yeah, it’s easy to get all moral and honest when you are given the key. This post explained how to get their maps nonetheless, because these are absolutely fantastic. We’ve been using them for years now on our GPSes.

TL;DR: this post has been voided because they need to make a living with something they’re giving away for free.

 

Contrassegnato da tag , ,

Getting Started with Simulink

It’s been a long time since I wrote something here. But this one deserves a post for sure.

That’s it: I wrote a book. The book is sold in the whole world, and it’s the best one you could gift to your grandma this year, so I’ll say it’s a worldwide bestseller. Get it while it lasts!

Edited by Packt Publishing. Thanks guys!

Yes, it’s on Amazon.com! Hipsters, rejoice! I wonder how the Kindle version looks like — I have to grab one sooner or later.

America! Fear not! It’s on Barnes&NobleSafari and O’Reilly too!

As you may already have understood, this book isn’t going to be the next 50 shades of #7F7F7F, but I hope it will be useful to the many desperate students and engineers out there.

Ah, it’s a book about MathWork’s Simulink®, most likely the only proprietary software I’m using (I’m actually working with it all the time).

getting-started-with-simulink-preview

First review!

The book has already been reviewed by Andrew “08milluz” Milluzzi (he put the review on Amazon too). It feels quite strange to have a book reviewed, and his review is just wonderful. I liked a lot this one:

The book builds quickly and at first it seems like Zamboni is throwing everything but the kitchen sink at you.

marble kitchen sink

Well, that was called for. :-)

UPDATE#1: Packt is throwing an eBook bonanza until January 3, 2013! My book now costs less than 4€! Oh well, I’m not getting rich this time.
UPDATE#2: I found on twitter (#simulink) another review by Erik Newton on matlabrecipes.com. This one felt the kitchen sink in Ch.4 :-)
UPDATE#3: Well, it looks like Amazon.co.uk reviews don’t appear in other Amazon.* sites. Have a cup o’ tea, please.

Contrassegnato da tag , , , ,

FluxBB with PHPass

FluxBB logoAs you may know I’m a GameZoo associate and I currently mantain their servers, and the site as well.

I’m migrating the old forums, that were pretty unmaintainable, to FluxBB 1.5.0.

FluxBB is an incredibly fast and simple forum software, and it runs without hassle on nginx.

The problem with FluxBB is that it stores user passwords as SHA1 hashes, a practice that nowadays is regarded as “unsecure”.

So I edited some files and plugged in PHPass, used by Drupal, Joomla! and PHPbb among the others. It works very nicely, and it was an easy job given how easy to read is the FluxBB code.

Grab your copy of FluxBB+PHPass on my github!

BIG WARNING: that code is intended for new installations. I removed from the login.php file the code that was updating passwords from older FluxBB versions! Do not use this code to update an existing forum, unless you write your own updating method. Moreover, the password field on the database has been stretched to host 60 chars instead of 40, so it could be incompatible with old versions. No, I didn’t write any update code since it was not my goal: I am migrating data from another forum software, so I started with a clean FluxBB install.

Link: https://github.com/sevendays/fluxbb15-GZ/tree/fluxbb-1.5.0-with-PHPass

Please note: don’t pull the master branch, I’m using it for my gamezoo migration project! Pull the tag “fluxbb-1.5.0-with-PHPass” instead.

Contrassegnato da tag , ,

Git server with FreeBSD, nginx and cgit

Well, I had to put up a git server at work.

So I wrote three html pages:

Git server setup with FreeBSD, nginx and cgit (broken link)

Git client setup with FreeBSD or Linux (broken link)

Git client setup on Window$. Pure $hit with TortoiseGIT (broken link)

Git is fun, actually. I even made a github repository, but I must admit I don’t code much: I tried to start developing on ioquake3 code… not much has been done so far.

Well, if you’re interested… My github

Contrassegnato da tag , , , ,

PHP-FPM in FreeBSD!

Finalmente PHP5.3 è entrato in FreeBSD, e con questo anche PHP-FPM!

ED ERA ANCHE ORA.

Spiegazione: per poter usare script php con il vostro webserver preferito (ovvero nginx, se lo usano wordpress e youporn un motivo c’è: dà pesantemente merda a apache) prima di FreeBSD 8 l’unica era compilarsi a manina php5.3, che contiene php-fpm.

FPM significa “FastCGI Process Manager”: la maniera più comoda, più naturale, più sensata per avere uno o più processi php verso cui nginx può indirizzare le richieste tramite fastcgi.

E ho pianto sangue e sperma dal culo, e ho compilato, e ovviamente non funziona mai un cazzo al primo colpo perché murphy ci odia inspiegabilmente, e dio più che dare una mano ti dà un fracco di legnate.

ORA TUTTO QUESTO HA UNA FINE.

ORA TUTTO SI INCASTRA.

PERFEZIONE.

Contrassegnato da tag ,

SlidingForms / Form Fiqui Con Javascript E CSS

Schermata ed esempiolinkgo per chi non possiede il dono della pazienza:

exclamation.png L’esempio non si vede granché bene con Internet Explorer <7 poiché contiene PNG trasparenti.
Non mi frega un cazzo se lo state usando, quindi non segnalatelo nei commenti perché ve li cancello come SPAM. Che il vostro PC possa essere stuprato dai peggiori virus circolanti e i vostri dati personali regalati ad ogni serial killer del pianeta!

Sliding Forms by SevenCapitalSins

Ok, dopo le dovute presentazioni happy passiamo alla teoria!

Continua a leggere

Server Internet Casalingo Con Debian/Ubuntu

Ecco un’altra guida da newbie a newbie!

Apache powered

Installare un server a casa propria e visibile da Internet non è mai stato così facile!

Ecco i requisiti:

  • Un vecchio PC
  • Una connessione Internet sempre attiva
  • Un’oretta di tempo
  • Un’infarinatura di HTML

Al termine di questa guida avrete anche voi un sito Internet! Continua a leggere

Kill Bill

Ancora una notte insonne passata a consultare siti e manuali di CSS solo perché il box model di Internet Explorer è uno scolapasta.

Continua a leggere

Javascript: Smooth Scroll

PROBLEMA:

Avete fatto una chat AJAX perfetta perfettina e la consegnate al Cliente tutti contenti.
Ma il Cliente (che ha sempre ragione) dice: «Mah, è bella sì, ma manca qualcosa…»
Voi, tuta blu dell’informatica, chiedete affranti: «Che cosa?» e pensate senza dirlo: «Manca quella bagascia puttana di tua nonna».
Il Cliente con quell’aria da sapiente alla Padrino di Marlon Brando che hanno tutti gli ignoranti quando non sanno bene cosa dire risponde: «Qualcosa… Ecco sì, qualcosa che la renda differente dalle altre!»

Come fare? Continua a leggere