Over time, memory can become more and more fragmented on a system, making it difficult to find contiguous blocks of RAM to satisfy ongoing allocation requests. more>>
The first time I heard about hash tables was after taking a compilers course during my BSc. The truth is, I was not able to understand and appreciate their usefulness fully back then. Now that I know more about hash tables, I decided to write about them so others will see their importance as well. more>>
I have covered a lot of different scientific packages that are available under Linux in this space, but the focus has been on Linux running on desktop machines. This has been rather short-sighted, however, as lots of other platforms have Linux available and shouldn't be neglected. So in this article, I start looking at the type of science you can do on the Android platform. more>>
For example, I just thought I could use it to figure out which Debian release I originally installed on this machine, and when I did the upgrades. Turns out it's amazingly easy:cd /etc sudo git log --oneline -p --no-prefix /etc/issue
Here is the result here:root@marcos:/etc# git log --oneline -p --no-prefix --pretty=format:'%s (%ai)' /etc/issue | cat Initial commit (2011-02-23 00:14:08 -0500) diff --git issue issue new file mode 100644 index 0000000..9d52ed2 --- /dev/null +++ issue @@ -0,0 +1,2 @@ +Debian GNU/Linux 6.0 \n \l + saving uncommitted changes in /etc prior to apt run (2011-05-22 19:08:20 -0400) diff --git issue issue index 9d52ed2..647d490 100644 --- issue +++ issue @@ -1,2 +1,2 @@ -Debian GNU/Linux 6.0 \n \l +Debian GNU/Linux wheezy/sid \n \l committing changes in /etc after apt run (2013-01-23 09:40:27 -0500) diff --git issue issue index 647d490..d363ace 100644 --- issue +++ issue @@ -1,2 +1,2 @@ -Debian GNU/Linux wheezy/sid \n \l +Debian GNU/Linux 7.0 \n \l committing changes in /etc after apt run (2013-06-15 13:02:04 -0400) diff --git issue issue index d363ace..efc8255 100644 --- issue +++ issue @@ -1,2 +1,2 @@ -Debian GNU/Linux 7.0 \n \l +Debian GNU/Linux 7 \n \l committing changes in /etc after apt run (2014-02-02 23:28:12 -0500) diff --git issue issue index efc8255..e65d112 100644 --- issue +++ issue @@ -1,2 +1,2 @@ -Debian GNU/Linux 7 \n \l +Debian GNU/Linux jessie/sid \n \l committing changes in /etc after apt run (2014-12-18 11:32:43 -0500) diff --git issue issue index e65d112..6478eed 100644 --- issue +++ issue @@ -1,2 +1,2 @@ -Debian GNU/Linux jessie/sid \n \l +Debian GNU/Linux 8 \n \l
In other words:
- 2011-02-23: installed etckeeper, running Debian 6.0 ("squeeze", fresh from the stable release from 2011-02-06)
- 2011-05-22: upgraded to wheezy/sid ("testing", at that point)
- 2013-01-23: some upgrade to testing, unclear (although wheezy is in freeze since 2012-06-30 at that point, it seems the version string changed then in base-files 7)
- 2013-06-15: wheezy 7.1 point release drops the digit
- 2014-02-02: switch to jessie/sid (back to "testing", a few months after the freeze is announced)
- 2014-12-18: upgrade to Debian 8 (one month after the freeze, still not released)
Unfortunately, there isn't much more details about the exact upgrade points, especially since /etc/os-release is a symlink starting with Jessie. Besides things are much more in flux than we would like to believe, especially when you run a rolling distribution like "testing", but it still gives a good idea of my upgrade history:
- i ran 3 different major releases of Debian on this machine, always upgrading from the previous one without reinstalling
- i probably installed etckeeper from the start, as configuration mentions the machine was online on 2011-03-08
- i generally run stable until i get tired and upgrade to testing, generally at some point close to the freeze time
There is of course more information available directly in git log, namely the exact package version changes. With some more commandline filtering, we can see exactly when each upgrade was done, including minor releases:# git log --date iso --grep base-files --reverse | egrep "^commit|^Date|base-files" commit 34ad962ff10c6e4e201378698e0fe0d4b03c8c39 Date: 2011-04-02 22:21:11 -0400 -base-files 6.0 +base-files 6.0squeeze1 commit 1cba7d2e097091e86eba1a2d8e4f5a9771e746a1 Date: 2011-07-09 19:40:05 -0400 -base-files 6.3 +base-files 6.4 commit cb409a0fbe2f95c3cd6a7c1ff0af263b55c7d597 Date: 2011-09-28 17:54:57 -0400 -base-files 6.4 +base-files 6.5 commit cf6d9dab6f79f4b50e5bd80dcba1769b0aa6c84b Date: 2012-03-25 19:18:44 -0400 -base-files 6.5 +base-files 6.7 commit bb1b6aab4406276388542cefd7b4eff92d960533 Date: 2012-06-29 00:42:32 -0400 -base-files 6.7 +base-files 6.9 commit c6d9218ba75b3276ea44d949ef3410c35713d487 Date: 2012-09-29 14:25:01 -0400 -base-files 6.9 +base-files 6.11 commit bd730398e572c8403b2b9c0421df64a407669877 Date: 2013-01-23 09:40:27 -0500 -base-files 6.11 +base-files 7.1 commit af42616d72c4fe5c4a0e43ee8948031732735ec5 Date: 2013-06-15 13:02:04 -0400 -base-files 7.1 +base-files 7.1wheezy1 commit d2ef5df9c689073b62b4898a12e42bb8488c8cdc Date: 2013-10-14 18:15:11 -0400 -base-files 7.1wheezy1 +base-files 7.1wheezy2 commit 104ea49559eb2b6b2aff21817b3980b274882a28 Date: 2013-12-14 11:07:09 -0500 -base-files 7.1wheezy2 +base-files 7.1wheezy3 commit bfa19b7ad737cb22c495af9429e922e6ec46202d Date: 2014-02-02 23:28:12 -0500 -base-files 7.1wheezy3 +base-files 7.2 commit 830570ca4083af0c4b87c6c7c746c9513e260cf7 Date: 2014-05-15 11:20:13 -0400 -base-files 7.2 +base-files 7.3 commit 4c9e6ca21bb8189810199e6d518250432a62391d Date: 2014-07-27 19:50:14 -0400 -base-files 7.3 +base-files 7.5 commit 4bc6abe2ba193cb6fac4eae00fa855eb32b86400 Date: 2014-10-20 16:14:09 -0400 -base-files 7.5 +base-files 7.6 commit a5e2ce476982201338220a314b1f9ccb03c99517 Date: 2014-11-28 19:45:56 -0500 -base-files 7.6 +base-files 7.10 commit eaa69b112fee60ef71938d9a725c07f9f29b2011 Date: 2014-12-18 11:32:43 -0500 -base-files 7.10 +base-files 8 commit f95a199df77030dc9ee6ab55bf4fa246fa88c959 Date: 2015-07-24 12:34:04 -0400 -base-files 8 +base-files 8+deb8u1 commit db4ab55b7327cecea54c5fe6a65560ba0e385978 Date: 2015-09-07 19:09:47 -0400 -base-files 8+deb8u1 +base-files 8+deb8u2
Today, IBM announces the latest of its Power Systems line of high-end servers. These are the Power Systems S812LC, the Power Systems S822LC (for commercial computing) and the high-performance Power Systems S822LC. All of them are custom-built for Linux. more>>
A recent rumor has sparked waves of fear and outrage throughout the Linux community. The word is that Microsoft is in secret negotiations to purchase Canonical, the Ubuntu company. more>>
Vigilante. The word itself conjures up images of a man in a mask, leaping across rooftops as he chases wrongdoers, dancing with the devil in the pale moonlight. In films and on TV, the vigilante is usually the character we support. But would you welcome a vigilante into your home in real life? more>>
One of my favorite things about grade school was when the teacher would review for a test by playing Jeopardy. I'm pretty old, so my version of classroom Jeopardy was done on a chalkboard with the teacher reading answers from index cards, but the new computer-based versions I see in schools are at least as cool. more>>
The other evening a bunch of us were sitting in a friend's living room while a series of photos scrolled across her TV. The photos were a screen saver served up by her new Apple TV box. Some of the pictures were of people, birds, flowers, cats and other typical stuff. more>>
I love the flavor of raspberries, but quite honestly, the seeds gross me out. more>>
Fall is beginning and Montréal-Python is inviting the Python community to its 11th "Project Night" event in the hearth of the Plateau Mont-Royal at the office of ours friends of Outbox (http://www.outboxtechnology.com/).
For the newcomer, the Project Nights of Montréal-Python are evening of work and of exchange around real world projects and things you want to share. The idea is to come to work on your own project or to join another team working on something you would learn or could help on.
We already have a couple of projects for you:
Work on Montreal-Python Website Upgrade to latest django and migration to Heroku https://github.com/mtlpy/mtlpyweb
Introduction and learning of Python
If you have any project idea, send us an email at firstname.lastname@example.org or just tell us during the project night.When
Thursday, October 8th at 6 PM
Warning, please make sure to arrive before 7PM cause the door will be locked afterWhere
At the office of our friends of Outbox (http://www.outboxtechnology.com/)
3575 Saint-Laurent Boulevard, suite 800, Montreal
Please grab a free ticket on our Eventbrite page at: http://python-project-night-11.eventbrite.ca
If you're paying really close attention, you'll remember that in my last article, I was exploring the rudiments of a script that would accept a list of words as input and create a word search grid, suitable for printing. more>>
Recently I wrote a review for the Linux Journal Web site on the Purism Librem 15 laptop. The goal of this laptop is to provide a piece of modern hardware that can run 100% free software not just for the OS, but also all device drivers and firmware up to and including the BIOS. more>>
After reading up on a eye-opening blog from Petter Reinholdtsen about laptop batteries, or more specifically Lithium-Ion laptop batteries, I figured I needed to try out the "TLP Linux Advanced Power Management" that I had been keeping an eye on for a while. tlp is yet another tool to control power usage on laptops (mostly Thinkpad, mine is a X120e). The novelty of tlp is the "hands off" approach: everything should be automatically configured for you...
Obviously, that means I then went on working for a few hours on breaking and fixing my laptop in random operations. I opened a bunch of pull requests on the interesting battery status package that Petter produced to make it work with my setup and make it display graphs directly (instead of into a file). I also rewrote the graphing tool in Python with SciPy in order to have cleaner labels and be able to deduce the date at which a battery would be completely unusuable because it can't recharge high enough. (At the time of writing, the battery estimated death time is december 7th, but that data is skewed because of a quick change in the battery charge after the BIOS upgrade, below.)
I then went on to try to limit my laptop charging to 80%, since this seems to make the battery last longer (sources from Petter: 1, 2, 3). Unfortunately, even after building a local (and trivial) backport of the tlp package to Debian stable (8.2/Jessie), I still couldn't access those controls, as TLP is really just a set of shell scripts that glue a bunch of stuff together.
The backport was simply:apt-get source tlp cd tlp*/ debuild sudo dpkg -i ../tlp*.deb
I read here and there (and in Petter's post) that I needed the tp-smapi-dkms package, so I went ahead an installed it:sudo apt install tp-smapi-dkms
(Yes, Jessie has a neat apt command now, it's great, upgrade now.)
Unfortunately, this still didn't work. I think the error back then was something like:thinkpad_ec: thinkpad_ec_request_row: arg0 rejected: (0x01:0x00)->0x00 thinkpad_ec: thinkpad_ec_read_row: failed requesting row: (0x01:0x00)->0xfffffffb thinkpad_ec: initial ec test failed
I have seen suggestions here and there to try the acpi-call-dkms package, but that was useless as it doesn't support my model (but may work with others!). The error there was:acpi_call: Cannot get handle: Error: AE_NOT_FOUND
Note: I still have it installed - it's unclear what impact it has, and I do not want to break my current setup.
So I then started to look at upgrading my BIOS, for some reason. I was running version 1.13 (8FET29WW) from 05/06/2011. I was able to update to 1.17 (8FET33WW) from 11/07/2012, using the memdisk binary from the syslinux-common package, with some help from the quite useful grub-imageboot package:sudo apt install syslinux-common grub-imageboot wget https://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles/8fuj10uc.iso sudo mkdir /boot/images sudo mv 8fuj10uc.iso /boot/images sudo reboot
I found the image on the Thinkpad x120e support page from Lenovo (which happily bounces around, so don't rely on the above URLs too much). When I rebooted, I was offered to boot from the image by grub, which went on fine, considering it was running some version of DOS, which is always a bit scary considering it is software that is somewhat almost as old as me.
I wish I could have installed some free software in the BIOS instead of the outdated crap that Lenovo provides, but unfortunately, it seems this will never be possible with Libreboot or Coreboot, mostly because Intel is evil and installs backdoors in all their computers. Fun times.
Fortunately and surprisingly, the update worked and went on pretty smoothly. After that, I was able to set the charge limit with:echo 80 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh
Amazing! I had almost forgotten why I almost bricked my system on a thursday, good thing that worked! Now the fun part was that, after some reboots or something I did, I am not sure what, the above stopped working: I couldn't load the drivers at all anymore, dmesg treating me with a nasty:thinkpad_ec: thinkpad_ec_read_row: failed requesting row: (0x01:0x00)->0xfffffff0 thinkpad_ec: initial ec test failed
Now that is some obscure error message material! Fun stuff. I tried uninstalling tlp, the smapi modules, the acpi-call modules, rebooting, turning the machine off, removing the battery, nothing worked. Even more hilarious, the charge controler was now stuck at 80%: I had artificially destroyed 20% of the battery capacity in software. Ouch.
I think this may have been related to uninstalling the tp-smapi-dkms package without unloading it at first. I found some weird entries in my kern.log like this:tp_smapi unloaded. thinkpad_ec: thinkpad_ec_read_row: failed requesting row: (0x14:0x00)->0xfffffff0 hdaps: cannot power off hdaps: driver unloaded. thinkpad_ec: unloaded.
I think that after that point, I couldn't load either module, not even thinkpad_ec...
After tearing out a few more hairs and hammering my head on the keyboard randomly, I thought I could just try another BIOS upgrade, just for the fun of it. Turns out you actually can't rerun the upgrade, but you can change the model number through the same software, and this seems to reset some stuff. So I went back in the ISO image I had loaded earlier, and went on to change the model number (actually setting it to the same value, but whatever, it still ran the update). It turns out this seems to have reset a bunch of stuff and now everything works. I can use tlp setcharge and all the neat tools go well.
The two key commands are:# limit charging to 80% of the battery, but not lower than 40% sudo tlp setcharge 40 80 # clear the above setting and just charge the battery to 100% sudo tlp fullcharge
It seems that the 40% bit isn't supported by my laptop, but whatever: the battery stays charged when on AC power anyways, so I don't really understand what the setting is for in the first place. The error there is:smapi smapi: smapi_request: SMAPI error: Function is not supported by SMAPI BIOS (func=2116) smapi smapi: __get_real_thresh: cannot get start_thresh of bat=0: Function is not supported by SMAPI BIOS
The second command is what I will need to remember to run before I unplug the laptop for a trip. I suspect this will be really annoying and I may end up disabling all this stuff and just yank the power cable out when the battery reaches 80%, by hand, when I need to.
But it was a fun geeking out, and hopefully this will be useful for others. And of course, the graphs from Petter will be interesting in a few months... Before the BIOS upgrade, the battery capacity was reported as 100% (actually, at 100.03%, which was strange). Now, the capacity is at 98.09%, which is probably just a more accurate reading that was fixed in the BIOS upgrade.
Finally, also see the useful thinkwiki troubleshooting page and especially their interesting BIOS upgrade documentation which inspired me to write my own version. I would have gladly contributed to theirs, but I seem to have lost my password on this site, with no recovery possible... The arch linux wiki has obviously excellent documentation as well, as usual.
I admit it, some tools confuse me. I know they must be amazing, because programs don't get popular by being dumb (well, reality TV, but that's another story). I have the same sort of confusion with Vagrant that I have with Wine, Docker, Chef and countless other amazing tools people constantly rave about. So in this article, I'm going to break down Vagrant into its simplest form. more>>
Connect to the Internet, work with your files, lock your workspace, listen to music and do so much more with the help of Bluetooth technology. more>>
I wake up in the middle of the night, mouth parched and vision blurry, and fumble around to find my iPhone. I press my thumb to the fingerprint scanner, and in the dim blue light, just out of instinct, I squint at the screen, find the right app, open it, and check the ambient temperature and air quality indoors. more>>