Mashape Weather API Update Fallback Mechanism

Mashape Weather API had been updated with fallback Mechanism. The default API Provider will be Yahoo Weather, the fallback API provider currently support Open Weather Map. If Yahoo Weather is down, the fallback API will be called, so reduce fail chances.

Personal hourly alert will be sent to me if fallback API really triggered.

Read more on https://www.mashape.com/fyhao/weather-13/announcements

Custom PushBullet Apps

Just share my experience on writing a custom client apps for PushBullet, no code sharing, but just ways how to achieve it.

Recently I just started using PushBullet and I found it is useful and wonderful for personal use. PushBullet is a service allows sharing content (note, link, address) across devices (desktop, mobile, browser). You can add own devices, contacts, then you can share content from one device to another. Say I found an interesting link on iPhone, I can open PushBullet iPhone Apps and share to my Google Chrome. Google Chrome extension can be installed such that a desktop notification can be triggered whenever new PushBullet messages come in. It is free service, so, very good.

But I really really disappointed as currently no feature to clear all the messages, I can only delete one by one either from the desktop website or through PushBullet iPhone Apps. So I decided to write my own PushBullet client apps to get rid of this. Very easy, just less than 30 minutes, to write a perfect, no bugs, quite good user experience (just for my own use, I am technical person, so not need so beautiful).

First, I downloaded a PHP library that interact with PushBullet. OK, I also can use Node.JS but due to some reason PHP is more comfortable for me. I may also able to use iPhone Library but, I had another use case that need server side. Say my other Node.JS apps found some links and need to notify my PushBullet, they can call my PHP API to send PushBullet. I developed many many small apps, one apps do one thing, all for my personal use. OK, next.

The PHP API did very simple thing, register device identifier (from PushBullet) createDevice, push note (pushNote), push link (pushLink), delete the pushes (deletePush), internal database to store the pushes message identifier.

I then quickly create an iPhone Apps using Titanium Mobile (JavaScript), interact with PHP API. From there, I can see a list of content. And a new feature that is different from official PushBullet apps I added is clear all pushes. This is the only and very simple feature that I really really need. So it will call my PHP API where it pull out the stored message identifier, then call PushBullet deletePush API one by one, it might takes some longer time. So I hope PushBullet can release another API method, either provide deletePush for multiple identifiers, or provide ways to clear all messages.

After integrate PushBullet into my personal apps, looking forward it will be able to increase my productivity on works.

Erlang学习:尾递归

Erlang学习:尾递归
我看一篇文章,他们建议可以不用递归(Recursion)就尽量不用,因为递归会影响性能,比如 stacks leaks。递归就是 function 自己 call 自己。但是我想到 Erlang 作为一个 Pure Functional 的语言,它没有 if for loop,它严重依赖递归实现,那么它不是很容易造成 stacks leaks 吗。
这个时候我们要改造我们的递归成为尾递归,Tail Recursion…

Link: http://nxlhero.blog.51cto.com/962631/1105545

OpenWorm Projects

OpenWorm is an open source project and open science community dedicated to creating the world’s first whole organism in a computer, a C. elegans nematode, via bottom-up “systems biology” computational modeling. It is an association of highly motivated scientists and engineers who believe in Open Science and Open Access.

Read Project Background which it established on 2011. “We are building a simulation platform to prove it is possible to make good models of complex neuronal activity, starting with a digital worm. We are making the simulation platform open source because we believe anyone should be able to use it to understand how neurons and cells work.”

Project OpenWorm hosted on Github.

List of Projects by OpenWorm:

  • Neuromechanical modeling with Sibernetic
  • Geppetto Simulation Engine
  • Movement validation
  • Optimization engine
  • Data collection and representation
  • Community outreach

Who to get involved? Coder, Scientist, Writer, Artist, WebMaster, Philanthropist, or be a Curious citizen.

Watch out a video a brief introduction to OpenWorm.

Get Notified When Linux Authentication Happened

Recently I initialised a new Linode CentOS without doing any hardening yet, I want to be informed if any unauthorised login, here is how I doing it:

vi /etc/profile.d/login.sh
curl "http:///notifier?message=LinodeUserLogIn" &
chmod +x /etc/profile.d/login.sh

Exit from ssh, and relogin, the above URL will be called and my iPhone will receive Push Notification.

And just the next day I detected unsuspicous login then… immediately shutdown the Linode.

Server down management via iphone apps

Just now when i reach sg custom, receive per minute alert. As my personal linux server monitoring apps down.
I quickly open my iphone monitoring apps to check, really cannot connect the server.
I open SSH apps to check it. Found there is code problem i changed afternoon.
I open FTP Client Pro to edit the code.
Use SSH apps to restart the apps.
Then i received the good alert message.
Actually, I had a server monitoring apps to monitor some other apps. And had another apps to hourly monitor the server monitoring apps which hosts own other server. So as long as alert server is not down, the other servers down i still can get alert, and start it, they just works as expected.