logIt Log Around The Clock

Coding

programming, coding, scripting

Nebri Automation for Weather Feed to Twitter

The season was intermittently rainy or dry as I began to take interest in weather. After getting stuck with “If-this-than-that” (IFTTT) for multiple location feeds of weather, I found out that I wasn’t alone, a geek hit the same wall, yet bringing another automation forgery: Nebri OS, an event-driven development platform based-on writing rules in [...]

Get Commuter Train Trouble Alert Delivered to Watch by IFTTT

Imagine getting alerts of Commuter Line train service disruption right on your wrist! Well, the watch thing isn’t a must as any SMS-enabled phone will do. But without the watch, I won’t be introduced to “If-this-than-that” (IFTTT), a simple logic line that glues popular apps into trigger and action branded as recipes. Anyone can code [...]

Any m-by-n Matrix Keypad for Raspberry Pi

What about instantiating any m x n matrix keypad by a Python class? Raspberry Pi takes me to learn how to build a Python class for the first time while expanding my initial WiringPi-based matrix keypad into a derivative work. A matrix keypad instance is defined by: Actual GPIO pins used forming the row and [...]

Acknowledging Event: Zabbix Python API

Acknowledgement is one of the things that is provided by Zabbix API in its event section. We can make use of the methods get() and acknowledge() to automatically acknowledge an event. Digging through the attributes of those methods, the official doc doesn’t provide complete example to follow. Added with some luck, my search get me [...]

Close Low Level Socket in Python

tags:

Important to do in socket programming is to close the socket. Python.org says Close the socket. All future operations on the socket object will fail. The remote end will receive no more data (after queued data is flushed). Sockets are automatically closed when they are garbage-collected. I implemented this low level networking interface for a [...]

Embed Tag Cloud (In Other Than Sidebar)

I try to embed WordPress tag cloud to the header part of the theme. Tag print is called from wp_tag_cloud(‘smallest=8&largest=16′). One example would be by inserting that function in this part of header.php of the corresponding theme: 1 2 3 4 5 6 7 8 9 10 <div class="header"> < ?php if (is_home()) : ?> [...]

Write WordPress Plugins to Play Freemind Mind-Map File

The first version main goal is to embed the *.mm file which is a Freemind file. I found similarity of embedding this kind of file in flash-video-player plugins (I used version 3.1.8). So, I tried to reverse engineer by mind-mapping how it works first and how to hook plugins to WordPress. Here is version 1.1 [...]

MicroBlogger Add Search Feature (1)

This is mainly about view of custom search page (not about searching itself). Adding “Search” To Main Link Tabs Changes to file under /app/omb/plugins/ wp.php security.php In wp.php: Adding $links[’Search’] = $request->url_for(’search’); between ‘Personal’ and ‘Profile’ would bring out the ‘Search’ tab in main link-tabs. In security.php Adding function security_init() { … $request->connect( ‘search’ ); [...]

Function Return Value ?

tags:

The following function: 1 2 3 processLine(){ <strong>line</strong>="$@" } Does it have some sort of “return value”? (in this case the variable line) by calling it through: processLine $line echo $line In the above example, I echo the value of line after being processed by processLine(). (?)

Startup script for TAP interfaces

To add startup script we can use: System > Preferences > Sessions local boot script (as services start/stop in /etc/init.d/) I added the following shell script: setup-tap: #! /bin/bash tap_up() { tunctl -t tap0 -u $USER tunctl -t tap1 -u $USER ifconfig tap0 192.168.20.1 ifconfig tap1 192.168.40.1 #iptables -t nat -A POSTROUTING -o eth1 -j [...]