Wednesday, September 18, 2013

Fix CMOS Battery Issue with NTP: the NetworkManager Edition

While in the previous article, I described a solution to trigger a script when the network goes up. This works on most server Linux setups but it does not work if you are using NetworkManager. NetworkManager has a different way of doing this. If you are not sure whether you are using NetworkManager, consider this: if you are using a wireless network and configuring it using an applet in the task bar or through a GUI program, it's likely that you are using NetworkManager. That and the fact that the script in my previous article didn't work.
English: The default NetworkManager applet
NetworkManager applet (Photo credit: Wikipedia)
NetworkManager can still do it. It can run scripts after a network interface is connected or disconnected. It's just not apparently forthright about it. But first a little clarification. In Linux parlance, when a network is connected, it is known as "a network being brought up". This is because the network interface state is changed from DOWN to UP.  And vice versa. When talking about network connections, both set of terms are used interchangeably.
NetworkManager offers this feature through a mechanism called a dispatcher. Basically, the dispatcher looks into the /etc/NetworkManager/dispatcher.d directory and run scripts saved in there. Scripts start with a two digit number that determines the order they are run. The scripts are passed two parameters from the main NetworkManager system. They are the network interface that was connected or disconnected and whether it was connected or disconnected.
In my case, I didn't care which network interface it was but it had to be just connected. So the script looked something like this.

# Run ntpdate when network interface goes up using NetworkManager
export LC_ALL=C
if [ "$2" = "up" ]; then
        /usr/sbin/ntpdate -u
        logger Updated time due to network interface going up

Save the file as and change it's attributes to be executable. Drop that into the /etc/NetworkManater/dispatcher.d directory. That's it.

Thursday, September 12, 2013

Solve CMOS Battery Issues with NTP

A Hewlett-Packard Mini 1000 netbook computer, ...
Hewlett-Packard Mini 1000 netbook Photo credit: Wikipedia)
I guess it was time. My HP Mini 1000 netbook was giving me the wrong time and date every time it booted up. It made going to websites with HTTPS impossible because I was apparently accessing them from the past. Resetting the time didn't work because it would forget the current time and reset back to 2002. I would then manually reset the time using ntpdate.
After a few times, I got tired of this and decided that there is a better way. Since the netbook is connected to the Internet most of the time, I knew that a script could be triggered to run every time the network card started up. All I needed to do was to add the ntpdate command and options to it. Problem was I didn't know what script it was. I wasn't also big on making a custom change that would affect future updates.
I knew the scripts that set the network configuration was in /etc/sysconfig/network-scripts. My network interface family was eth so the script that set it up was /etc/sysconfig/network-scripts/ifup-cfg. At the of end of the file was the command

exec /etc/sysconfig/network-scripts/ifup-post ${CONFIG} ${2}

Reading the /etc/sysconfig/network-scripts/ifup-post file, I found the following command at the end.

if [ -x /sbin/ifup-local ]; then
    /sbin/ifup-local ${DEVICE}

However, the file /sbin/ifup-local does not exist. So I created one with the ntpdate -u command in it.  So now, every time the network is configured, the time is correct.
I know it doesn't address the problem of the battery being dead or needing replacement but it'll do for now.

This didn't work for you? Maybe you're using NetworkManager. Run NTPDate automatically with NetworkManager too.

Enhanced by Zemanta

Wednesday, September 11, 2013

Reveiw of Blogger for Android 2013

Updated September 2012.
I am posting this on Blogger for Android. I am happy to report that it is a better app than the previous version. I am also not happy to report that Google has delivered a product that seems to be uneven and confusing to first time users, again.
There are many things to like about this app. All of your Blogger blogs and their posts are immediately accessible. It is faster and more responsive. Switching between blogs is almost immediate. It does feel like the Blogger App is pulling the RSS feed of the blog instead of pulling it directly from the Blogger system but it still works quickly. (Which should help explain the problem I had were the Blogger app just stomped over a published post).
This is icon for social networking website. Th...
(Photo credit: Wikipedia)
If you are a Blogger user and need to note ideas for posts and work on drafts, this is what this app seems to be built for. However, since there is little or no layout formatting options, sites whose design language calls for a specific layout (e.g. each post has to have a related photo on the left side of the post), will find that final posting will still have to be done at the PC. Which is odd is because one of the highlighted features is the ability to include photos taken from the phone's camera. 
In fact, if you are thinking of using Blogger for Android as part of your blogging workflow, consider this advice: opening a saved or published post is a multi-step processs. First, the app will show the complete post, including labels. Then you need to select or activate/touch the post text to edit it. The good news is that it now hides the HTML formatting and show the complete formatting. 
Post settings are still missing from the Blogger App. But handling labels has improved. There has always been the ability to add labels to the post edited but now when you start typing, you get a list of previously used labels. Which is really useful if you have many labels and can't remember which one to use off the top of your head. There is still no Schedule option to schedule when you post will be posted. This makes using the App to post on Blogger seem like an all or nothing proposition. And knowing other Blogger users, they will miss the powerful SEO-friendly option of providing a search description because it still isn't available.The Blogger App for Android (2013) is now good to use for general blogging but leans towards immediate posting.
It could be that Google is now leaning towards Google+ a blogging platform. However, Google+ is still missing a killer feature: to customize the layout and therefore the user experience. If you blog using Google+, your posts is just a post in a stream of other posts. You can set up Google+ Pages but your audience will mostly come from reading your post in their stream as opposed to going to your specific Google+ page.
Also is missing is a way to monetize your Google+ posts or page. This could mean people who do make money from Ads will not be interested in posting in Google+. They may post publicly there to reach a bigger audience but it'll just link back to their Blogger site. It may not be a big revenue generator for most but some prolific posters will find posting solely to Google+ to blog, a turn-off.
Again, download the Blogger App for Android because it is great for capturing ideas and first-drafts. It is also increasingly becoming an equal companion to the Blogger site. 
Enhanced by Zemanta

Tuesday, September 10, 2013

TFS Internet Gateway: The way to connect commercial mail systems in the mid 90s

TFS Brochure from Australia
Back in the mid-1990s, I was connecting businesses to the Internet. I was selling software to connect people to the Internet. This was back in the day when you had to buy software to connect to the Internet. It was even pre-Windows 95 times. What many people don't remember was that Microsoft wanted to charge extra for software to connect to the Internet. They called the add-on pack Windows 95 Plus Pack. I was selling a software suite called Internet-In-a-Box which competed directly with them. Truth be told, there were free software available to connect people to the Internet but this was early days and you had to have skills (like editing a text file) to setup things correctly. Strange thing was that I was still selling Internet in a Box pretty well even though competing with Microsoft. The Box had more software. Internet In a Box's big brother package, even had a sweet TN3270 terminal emulator. But I found out that people were buying it because the setup was easier and we provided phone support. Try getting that from Microsoft back then.
My boss and I saw the writing on the wall and we started to diversify. We were talking to a lot of companies that were interested in the Internet. But most of them were interested in the Internet as a resource not for communication. It's not like they didn't have e-mail systems. They did have e-mail systems for internal communications but they were built just for that: internal communication. Most of the systems didn't have the optional module of connecting the e-mail system to the Internet.
A little work on the Internet and I found this unique product from Sweden called TFS Gateway. They have been making a living building a system that allowed different commercial e-mail systems to talk to each other. They did this by using the mail system's API or mimiced a remote system via the e-mail system's remote gateway. TFS Gateway converted mail messages into a common format (pseudo X.400) before passing them on to their final destination. It supported Microsoft Mail, Lotus Notes and cc:Mail and Novell GroupWise. What interested me was that TFS Gateway also had a module that connected to Internet mail systems, specifically, an SMTP gateway. A market opened up as more and more companies saw the benefit of Internet mail communications and wanted to connect their systems to the Internet.

Recently Popular