The noisebleed blog has moved to noiselabs.org.
All posts were transferred to the new location and new ones will only appear there.
Check them out at… http://blog.noiselabs.org
See you there!
The noisebleed blog has moved to noiselabs.org.
All posts were transferred to the new location and new ones will only appear there.
Check them out at… http://blog.noiselabs.org
See you there!
May 1
Posted by noisebleed in Gentoo Linux, Linux | 4 Comments
Everyday morning was the same: updatedb came and took my Gentoo away. The symptoms were clear, X/KDE applications starting to become slow and unresponsive, and then the two inevitable choices: go for a coffee and wait or pkill the bastard.
To fix this came to my mind the nice command. This is well known to Gentoo users because of the PORTAGE_NICENESS feature include in make.conf. Nice is a program that adjusts the process scheduling (aka niceness) of the desired programs so setting a value of 19 (the maximum) would make updatedb to be “nicer” to other applications and therefore being less bossy. So I’ve edited /etc/cron.daily/slocate, placed “nice -n 19″ before the updatedb command and waited. But, once again, updatedb came and owned my computer.
So. what’s wrong here? Updatedb is not a CPU-intensive application so nice won’t change a thing. The bottleneck is disk access so what we need here is a nice for I/O. The solution? Ionice.
Ionice is able to set the I/O scheduling class and priority for a given program. To give updatedb a low priority we pick the class 3, the idle one.
Again, let’s go to crontab and edit the slocate entry.
# vim /etc/cron.daily/slocate
Put ionice -c 3 before the updatedb command.
#! /bin/sh
if [ -x /usr/bin/updatedb ]
then
if [ -f /etc/updatedb.conf ]
then
ionice -c 3 /usr/bin/updatedb
else
ionice -c 3 /usr/bin/updatedb -f proc
fi
fi
And if you’re asking where (in Gentoo) is this ionice program, the solution is sys-apps/util-linux, which I’m pretty sure is already installed. If not: emerge -a sys-apps/util-linux.
Updatedb is a tool ran daily by cron to update the slocate database. And Slocate (Secure Locate) is a security enhanced version of the GNU Locate, which is used to index all the files of your system allowing a (very) quick search of them. In Gentoo Linux the slocate is available in Portage through sys-apps/slocate.
Mar 14
Posted by noisebleed in Web | 1 Comment
For some time I’ve been using Wikipedia to translate expressions that a normal translator couldn’t give exact results, because they use literal translations. Now there is a faster way.
MemeMiner, brought to us by Fred Rocha, is a Web tool that does this work and gives us a easy and fast way to get this translations.
From the author own words:
For most of it’s articles, Wikipedia provides the equivalent expression of that concept in other languages.
With MemeMiner you can effortlessly find out how a certain idea is expressed across the language spectrum.
Now go ahead and try this tool at http://fredrocha.net/MemeMiner/
Thanks Fred!
Recently I decided to visit CoovaChilli website and check the latest version of the software. CoovaChilli is now at version 1.2.2. I’ve decided to dedicate some time to make this version available in Gentoo and started working on it. It’s also my intention to shorten the gap between new releases of CoovaChilli and their availability in the Overlay
Here goes a description taken from the website:
CoovaChilli is an open-source software access controller, based on the popular (but now defunct) ChilliSpot project, and is actively maintained by an original ChilliSpot contributor. CoovaChilli is released under the GNU General Public License (GPL). CoovaChilli is a feature rich software access controller that provides a captive portal / walled-garden environment and uses RADIUS or a HTTP protocol for access provisioning and accounting. CoovaChilli is an integral part of the CoovaAP OpenWRT-based firmware which is specialized for hotspots.
So CoovaChilli is a Wireless LAN Access Point Controller. For those who used Chillispot this is the natural successor.
I’m storing the Ebuild on my GitHub account so for those wishing to check out the evolution of the Ebuild (not sure why would someone want to do this but
…) just open this link.
Of course is always possible to checkout the git repo and retrieve my personal Gentoo overlay which includes the CoovaChilli ebuilds. To do this just execute:
$ git clone git://github.com/noisebleed/noisebleed-overlay.git
Make sure to keep the repo updated:
$ git pull remote origin
The Sunrise overlay is the place I choose to provide the CoovaChilli ebuilds. To use the ebuild (coova-chilli-1.0.11) first bring the overlay into your system through Layman:
(Install layman) # USE="subversion" emerge -va app-portage/layman # layman -f -a sunrise (since layman 1.2.3 use "/var/lib/" instead of "/usr/local/portage/") # echo "source /var/lib/layman/make.conf" >> /etc/make.conf (Update the overlay) # layman -s sunrise
Then just emerge the normal way:
# emerge -av net-wireless/coova-chilli
More information about using overlays can be found on the Gentoo documentation. Specific Sunrise instructions are available on Sunrise’s wiki.
Tags: chillispot, coova-chilli, gentoo, github, layman, openwrt, overlay, radius, sunrise
tar: file name is too long (max 99); not dumped tar: Error exit delayed from previous errors
If you happen to see the same error message it is quite likely that you (and by you I mean Automake)Â are using the old V7 tar format.
Just want the solution? It’s here
By default Automake is pulling the historical V7 format to generate the tarball with make dist. This tar format supports file names only up to 99 characters and that’s why tar is refusing to build the tarball.
Since automake 1.9, th tar format can be chosen with the options tar-v7, tar-ustar, and tar-pax.
This is what the Automake manual says about each option:
This is the historical default. This antiquated format is understood by all tar implementations and supports file names with up to 99 characters. When given longer file names some tar implementations will diagnose the problem while other will generate broken tarballs or use non-portable extensions. Furthermore, the V7 format cannot store empty directories.
(…) format defined by POSIX 1003.1-1988. This format is believed to be old enough to be portable. It fully supports empty directories. It can store file names with up to 256 characters, provided that the file name can be split at directory separator in two parts, first of them being at most 155 bytes long. So, in most cases the maximum file name length will be shorter than 256 characters. However you may run against broken tar implementations that incorrectly handle file names longer than 99 characters.
(…) the new pax interchange format defined by POSIX 1003.1-2001. It does not limit the length of file names. However, this format is very young and should probably be restricted to packages that target only very modern platforms. There are moves to change the pax format in an upward-compatible way, so this option may refer to a more recent version in the future.
The solution is to pick a newer and better tar implementation like tar-pax. Go to configure.ac or configure.in and change the AM_INIT_AUTOMAKE macro so it specifies the tar format and requires automake version to be 1.9 or better as tar-pax is only supported since 1.9.
configure.ac/configure.in:
AM_INIT_AUTOMAKE([1.9 tar-pax])
Now run `make dist` again and tar won’t bother you anymore (at least with this error
).
Feb 22
Posted by noisebleed in Gentoo Linux | No Comments
As of February 5, Google developer Ryan Cairns has made this statement on the Chromium OS dev mailing list:
As we’ve been growing and working with more partners, the need to support board specific builds and improve our tools has become more urgent. In order to get there more quickly we’ve been investigating several different build tools. We found that the Portage build tools suit our needs well and we will be transitioning 100% within the next week.
As a Gentoo user and supporter I’m happy to see Portage being picked by major projects like the Chromium OS. Hopefully it will bring more (positive) attention to Gentoo and maybe we will see the Google folks contributing with improvements and bug fixes back to Portage.
For those interested in checking out the Portage-based build environment and build a bootable Chromium OS image take a look at this Chromium OS documentation page.
If you are interested in Portage features and usage check the Gentoo Handbook page about Portage. And if you got curious about Portage history I recommend the this article by Daniel Robbins, the founder of Gentoo.
To know more about the Chromium OS project and Google Chrome OS check this.
Tags: chromium os, gentoo, google, portage
Feb 21
Posted by noisebleed in Web | No Comments

Type "is:unread" in the search bar and then select "Unread" from the selection bar

In the "More actions" dropdown select "Mark as read"
And that’s it. Your inbox shouldn’t be reporting any unread messages by now.
The function to accomplish this could look like this:
function checkUTF8Input($input)
{
$pattern = '/^[\p{L} ]+$/u';
preg_match($pattern, $string, $matches);
if (count($matches) > 0)
return true; // String is OK (only letters)
else
return false; // String has non-utf8 letters
}
Take a look at preg_match to know more about this function used for regex operations.
Feb 12
Posted by noisebleed in Web Development | 5 Comments
You can play with some header commands and build a function like this…
function cacheKiller()
{
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT\n");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
}
…but this will work for the whole page and not only for images.
So, to make sure the images shown are always up-to-date the simple way is to add a query section with a random number to the image URL in order to make the browser think that this is a different image, while keeping the same name.
In PHP it works like this:
// Generate a number that will never be repeated using the time function
// that "returns the current time measured in the number of seconds since
// the Unix Epoch (January 1 1970 00:00:00 GMT)"
$cachekiller = time();
// Include the generated number in the image URL

If the image URL is built using JavaScript/jQuery the Math function is good choice to generate a random number.
// Generate random number between 1 and 1000.
var cachekiller = Math.floor(Math.random()*1001);
$("#thumbnail").attr("src", "path/to/image.png?"+cachekiller);
Tags: javascript, jquery, php
Oct 16
Posted by noisebleed in Gentoo Linux | 2 Comments
The Pentium II belongs to Intel’s sixth-generation micro-architecture (“Intel P6″) and x86-compatible microprocessors and was launched on May 7, 1997. So what we got here is a 12 years old machine!
Here are the specs of my machine:
[TODO]
As you may imagine compiling on this box is a very tedious task. Fortunately there are alternatives
I’ll be showing these alternatives on the second part of this post…
Tags: binhost, gentoo, pentium ii
Arclite theme by digitalnature |