Posts Tagged ‘laptop’

Make Laptop Sleep on LID (Monitor) close in Linux Debian and Ubuntu systemd Linux

Monday, June 22nd, 2020

make-laptop-auto-sleep-on-lid-close-in-Linux-Ubuntu-Debian-Linux

 

 

I need to make my laptop automatically sleep on LID Screen close but it doesn't why?

If have used your laptop for long years with Windows or any Windows user is used to the default beavrior of Windows to automatically sleep the computer on PC close. This default behavior of automatically sleep on LID Close has been Windows standard for many years
and the reason behind that usually laptop is used for mobility and working on a discharging battery so a LID screen close puts the laptop in (SLEEP) BATTERY SUSPEND MODE aiming to make the charged battery last longer. However often for Desktop use in the Office LID close 
trigger of laptop sleep mode is annoying and undesired I've blogged earlier on that issue and how to make laptop not to sleep on LID close on M$ Windows 10 here.

This bahavior was copied and was working in many of the Linux distributions for years however in Debian GNU / Linux and Ubuntu 16.X this feature is often not properly working due to a systemd bug. Of course closing the notebook LID screen without putting
the PC in sleep mode is not a bug but a very useful feature for those who use their laptop as a Desktop machine that is non-stop running, however for most ppl default behavior to auto-suspend the computer on Laptop Monitor close is desired.

Here is how to  force the close of the laptop lid to go to suspend/sleep mode and when open the lid, it wake it up.
 

 

1. First requirement is to make sure the laptop has installed the package pm-utils, if it is not there install it with:

 

# apt-get install –yes pm-utils

 

2. Next we need to edit logind.conf and append 3 variables

 

# vim /etc/systemd/logind.conf


Normally the file should have a bit of commented informative lines as well as a commented variables that could be enabled like so:

 

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192


These entries are usually the files that are used by default as a systemd settings.
Before starting make a copy just you happen to mess systemd.conf, e.g.:

 

cp -rpf /etc/systemd/logind.conf /etc/systemd/logind.conf_bak


To make the PC LID close active append in the end of file below 3 lines:

 

HandleSuspendKey=suspend
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend

 

systemd-logind-conf-enable-suspend-sleep-on-laptop-lid-screen-close-linux

Save the file and to make systemd daemon reload restart the PC, even though theoretically systemd can be reloaded to digest its new /etc/systemd/logind.conf with:

 

# systemctl daemon-reexec

 

3. Assure yourself the Power Management LID setting of the Desktop Graphical User Interface are set to SUSPEND on close


I use MATE Desktop environment as it is simplistic and quite stable fork of GNOME 2.0, anyway depending on the GUI used on the Linux powered laptop e.g. GNOME / KDE Plasma / XFce etc. make sure the respective
 

Control Panel -> Power Management


settings are set to Force the Laptop Screen LID SUSPEND on Close.

Below is how this is done on MATE:

power-management-preferences-when-lid-is-closed-MATE-on-AC-power

power-management-preferences-when-lid-closed-on-battery-suspend

That's all folks, now close your Laptop and enjoy it going to sleep, open it up and get it awaked 🙂 Cheers ! 

 

Make laptop not to sleep on close on Microsoft Windows 10 / Disable notebook LID close sleep Windows

Thursday, November 8th, 2018

Windows10-Define-power-options-actions-settings

I have to use Windows 10 Enterprise on a notebook for Work purposes once again and use a Docking station connected to an external Display Monitor at the Company Office work location one of the first things to configure is to disable LID Display Sleep on laptop close because otherwise the notebook has to be left opened almost half opened in order to work with the PC to change that unwanted behavior there is an easy way via Windows Control Panel configuration, here is how:

Open

Windows Control Panel 

 


navigate to:

edit-plan-settings-power-settings-windows-10.png

 

 

 

Power Options


choose:

Change advanced power settings, scroll down a bit to:

power-options-power-buttons-and-lid-lid-close-action-do-nothing-windows-10-scresnshot

 

Power Buttons and lid (menu) 


press over it from sub-menu
 

Plugged in

 


Select

 

 

Do nothing

 


That's all from now on closing the notebook when plugged in to the Dock station or to a direct External Monitor will no longer do the sleep.

As you can see from the menus, there is a lot of triggering rules to configure further from Power Management (Advanced Settings) on how applications / USBs / Multimedia and Hard Disks should behave under different power conditions so if you have the time I recommend you go through them and check them for yourself.

Why don’t you use Window Maker GNU Step to improve your computer interaction performance

Monday, October 30th, 2017

Why-dont-you-use-Window-Maker-graphical-environment-for-your-GNU_Linux-FreeBSD-desktop

If you're pissed off too already of GNOME 3 Unity / GNOME 3 Flashback and KDE Plasma  as I am you perhaps are looking for something more light weigth but you're not okay with default Debian Cinnanom GUI environment or you don't feel confortable for system administration jobs and programming with XFCE then perhaps you would like to give a try to something more old school but build with good design in Mind.

Those who are fans of the evil genius Steve Jobs (as Richard Stallman use to call him), definitely Remember NeXT company and the revolutionary Graphic Environment they tried to develop NeXT Step then you'll be happy to hear about GNUStep  which historically was called AfterStep and is a Free Software remake of NextStep graphical environment for Free and Open Source operating systems (FOSS) such as GNU / Linux and FreeBSD / OpenBSD / NetBSD etc.

Amanda_the_panda_mascot_of_window_maker-graphical-environment-system

Amanda the Panda is the mascot of Window Maker. She was designed by Agnieszka Czajkowska.

The good thing about Window Maker and the complete bunch of desktop environment GNUStep is it much lighter and less complex than the more and more becoming bloated modern Free Software graphical environments, it definitely easifies the way the user interacts with basic browsing with Firefox / Opera, terminal code writting or command system administration and basic chat functionalities such as with Gajim or Pidgin and basic email writting operatins be it with some text email client such as Mutt or with Thunderbird. Its great also to reduce the overall load the Operating System puts on your brain so you can have more time to invest in more useful stuff like programming.

windows-maker-increase-performance-of-work-with-your-computer-howto-wmaker-screenshot

After all simplicity in Operating System is a key for an increased productivity with your computer.
Besides that stability of Window Maker is much better when compared to GNOME and GNOME 2 fork MATE graphical environment which nowadays in my opinion is becoming even more buggy than it used to be some years ago.

Below is how Window Makers site describes Window Maker:

"Window Maker is an X11 window manager originally designed to provide integration support for the GNUstep Desktop Environment. In every way possible, it reproduces the elegant look and feel of the NEXTSTEP user interface. It is fast, feature rich, easy to configure, and easy to use. It is also free software, with contributions being made by programmers from around the world.

Window Maker has a stable user interface since many years and comes with a powerful GUI configuration editor called WPrefs, which removes the need to edit text-based config files by hand. It supports running dockapps which make everyday tasks such as monitoring system performance and battery usage, mounting devices or connecting to the internet very easy. Please see the features section for more specifics on what Window Maker can do, and how it compares with other popular window managers."

Window Maker is bundled with a number of useful applications which gives ability to put Dock applets easily for easily intearcive desktop update of current Weather Report, Monitoring Network Traffic, TV Player (video4linux), laptop battery info dock, CD player and Volume control management app, text editor, pdf viewer, integrated Mail application, Calculator, RSS Reader, GNUStep games and much useful things to customize from the desktop resembling many of the basic features any other graphical environment such as GNOME / KDE Provides.

The User Interface (UI) of Window Maker is highly configurable with an integrated WMaker tool called

WPrefs

Why-dont-you-use-Wmaker-for-better-desktop-performance-Windowmaker_colour_preferences

All generated settings from WPrefs (Window Maker Prefernces) GUI tool are to be stored in a plaintext file:
 

~/GNUstep/Defaults/WMRootMenu

All Wmaker configurations are stored inside ~/GNUstep/ (Your user home GNUStep), so if you're to become its user sooner or later you will have to get acquired to it.

Wmaker is very minimalist and the performance is killing so Window Maker is perhaps the number one choice Graphical Environment to use on Old Computers with Linux and BSD.

Below is a full list of all packages installed on my Debian GNU / Linux that provides WMaker / GNUStep great functionalities:

root@jericho:/home/hipo# dpkg -l |grep -i wmaker; dpkg -l |grep -i gnustep
ii  wmaker                                        0.95.8-2                             amd64        NeXTSTEP-like window manager for X
ii  wmaker-common                                 0.95.8-2                             all          Window Maker – Architecture independent files
ii  wmbattery                                     2.50-1+b1                            amd64        display laptop battery info, dockable in WindowMaker
ii  wmcdplay                                      1.1-2+b1                             amd64        CD player based on ascd designed for WindowMaker
ii  wmifs                                         1.8-1                                amd64        WindowMaker dock app for monitoring network traffic
ii  wmnut                                         0.66-1                               amd64        WindowMaker dock app that displays UPS statistics from NUT's upsd
ii  wmpuzzle                                      0.5.2-2+b1                           amd64        WindowMaker dock app 4×4 puzzle
ii  wmrack                                        1.4-5+b1                             amd64        Combined CD Player + Mixer designed for WindowMaker
ii  wmtv                                          0.6.6-1                              amd64        Dockable video4linux TV player for WindowMaker
ii  wmweather                                     2.4.6-2+b1                           amd64        WindowMaker dockapp that shows your current weather
ii  wmweather+                                    2.15-1.1+b2                          amd64        WindowMaker dock app that shows your current weather
ii  addressmanager.app                            0.4.8-2+b2                           amd64        Personal Address Manager for GNUstep
ii  agenda.app                                    0.42.2-1+b7                          amd64        Calendar manager for GNUstep
ii  charmap.app                                   0.3~rc1-3                            amd64        Character map for GNUstep
ii  charmap.app-common                            0.3~rc1-3                            all          Character map for GNUstep (arch-independent files)
ii  cynthiune.app                                 1.0.0-1+b4                           amd64        Music player for GNUstep
ii  dictionaryreader.app                          0+20080616+dfsg-2+b6                 amd64        Dict client for GNUstep
ii  edenmath.app                                  1.1.1a-7.1+b1                        amd64        Scientific calculator for GNUstep
ii  gnumail.app                                   1.2.2-1.1                            amd64        Mail client for GNUstep
ii  gnumail.app-common                            1.2.2-1.1                            all          Mail client for GNUstep (common files)
ii  gnustep                                       7.8                                  all          User applications for the GNUstep Environment
ii  gnustep-back-common                           0.25.0-2                             amd64        GNUstep GUI Backend – common files
ii  gnustep-back0.25                              0.25.0-2                             all          GNUstep GUI Backend
ii  gnustep-back0.25-cairo                        0.25.0-2                             amd64        GNUstep GUI Backend (cairo)
ii  gnustep-base-common                           1.24.9-3.1                           all          GNUstep Base library – common files
ii  gnustep-base-doc                              1.24.9-3.1                           all          Documentation for the GNUstep Base Library
ii  gnustep-base-runtime                          1.24.9-3.1                           amd64        GNUstep Base library – daemons and tools
ii  gnustep-common                                2.7.0-1                              amd64        Common files for the core GNUstep environment
ii  gnustep-core-devel                            7.8                                  all          GNUstep Development Environment — core libraries
ii  gnustep-core-doc                              7.8                                  all          GNUstep Development Environment — core documentation
ii  gnustep-devel                                 7.8                                  all          GNUstep Development Environment — development tools
ii  gnustep-games                                 7.8                                  all          GNUstep games
ii  gnustep-gui-common                            0.25.0-4                             all          GNUstep GUI Library – common files
ii  gnustep-gui-doc                               0.25.0-4                             all          Documentation for the GNUstep GUI Library
ii  gnustep-gui-runtime                           0.25.0-4+b1                          amd64        GNUstep GUI Library – runtime files
ii  gnustep-icons                                 1.0-5                                all          Several free icons for use with GNUstep and others
ii  gnustep-make                                  2.7.0-1                              all          GNUstep build system
ii  gnustep-make-doc                              2.7.0-1                              all          Documentation for GNUstep Make
ii  gomoku.app                                    1.2.9-2+b2                           amd64        Extended TicTacToe game for GNUstep
ii  gorm.app                                      1.2.23-1                             amd64        Visual Interface Builder for GNUstep
ii  gridlock.app                                  1.10-4+b2                            amd64        Collection of grid-based board games for GNUstep
ii  grr.app                                       1.0-1+b2                             amd64        RSS reader for GNUstep
ii  gworkspace-common                             0.9.3-1                              all          GNUstep Workspace Manager – common files
ii  gworkspace.app                                0.9.3-1+b2                           amd64        GNUstep Workspace Manager
ii  helpviewer.app                                0.3-8+b3                             amd64        Online help viewer for GNUstep programs
ii  libaddresses0                                 0.4.8-2+b2                           amd64        Database API backend framework for GNUstep (library files)
ii  libaddressview0                               0.4.8-2+b2                           amd64        Address display/edit framework for GNUstep (library files)
ii  libgnustep-base-dev                           1.24.9-3.1                           amd64        GNUstep Base header files and development libraries
ii  libgnustep-base1.24                           1.24.9-3.1                           amd64        GNUstep Base library
ii  libgnustep-gui-dev                            0.25.0-4+b1                          amd64        GNUstep GUI header files and static libraries
ii  libgnustep-gui0.25                            0.25.0-4+b1                          amd64        GNUstep GUI Library
ii  libpantomime1.2                               1.2.2+dfsg1-1                        amd64        GNUstep framework for mail handling (runtime library)
ii  libpopplerkit0                                0.0.20051227svn-7.1+b9               amd64        GNUstep framework for rendering PDF content (library files)
ii  libpreferencepanes1                           1.2.0-2+b2                           amd64        GNUstep preferences library – runtime library
ii  librenaissance0                               0.9.0-4+b6                           amd64        GNUstep GUI Framework – library files
ii  librenaissance0-dev                           0.9.0-4+b6                           amd64        GNUstep GUI Framework – development files
ii  librsskit0d                                   0.4-1                                amd64        GNUstep RSS framework (runtime library)
ii  mknfonts.tool                                 0.5-11+b5                            amd64        Create nfont packages for GNUstep
ii  price.app                                     1.3.0-1                              amd64        Image filtering and manipulation using GNUstep
ii  projectcenter.app                             0.6.2-1                              amd64        IDE for GNUstep Development
ii  renaissance-doc                               0.9.0-4                              all          GNUstep GUI Framework – documentation
ii  systempreferences.app                         1.2.0-2+b2                           amd64        GNUstep preferences application
ii  terminal.app                                  0.9.8.1-1                            amd64        Terminal Emulator for GNUstep
ii  textedit.app                                  4.0+20061029-3.5+b1                  amd64        Text editor for GNUstep
ii  viewpdf.app                                   1:0.2dfsg1-5+b2                      amd64        Portable Document Format (PDF) viewer for GNUstep
ii  zipper.app                                    1.5-1+b2                             amd64        Archive manager for GNUstep

Well yes it is true Window Maker is not a spoon for every mouth, those who want to have more confortable desktop environment better look out at other options as Window Maker is Unix / Linux graphical environment that fits better hackers, computer developers and system administrators.

Anyhow if you have some old family member that has to use an old computer architecture and the person is only to use mainly just browser to check email, youtube and basic surfing then Wmaker will be a great choice as it will consume little CPU and Memory much less than the heavy and computer resources sucking GNOME and KDE.

I've historically used Wmaker also with its teminal emulator rxvt (VT102 terminal emulator for the X Windows System) which is a kinda of improved version of xterm (the default terminal program bundled with Xorg server), but for those who are already used to Gnome Terminal nice tabs perhaps that would be not the terminal of choice.

rxvt was build to match well the look and feel of AfterStep and consequently Wmaker, its scrollbar was aiming to very much resemble NeXTStep style scrollbar

windowmaker-bind-run-application-to-make-alt-f2-work-like-in-gnome

Most "custom" shortcuts are used to launch specific applications. To add your own keyboard shortcut for an application, go to the "Applications Menu Definition" panel in the Preferences app.  Select the application item in the menu for which you want to create a shortcut, then use the "capture" button to capture the keystrokes you want to assign to that item.  In the screenshot, I've assigned Mod1 + W to open Firefox.

Above  screenshot shows how to map the Run Application keyboard bind to behave like GNOME Run application ALT + F2

window-maker-run-command-like-gnome-run-screenshot-gnu-linux-unix-freebsd

Customizing background of Window Maker

Because WMaker is so simple made and targetting more of a developer audience for use it doesn't have a special graphical interaface to set a Background if you like so, but instead you need to use a wmsetbg command to do so:
 

wmsetbg -s -u filename.jpg

 

WMSetBG command stands for WindowMaker Set Background


If you're too lazy to install and start configuring wmaker, there is a Window Maker LiveCD, you can run Window Maker through LiveCD in Virtual Machine such as VirtualBox to get feeling what you're about to get if you install and start using Wmaker on your Computer.

window-maker-livecd-screenshot-synaptic+wprefs
 

Well at first with Window Maker you might feel confused and quickly irritating missing the already established way to work with your computer, but that's just for a starter sooner you will realize, that for using a limited number of applications for work wmaker, makes you much more efficient. Moreover using your computer with Wmaker can rewire your brain circuits to think a little bit different.

Once you switched to Window Maker you will likely want to have a graphical option to connect to Wireless Networks especially if you're using Wmaker on a notebook it is convenient to not always manually do scan for networks with
 

Iwlscan


commad and use wpasupplicant command to connect instead you can just install wicd and stop default Gnome Network Manager (called Network Manager), you can do so by running as root:
 

service network-manager stop
apt-get install wicd wicd-gtk
service wicd start
wicd-gtk &

 

Fixing Disappeared intel net link 5100 wifi on Toshiba Satellite L300 1YA

Friday, October 29th, 2010

I've recently had to fix a Toshiba Satellite L300 1YA notebook , running the shitty Windows Vista operating system.
For some reason suddenly the Net Link 5100 Wi-FI Network Adapter of the laptop mysteriously disappeared.
The led indicating the device is enabled was blinking the driver showed properly installed in Windows -> System and everything.
Even though that the wireless network scanning in the notebook was not working.

In networking in System there were two lines showing up with excalammation mark "!".

To fix the mess it took me 3.5 hours. I tried many things first logical thing I tried was reinstalling the driver with the latest available from Intel's website. Anyways this doesn't helped so I was about to think about other solutions.
What made thinks even worse was that the Vista installed was in Chineese!, yes you red this correctly chineese. You cannot imagine what a hell it is to deal with Windows whose language pack was Chineese …

The Vista had installed also the Chineese antivirus program Rising which also provided the system with some weird firewall and this made the dealing with the problem even more complicated.

After many tries I finally completely removed the wireless driver on the system and reinstalled it with the latest version from Intel's website.
Thanksfully after a couple of reboots and going into save mode the Intel Net Link 5100 started working again by itself?!

Well you know how things goes with Windows, you never know what will happen next.

Maybe a lot of notebooks suffer the same weird issue with Wireless Wi-Fi adapter suddenly stopping to work.

So now you know the solution, remove the driver install it again, restart and it should be working again.
Hope this quick and dirty article will save somebody an hours of time to figure it out …

How to get rid of Debian and Ubuntu GNU / Linux obsolete configuration files and system directories

Wednesday, October 19th, 2011

debian_ubuntu-linux-get-rid-of-obsolete-files
I've been using Debian GNU / Linux on my Thinkpad laptop for almost 3 years and half. Initially the Debian version which I had installed was a stable Debian Lenny. As I was mostly dissatisfied of the old versions of the programs, I migrated to testing / unstable
Testing / unstables shipped program versions were a bit better but still back in the day I wanted to get advantage of the latest program versions so for a while I switched to unstable .
Later I regretted for this bad idea, after the migration to Unstable, it was too buggy to run on a notebook one uses for everyday work.
Then to revert back to a bit stable I downgraded to testing unstable again.
When Debian launched Debian Squeeze I set in my /etc/apt/sources.list file software repositories to be the one for the stable Debian Squeeze.

As you can see, I've done quite a lot of "experiments" and "excersises". Many packages were installed, then removed, some became obsolete with time others I just temporary installed out of curiosity. Anyways as a result I ended up with many packages uninstalled / removed , which still kept some of their directory structres and configurations on the machine.

Today, I decided to check how many of these obsolete packages are still present in dpkg database and I was shocked to find out 412 debs were still in my package database! To check the number I used cmd:

root@noah:~# dpkg -l | grep -i '^rcs.*$'|wc -l

Considering the tremendous number of packs waiting to be purged, I decided to get rid of this old and already unnecessery files for the sake of clarity, besides that removing the old already uninstalled packages removes old configuration files, readmes, directories and frees some little space and therefore frees some inodes 😉

Before proceeding to remove them, I carefully reviewed and all the package names which I was about to completely purge in order to make sure there is no package with a configuration files I might need in future:

root@noah:~# dpkg -l |grep -i '^rcs.*$'
...
After reviewing all the deb packages possessing the rc – (remove candidate) flag, I used the following bash one liners to remove the obsolete deb packages:

root@noah:~# for i in $(dpkg -l |grep -i '^rcs.*$'|awk '{ print $2 }'); do echo dpkg --purge $i done...
root@noah:~# for i in $(dpkg -l |grep -i '^rcs.*$'|awk '{ print $2 }'); do dpkg --purge $i done

First line will just print out what will be purged with dpkg , so after I checked it out I used the second one to purge all the RC packs.

BSD tips

Thursday, February 7th, 2008

On one of my previous posts I give an url to a great wiki. Unfortunately I have seen I have given a wrong linkhere is the mediawiki bsdtips.utcorp.net Today I have to go to a German classes. I’m in doubt what kind of laptop to take I doubt between IBM Thinkpad and Dell. IBM’s has ati where I prefer having nvidia. On the other hand I know not all of Dell’s hardware would probably work correctly in Linux and BSD. Another problem is IBM is being selled with preinstalled XP … END—–

Mysqlreport a tiny script intended to make easy-to-read MySQL status reports

Wednesday, February 13th, 2008

mysqlreport-tiny-shell-script-to-make-easy-to-read-mysql-queries-and-usage-reports-debug-mysql-console
Check this out. Mysqlreport is a small script intended to Make easy-to-read MySQL status reports.It has also a nice manual explaining every variable it returns. Check it out here .From yesterday I feel a little sich just like I guess I’ve catched a flu. I’m still looking for a what kind of laptop to buy.
Everybody says a different thing.
A friend of mine who sells laptop says Gigabyte is a good choice, still I’m uncertain about that.I personally like Thinkpads but unfortunately thinkpads comes with OS installed on them and also I don’t like it that IBM Thinkpads (e.g. nowhere days Lenovo Thinkpads) at least the cheaper ones come with Integrated ATI video.
I’m thinking of a Dell as a possibility but still I’min doubt which one to take … For all those who doesn’t know IBM/Lenovo has three major series of Thinkpads the “r” series “t” series from Terminator :), and the “x” series. x series thinkpads are a way smaller than “r” and “t” series. As I’ve heard from friends and other sources online “t” series are rock solid and had a titanium backing. A good thing about Thinkpads to note is that the batter life of “r” and “z” series is 3.5 h 🙂 What I can afford is to spend no more than 1600 lv. (something like 1200 USD) for a laptop. The Dell models I liked were Inspiron 1520 but unfortunately they come with integrated wifi card which is dell and has no support for Linux/BSD (I need the computer to run FBSD/linux).Ofcourse I can always use NDIS and use the windows driver under linux/BSD but this is not the ideaEND—–

Text Monitoring of connection server (traffic RX / TX) business in ASCII graphs with speedometer / Easy Monitor network traffic performance

Friday, May 4th, 2012

While reading some posts online related to MS-Windows TcpViewnetwork traffic analyzing tool. I've came across very nice tool for tracking connection speed for Linux (Speedometer). If I have to compare it, speedometer is somehow similar to nethogs and iftop bandwidth network measuring utilities .

What differentiates speedometer from iftop / nethogs / iptraf is it is more suitable for visualizing a network file or data transfers.
The graphs speedometer draws are way easier to understand, than iftop graphs.

Even complete newbies can understand it with no need for extraordinary knowledge in networking. This makes Speedometer, a top tool to visually see the amount of traffic flowing through server network interface (eth0) … (eth1) etc.

What speedometer shows is similar to the Midnight Commander's (mc) file transfer status bar, except the statistics are not only for a certain file transfer but can show overall statistics over server passing network traffic amount (though according to its manual it can be used to also track individual file transfers).

The simplicity for basic use makes speedometer nice tool to track for network congestion issues on Linux. Therefore it is a  must have outfit for every server admin. Below you see a screenshot of my terminal running speedometer on a remote server.

Speedometer ascii traffic track server network business screenshot in byobu screen like virtual terminal emulator

1. Installing speedometer on Debian / Ubuntu and Debian derivatives

For Debian and Ubuntu server administrators speedometer is already packaged as a deb so its installation is as simple as:

debian:~# apt-get --yes install speedometer
....

2. Installing speedometer from source for other Linux distributions CentOS, Fedora, SuSE etc.

Speedometer is written in python programming language, so in order to install and use on other OS Linux platforms, it is necessery to have installed (preferably) an up2date python programming language interpreter (python ver. 2.6 or higher)..
Besides that it is necessary to have installed the urwid -( console user interface library for Python) available for download via excess.org/urwid/

 

Hence to install speedometer on RedHat based Linux distributions one has to follow these steps:

a) Download & Install python urwid library

[root@centos ~]# cd /usr/local/src
[root@centos src]# wget -q http://excess.org/urwid/urwid-1.0.1.tar.gz
[root@centos src]# tar -zxvvf urwid-1.0.1.tar.gz
....
[root@centos src]# cd urwid-1.0.1
[root@centos urwid-1.0.1]# python setup.py install
running install
running build
running build_py
creating build
creating build/lib.linux-i686-2.4
creating build/lib.linux-i686-2.4/urwid
copying urwid/tests.py -> build/lib.linux-i686-2.4/urwid
copying urwid/command_map.py -> build/lib.linux-i686-2.4/urwid
copying urwid/graphics.py -> build/lib.linux-i686-2.4/urwid
copying urwid/vterm_test.py -> build/lib.linux-i686-2.4/urwid
copying urwid/curses_display.py -> build/lib.linux-i686-2.4/urwid
copying urwid/display_common.py -> build/lib.linux-i686-2.4/urwid
....

b) Download and install python-setuptools

python-setuptools is one other requirement of speedometer, happily on CentOS and Fedora the rpm package is already there and installable with yum:

[root@centos ~]# yum -y install python-setuptools
....

c) Download and install Speedometer

[root@centos urwid-1.0.1]# cd /usr/local/src/
[root@centos src]# wget -q http://excess.org/speedometer/speedometer-2.8.tar.gz
[root@centos src]# tar -zxvvf speedometer-2.8.tar.gz
.....
[root@centos src]# cd speedometer-2.8
[root@centos speedometer-2.8]# python setup.py install
Traceback (most recent call last):
File "setup.py", line 26, in ?
import speedometer
File "/usr/local/src/speedometer-2.8/speedometer.py", line 112
n = n * granularity + (granularity if r else 0)
^

While running the CentOS 5.6 installation of speedometer-2.8, I hit the
"n = n * granularity + (granularity if r else 0)
error.

After consultation with some people in #python (irc.freenode.net), I've figured out this error is caused due the outdated version of python interpreter installed by default on CentOS Linux 5.6. On CentOS 5.6 the python version is:

[root@centos ~]# python -V
Python 2.4.3

As I priorly said speedometer 2.8's minimum requirement for a python to be at v. 2.6. Happily there is quick way to update python 2.4 to python 2.6 on CentOS 5.6, as there is an RPM repository maintained by Chris Lea which contains RPM binary of python 2.6.

To update python 2.4 to python 2.6:

[root@centos speedometer-2.8]# rpm -Uvh http://yum.chrislea.com/centos/5/i386/chl-release-5-3.noarch.rpm[root@centos speedometer-2.8]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CHL[root@centos speedometer-2.8]# yum install python26

Now the newly installed python 2.6 is executable under the binary name python26, hence to install speedometer:

[root@centos speedometer-2.8]# python26 setup.py install
[root@centos speedometer-2.8]# chown root:root /usr/local/bin/speedometer
[root@centos speedometer-2.8]# chmod +x /usr/local/bin/speedometer

[root@centos speedometer-2.8]# python26 speedometer -i 1 -tx eth0

The -i will instruct speedometer to refresh the screen graphs once a second.

3. Using speedometer to keep an eye on send / received traffic network congestion

To observe, the amount of only sent traffic via a network interface eth0 with speedometer use:

debian:~# speedometer -tx eth0

To only keep an eye on received traffic through eth0 use:

debian:~# speedometer -rx eth0

To watch over both TX and RX (Transmitted and Received) network traffic:

debian:~# speedometer -tx eth0 -rx eth0

If you want to watch in separate windows TX and RX traffic while  running speedometer you can run in separate xterm windows speedometer -tx eth0 and speedometer -rx eth0, like in below screenshot:

Monitor Received and Transmitted server Network traffic in two separate xterm windows with speedometer ascii graphs

4. Using speedometer to test network maximum possible transfer speed between server (host A) and server (host B)

The speedometer manual suggests few examples one of which is:

How fast is this LAN?

host-a$ cat /dev/zero | nc -l -p 12345
host-b$ nc host-a 12345 > /dev/null
host-b$ speedometer -rx eth0

When I red this example in speedometer's manual, it wasn't completely clear to me what the author really meant, but a bit after when I thought over the example I got his point.

The idea behind this example is that a constant stream of zeros taken from /dev/zero will be streamed over via a pipe (|) to nc which will bind a port number 12345, anyone connecting from another host machine, lets say a server with host host-b to port 12345 on machine host-a will start receiving the /dev/zero streamed content.

Then to finally measure the streamed traffic between host-a and host-b machines a speedometer is started to visualize the received traffic on network interface eth0, thus measuring the amount of traffic flowing from host-a to host-b

I give a try to the exmpls, using for 2 test nodes my home Desktop PC, Linux running  arcane version of Ubuntu and my Debian Linux notebook.

First on the Ubuntu PC I issued
 

hipo@hip0-desktop:~$ cat /dev/zero | nc -l -p 12345
 

Note that I have previously had installed the netcat, as nc is not installed by default on Ubuntu and Debian. If you, don't have nc installed yet, install it with:

apt-get –yes install netcat

"cat /dev/zero | nc -l -p 12345" will not produce any output, but will display just a blank line.

Then on my notebook I ran the second command example, given in the speedometer manual:
 

hipo@noah:~$ nc 192.168.0.2 12345 > /dev/null

Here the 192.168.0.2 is actually the local network IP address of my Desktop PC. My Desktop PC is connected via a normal 100Mbit switch to my routing machine and receives its internet via  NAT. The second test machine (my laptop), gets its internet through a WI-FI connection received by a Wireless Router connected via a UTP cable to the same switch to which my Desktop PC is connected.

Finally to test / get my network maximum thoroughput I had to use:

hipo@noah:~$ speedometer -rx wlan0

Here, I  monitor my wlan0 interface, as this is my (laptop) wireless card interface over which I have connectivity to my local network and via which through the the WI-FI router I get connected to the internet.

Below is a snapshot captured showing approximately what is the max network thoroughput from:

Desktop PC -> to my Thinkpad R61 laptop

Using Speedometer to test network thorougput between two network server hosts screenshot Debian Squeeze Linux

As you can see in the shot approximately the maximum network thoroughput is in between:
2.55MB/s min and 2.59MB/S max, the speed is quite low for a 100 MBit local network, but this is normal as most laptop wireless adapters hardly transfer traffic in more than 10 to 20 MBits per sec.

If the same nework thoroughput test is conducted between two machines both connected to a same 100 M/bit switch, the traffic should be at least a 8 MB/sec.

There is something, else to take in consideration that probably makes the provided example network thoroughput measuring a bit inaccurate. The fact that the /dev/zero content is stremed over is slowing down the zeroes sent over network because of the  pipe ( | ) use slows down the stream.

5. Using speedometer to visualize maximum writting speed to a local hard drive on Linux

In the speedometer manual, I've noticed another interesting application of this nifty tool.

speedometer can be used to track and visualize the maximum writing speed a hard disk drive or hard drive partition can support on Linux OS:

A copy paster from the manual text is as follows:

How fast can I write data to my filesystem? (with at least 1GB free)
dd bs=1000000 count=1000 if=/dev/zero of=bigfile &
speedometer bigfile

However, when I tried copy/pasting the example in terminal, to test the maximum writing speed to an external USB hard drive, only dd command was started and speedometer failed to initialize and display graphs of the file creation speed.

I've found a little "hack" that makes the man example work by adding a 3 secs sleep like so:

debian:/media/Expansion Drive# dd bs=1000000 count=1000 if=/dev/zero of=bigfile & sleep 3; speedometer bigfile

Here is a screenshot of the bigfile created by dd and tracked "in real time" by speedometer:

How fast is writting data to local USB expandable hard disk Debian Linux speedometer screenshot

Actually the returned results from this external USB drive are, quite high, the possible reason for that is it is connected to my laptop over an USB protocol verion 3.

6. Using Speedometer to keep an eye on file download in progress

This application of speedometer is mostly useless especially on Linux where it is used as a Desktop.

However in some occasions if files are transferred over ssh or in non interactive FTP / Samba file transfers between Linux servers it can come handy.

To visualize the download and writing speed of lets say FTP transferred .AVI movie (during the actual file transfer) on the download host issue:

# speedometer Download-Folder/What-goes-around-comes-around.avi

7. Estimating approximate time for file transfer

There is another section in the speedometer manual pointing of the program use to calculate the time remaining for a file transfer.

The (man speedometer) provided example text is:

How long it will take for my 38MB transfer to finish?
speedometer favorite_episode.rm $((38*1024*1024))

At first glimpse it hard to understand (like the other manual example). A bit of reasoning and I comprehend what the man author meant by the obscure calculation:

$((38*1024*1024))

This is a formula used in which 38 has to be substituted with the exact file size amount of the transferred file. The author manual used a 38MB file so this is why he put $((38* … in the formula.

I give it a try – (just for the sake to see how it works) with a file with a size of 2500MB, in below two screenshot pictures I show my preparation to copy the file and the actual copying / "real time" transfer tracking with speedometer's status percentage completion bar.

xterm terminal copy file and estimate file copying operation speed on linux with speedometer preparation

Two xterm terminals one is copying a file the other one uses speedometer to estimate the time remaining to complete the file transfer from expansion USB hard drive to my laptop harddrive

 

Improve your night sleep when using PC with Windows XP late at night with F.lux

Tuesday, February 26th, 2013

f.lux auto detect timezone geographic location after install screenshot microsoft windows XP

After testing F.lux on Mac OS X, I decided to install it and test it on a friend's Windows XP OS. Up is a screenshot from the program right after installed.

Just like on MAC OS X F.lux auto set the Geographic Location and started changing the Gamma of the screen to reddish at night. As you can see the change of Screen Color gamma can be set in various intervals with default of auto changing monitor backlid gamma every 20 secs.

On early day, when usually outside you see the day light because Sun Light shines on our planet, the color gamma is auto-configured to the normal light one.
I think in short future all computer vendors should think of embedding F.lux or some similar application to every Desktop PC, laptop, Phone and Tablet.

 

f.lux settings improve night sleep auto set monitor gamma ms windows xp

When F.lux is active a tiny icon with the F.Lux logo is visible on Taskbar like in below screenshot. From there you can view f.lux settings, see in what Color gamma mode the program works at present or to manually set custom color gamma. Enjoy

Fixing Compaq Presario CQ71-330ED can’t connect to wireless on 64-bit Windows 7

Thursday, January 10th, 2013

Fixing Windows 7 Wireless Compaq Presario CQ71 330ED notebook / What makes it not to connect to wi-fi

I had to fix one Notebook Compaq CQ71-330ED which was failing connecting to a home Wireless Router. The notebook was running 64 Bit Windows 7 installed from scratch just few weeks ago. The PC could connect normally via a LAN cable to the Internet, but can't connect to the Wireless Router. I thought the issue might be due to the Wireless Router, thus checked with my laptop if I can connect to the WPA2 network with the pass key. Being able to connect from my own PC make it clear the problem is somewhere in Windows 7 (most likely the drivers). I checked in

Control Panel -> Device Manager

 

to make sure the Wireless drivers were appearing as properly installed, there all seemed fine, Wireless was detected as:

Intel (R) Centrino Wireless-N 1000

I tried playing with Wireless settings from
 

Control Panel -> Network and Internet

stopped Wireless Power Saving, as I know with some wireless devices it creates problems. Also tried settings the default wireless network support from A B G N to A B G. I tried playing with changing the Workgroup name to WORKGROUP., Disabling / Enabling the Wireless Network, checking if settings for IP obtain for IPv4 are not messed up etc., but all seemed okay and still the PC weirdly was unable to connect to Wi-fi network.

I suspected, the drivers though reporting as properly installed and working with the Wi-Fi card are the point of failure. So removed driver for Wireless card and tried re-installing.

As the model of laptop was COMPAQ Presario CQ71-330ED, I looked for this model driver, but again strangely CQ71-330ED was not among the Presario models on www.hp.com drivers section.

I improvised and dfecided to download 64 bit Wi-Fi drivers for the model which seemed to be closest to CQ71-330ED – Compaq Presario CQ71-120ED.

Install the Intel 64-bit Wireless Driver for notebook CQ71-120ED solved the Wi-Fi Router connection issues. Re-connecting once again to the WPA network just worked 🙂

A mirror of Wireless driver that worked for me . After installing the driver the Wireless was detected as:
 

Intel (R) Wifi Link BGN