Showing posts with label Netbook. Show all posts
Showing posts with label Netbook. Show all posts

Monday, October 27, 2014

I touched my laptop screen and I liked it

I finally decided that I needed a new laptop. My 2008 HP Mini was really showing it's age and I wanted to do some work with VMs that would tax my desktop. I did my homework and was content to buying low end laptop, hoping that Linux would be able to detect the 'standard' configuration without much fuss. Through a surprising turn of events, I ended up with a Lenovo IdeapadS410p Touch, a laptop with a touchscreen. It was an Intel i5 machine with 4GB of RAM (which I bumped up to 8GB), both VGA and HDMI outputs and a DVD drive to boot.
English: Touchscreen
Kids love a touchscreen (Photo credit: Wikipedia)
So how did it came about that way? I had done my homework and gone to buy the Lenovo laptop that didn't have an OS bundled or the 'DOS version' they called it. How many people buying new computers remember what the heck is DOS, is another question. But that range only came with AMD CPUs and having done that in the past (and got nothing other than a warm lap and mediocre performance), I decided to go for the Intel version, the i5 specifically. But to keep my options open, I decided to also keep an open mind on the the AMD A10 CPU which was by most reviewers as good as the i5 although meant to compete with the i7s.
Next was to find someone who knew what they were talking about. Too many times, I have been besieged by salespeople who knew little about what they were selling. It was time to give the right guy their due. I finally found a chap who gave me several options and let me try the laptops. Finally, I decided to ditch the A10 and went firm with the i5. He found me two models that fit the bill, a Windows 8 machine with a touchscreen and the OS-free version without a touchscreen.
For some reason, the non-touchscreen Lenovo laptop was slightly pricier and was a different model range. I did get the notion that the guy wanted to get rid of it because it was an older model. A quick check showed it was still listed as current on the Lenovo website, so I figured that it wasn't all that old. I figured I might as well see what the fuss was about Windows 8 and the touchscreen interface.

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.

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

Save the file as 10-ntpdate.sh 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}
fi

However, the file /sbin/ifup-local does not exist. So I created one with the ntpdate -u pool.ntp.org 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

Recently Popular