write(msg)

write(msg)

A Linux blog to share any hints, tips, ebuilds, and insight I have picked up along the way. My interests mainly lie in security, photography, the web, and multimedia.

Monday, August 25, 2008

Updated sK1 gnome patch

It seems that the latest revision of sK1 has a new configurator.py that breaks my old gnome patch. I've updated the patch to work with the latest revision. Hopefully this won't end up being an arms race type of affair where configurator.py is constantly changing. Just rename to gnome-sK1.patch and copy in place of the old patch and remember to edit the fonts and font sizes in the patch if you want to match your gnome theme better.

Labels: , , , ,

Updated Midori ebuild

Midori is now using a new build system so if you attempt to emerge it like before it will not work. There is an updated ebuild available on bugzilla. Unfortunately I have yet to get it to work. It builds fine with the new ebuild but the program will not start. I am using it in conjunction with my webkit-gtk svn ebuild. If I find the solution to the problem I will post an update.

UPDATE: It's working now. I built it with a vanilla compiler instead of my default hardened compiler and it is running now. I test Acid3 on Midori everytime I rebuild it. It gets to 77 before it crashes. This is better than the 69 I was getting before. At one time I was able to acheive 100 percent compliance but that hasn't happened in months. My biggest gripe/bug continues to be the font settings. It seems that Midori will not respect my font settings until I adjust them. I have to change the font size and then change it back again every time I start Midori.

Labels: , , , , ,

Thursday, August 21, 2008

Flash 10 update

Four days ago I installed Flash 10 on my laptop. I was hoping it would solve some of the issues I was having with Flash. Unfortunately I haven't seen many differences at all. I'm not sure if my problems are related to Flash itself or nspluginwrapper but Flash still crashes or hangs my browser occasionally and some Flash videos still don't work, they just display a gray box where the video should be. The good news is that Flash hasn't crashed X yet which started happening on my laptop recently with Flash 9. Also I haven't had any regressions yet so that's good news. I would recommend checking it yourself. I would love to know how well it is working on 32-bit machines.

UPDATE: Shortly after posting this I visited some other flash sites that normally worked with Flash 9 and they were not working correctly. I reverted to Flash 9 for the time being and things are back to "normal".

Labels: ,

Wednesday, August 20, 2008

Linux powersaving tunables

Linux offers many powersaving features but you have to know where to look to enable these features. There is a wealth of information over at LessWatts.org. I have greatly reduced my power consumption by implementing many of their tips. The first place you should start is by enabling cpufreq. This is probably the number one powersaving feature. I would also enable dynticks in the kernel. To get a better idea of how much power you are using make sure to enable the powertop interface in the kernel. Then there are many tunable powersaving features that you can manipulate from userland. Here are examples that I have used.

hal-disable-polling --device /dev/hda

Disables polling of your cdrom drive but without it most drives will not automatically recognize when a CD/DVD is inserted.

echo 5 > /sys/bus/pci/drivers/iwl3945/0000\:03\:00.0/power_level

Turns on powersaving features of the intel 3945 wireless card. Some people have reported that it can cause problems with staying connected to access points. I haven't had much trouble with it.

hdparm -B 1 -S 12 /dev/sda

Enables aggressive powersaving on the hard drive.

echo 1 > /sys/devices/system/cpu/sched_mc_power_savings

Increases CPU idle time which allows you to acheive lower power states.

echo min_power > /sys/class/scsi_host/host0/link_power_management_policy

Enables power managment for SATA.

echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

Increases dirty VM writeback time which allows your HDD to stay spun down for longer periods of time.

In addition to these features the cpufreqd, laptop-mode, and powersave daemons all can help lower your wattage.

Labels: , , ,

Monday, August 18, 2008

Updated sK1 ebuild with gnome USE flag

I've updated my sK1 svn ebuild to include a gnome USE flag. The normal build defaults to Crystal icons. The USE flag patches the configurator.py file to use Tango icons and also changes the fonts. You can edit the patch to use different fonts if you like.

/usr/local/portage/media-gfx/sK1-9999.ebuild

/usr/local/portage/media-gfx/files/gnome-sK1.patch

Labels: , , , ,

Webkit-GTK svn ebuild

I have been very interested in Webkit ever since the GTK port was announced. It seems like a good fit for integration with Gnome applications like Epiphany and Evolution. Right now I'm using it in Evolution-RSS and Midori, a Webkit-GTK browser. There are a couple of svn snapshot ebuilds in portage but I find myself constantly creating new snapshot ebuilds to test out the latest Webkit-GTK along with the svn ebuild of Midori. So in a similar fashion to my sK1 svn ebuild I decided to create a Webkit-GTK svn ebuild. Be forewarned that the checkout process takes a very long time. Based on my genlop output the checkout process alone took 40 minutes and compilation took another 20 minutes.

/usr/local/portage/net-libs/webkit-gtk-9999.ebuild

Labels: , , , , , , , , ,

Sunday, August 17, 2008

Extremely hacked Flash 10 on Gentoo

Flash has always been a problem for me on 64-bit linux. It works ok with Nspluginwrapper but is continually crashing or hanging the browser. It has even started to crash X lately which is just screwed up. So I decided to take Flash 10 beta for a test drive to see if anything is improved but I ran into some stumbling blocks along the way. Nspluginwrapper failed to install the latest flash because it was missing some necessary 32-bit libraries. Fortunately I found that the 32-bit binaries of OpenOffice and Adobe Reader provided the necessary libraries but they were not located in /usr/lib32. I didn't want to mess with the library path so I just symlinked the necessary libraries into /usr/lib32. I logged out and back in again and Flash 10 is working! I'll report back later so see how well this hack stands up and how well Flash 10 performs. If you want to try it out here are a couple of files you might want. Remember that this only works on 64 bit, you need nspluginwrapper, and you must have both the Adobe Reader binary and the OpenOffice binary installed.

This script will symlink the necessary libs into place. It needs to be given execute permission and run as root. Also the script is extremely dumb so check the output for failures:

symlink.sh

This ebuild is just a copy from portage but with a modified version number to get the latest beta released on August 11, 2008:

/usr/local/portage/net-www/netscape-flash/netscape-flash-10_beta20080811.ebuild

Labels: , , , , ,

Evolution-RSS

For years I have been using Liferea for RSS feeds and Evolution for email. After years of searching for information in mailing lists using Evolution then switching to Liferea for RSS I got tired of it and started looking for a RSS plugin for Evolution when I found Evolution-RSS. That was a few months ago when the stable version was 0.0.8. Since then a newer version has been released but not updated in the sunrise overlay. I took the 0.0.8 ebuild and Auke Booij's advice on Gentoo Bugzilla and created this ebuild:

/usr/local/portage/gnome-extra/evolution-rss/evolution-rss-0.1.0.ebuild

The newest Evolution-RSS has the ability to display feeds using either Gecko or Webkit (if installed). You can also use Evolution's excellent search function on your RSS feeds. It makes finding information so much easier. The downsides are that it is still incomplete and I have come across a few crasher bugs (adding a feed within evolution crashes evo for me). Also there is no dbus integration so downloading feeds directly through Epiphany is a no go. You need to manually add feeds using evolution-import-rss.

Labels: , , , , , ,

Weird icon bug

I have beeen using the now defunct gTangish icons for a couple of months now and found a weird problem where icons in 32-bit binaries (I am using 64-bit) like Acrobat Reader, Raw Therapee, and Realplayer displaying larger than life to say the least. No other icon set had this problem. After some investigating I found that it was most likely a index.theme issue. Not wanting to look for the fatal flaw all day I decided I would base a new theme.index off of the gTango icon set which has now taken the place of gTangish. (I don't really like the gTango set as much as gTangish that's why I am still using it). Anyway here is what the problem looked liked:



The modified theme makes everything look normal again:



Here is the modified gTangish theme.index

Labels: , , , ,

Saturday, August 16, 2008

Conky

Conky is a system monitor for Linux. It can be customized in pretty much any way imagineable. This is what my conky looks like:


Here is my .conkyrc

Labels: ,

Friday, August 15, 2008

sK1 svn ebuild

For ten years now UNIX has had a fantastic vector editor called Skencil (formerly Sketch). The bad news is that it hasn't been updated in over 2 years. That's where sK1 comes in. It has a new updated interface along with a cairo backend and CMYK support for use in pre-press. I've been checking out svn versions and the project looks very promising although quite incomplete at the moment. Anyway, I got tired of fetching things manually and adapted an sK1 ebuild I found on the net to fetch the latest svn version. Here it is:

/usr/local/portage/media-gfx/sK1/sK1-9999.ebuild

Labels: , , , , ,

Watch TV on the internet with Miro

If you haven't heard of it yet Miro is an opensource internet TV application available for Linux, Mac, and Windows. It uses RSS feeds to grab torrents and then downloads them for viewing. There are is also a guide to watch free television but what if you want to watch a show that isn't in the guide? There is an easy workaround that should be familiar to you if you use bittorrent already, it's called Mininova.

First you need to navigate to Mininova and search for the show you want to watch. I will use the Daily Show as an example. You will get a list like this:


Click on any actual Daily Show episode. Notice that some results that are displayed are for other shows. When you do click on a torrent it will load another page with links like this at the top of the page:



Click on the show title, in this case "The Daily Show". This will load another page that prominently displays an orange RSS feed link:



Now open Miro and and from the toolbar menu choose Channels->Add a new channel. Use the rss feed for the show you searched for as the URL. That's it. Now you have a channel in Miro that will automatically download the latest feeds.

There are a couple of things to note. While this works quite well for me it isn't without issues. You will tend to get multiple of the same episodes because of the nature of a bittorrent search site. Also Miro isn't exaclty light on resources and it is a bit buggy to boot. The good news, at least for linux users, is that Banshee is going to be incorpoarting the same technology into their 1.4 release due out in September. If you haven't used it Banshee is one of the best media players for Linux and after the aforementioned 1.4 release I believe it will be the best media player hands down on any platform.

For Gentoo users out there here is an ebuild for the latest version of Miro (1.2.6) that I adapted from an ebuild for version 1.2.4 found on the net:

/usr/local/portage/media-tv/miro/miro-1.2.6.ebuild

/usr/local/portage/media-tv/miro/files/setup.py.patch

/usr/local/portage/media-tv/miro/files/MozillaBrowser.sed

Labels: , , , , , , , ,

Fix frequency scaling on Gentoo >=2.6.25

I created this blog for a few reasons. One of those reasons is to document tips, tricks, and workarounds for computer related problems that I have come across. I have been creating notes on my computer to reference these problems but this blog will allow me to not only store my findings on the web but also allow other people to access them should they provide useful. So without futher ado here is my first fix.

First a little background, my OS of choice is Gentoo Linux. Currently I am running a 64-bit kernel with a hardened profile, and a hardened gcc 4.2 from Xake's toolchain overlay. I am using PaX/Grsec for hardening.

The Problem:

After upgrading to kernel with version 2.6.25 or higher frequency scaling stopped working with cpufreqd. After hours of investigating the problem, and a few Gentoo forum posts it was determined that the problem lay with cpufrequtils. In order to work properly cpufrequtils had to be upgraded. Unfotunately there is only one cpufrequtils package in portage and it is quite old.

The Solution:

A new ebuild had to be created for the latest cpufrequtils. I based the new ebuild on the current ebuild only modifying the "epatch" line. Here are the results for anyone who may be experiencing issues with cpu frequency scaling on Gentoo.
/usr/local/portage/sys-power/cpufrequtils/cpufrequtils-004.ebuild

/usr/local/portage/sys-power/cpufrequtils/files/cpufrequtils-conf.d

/usr/local/portage/sys-power/cpufrequtils/files/cpufrequtils-init.d

Labels: , , , ,

write(msg)

A Linux blog to share any hints, tips, ebuilds, and insight I have picked up along the way. My interests mainly lie in security, photography, the web, and multimedia.

Monday, August 25, 2008

Updated sK1 gnome patch

It seems that the latest revision of sK1 has a new configurator.py that breaks my old gnome patch. I've updated the patch to work with the latest revision. Hopefully this won't end up being an arms race type of affair where configurator.py is constantly changing. Just rename to gnome-sK1.patch and copy in place of the old patch and remember to edit the fonts and font sizes in the patch if you want to match your gnome theme better.

Labels: , , , ,

Updated Midori ebuild

Midori is now using a new build system so if you attempt to emerge it like before it will not work. There is an updated ebuild available on bugzilla. Unfortunately I have yet to get it to work. It builds fine with the new ebuild but the program will not start. I am using it in conjunction with my webkit-gtk svn ebuild. If I find the solution to the problem I will post an update.

UPDATE: It's working now. I built it with a vanilla compiler instead of my default hardened compiler and it is running now. I test Acid3 on Midori everytime I rebuild it. It gets to 77 before it crashes. This is better than the 69 I was getting before. At one time I was able to acheive 100 percent compliance but that hasn't happened in months. My biggest gripe/bug continues to be the font settings. It seems that Midori will not respect my font settings until I adjust them. I have to change the font size and then change it back again every time I start Midori.

Labels: , , , , ,

Thursday, August 21, 2008

Flash 10 update

Four days ago I installed Flash 10 on my laptop. I was hoping it would solve some of the issues I was having with Flash. Unfortunately I haven't seen many differences at all. I'm not sure if my problems are related to Flash itself or nspluginwrapper but Flash still crashes or hangs my browser occasionally and some Flash videos still don't work, they just display a gray box where the video should be. The good news is that Flash hasn't crashed X yet which started happening on my laptop recently with Flash 9. Also I haven't had any regressions yet so that's good news. I would recommend checking it yourself. I would love to know how well it is working on 32-bit machines.

UPDATE: Shortly after posting this I visited some other flash sites that normally worked with Flash 9 and they were not working correctly. I reverted to Flash 9 for the time being and things are back to "normal".

Labels: ,

Wednesday, August 20, 2008

Linux powersaving tunables

Linux offers many powersaving features but you have to know where to look to enable these features. There is a wealth of information over at LessWatts.org. I have greatly reduced my power consumption by implementing many of their tips. The first place you should start is by enabling cpufreq. This is probably the number one powersaving feature. I would also enable dynticks in the kernel. To get a better idea of how much power you are using make sure to enable the powertop interface in the kernel. Then there are many tunable powersaving features that you can manipulate from userland. Here are examples that I have used.

hal-disable-polling --device /dev/hda

Disables polling of your cdrom drive but without it most drives will not automatically recognize when a CD/DVD is inserted.

echo 5 > /sys/bus/pci/drivers/iwl3945/0000\:03\:00.0/power_level

Turns on powersaving features of the intel 3945 wireless card. Some people have reported that it can cause problems with staying connected to access points. I haven't had much trouble with it.

hdparm -B 1 -S 12 /dev/sda

Enables aggressive powersaving on the hard drive.

echo 1 > /sys/devices/system/cpu/sched_mc_power_savings

Increases CPU idle time which allows you to acheive lower power states.

echo min_power > /sys/class/scsi_host/host0/link_power_management_policy

Enables power managment for SATA.

echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

Increases dirty VM writeback time which allows your HDD to stay spun down for longer periods of time.

In addition to these features the cpufreqd, laptop-mode, and powersave daemons all can help lower your wattage.

Labels: , , ,

Monday, August 18, 2008

Updated sK1 ebuild with gnome USE flag

I've updated my sK1 svn ebuild to include a gnome USE flag. The normal build defaults to Crystal icons. The USE flag patches the configurator.py file to use Tango icons and also changes the fonts. You can edit the patch to use different fonts if you like.

/usr/local/portage/media-gfx/sK1-9999.ebuild

/usr/local/portage/media-gfx/files/gnome-sK1.patch

Labels: , , , ,

Webkit-GTK svn ebuild

I have been very interested in Webkit ever since the GTK port was announced. It seems like a good fit for integration with Gnome applications like Epiphany and Evolution. Right now I'm using it in Evolution-RSS and Midori, a Webkit-GTK browser. There are a couple of svn snapshot ebuilds in portage but I find myself constantly creating new snapshot ebuilds to test out the latest Webkit-GTK along with the svn ebuild of Midori. So in a similar fashion to my sK1 svn ebuild I decided to create a Webkit-GTK svn ebuild. Be forewarned that the checkout process takes a very long time. Based on my genlop output the checkout process alone took 40 minutes and compilation took another 20 minutes.

/usr/local/portage/net-libs/webkit-gtk-9999.ebuild

Labels: , , , , , , , , ,

Sunday, August 17, 2008

Extremely hacked Flash 10 on Gentoo

Flash has always been a problem for me on 64-bit linux. It works ok with Nspluginwrapper but is continually crashing or hanging the browser. It has even started to crash X lately which is just screwed up. So I decided to take Flash 10 beta for a test drive to see if anything is improved but I ran into some stumbling blocks along the way. Nspluginwrapper failed to install the latest flash because it was missing some necessary 32-bit libraries. Fortunately I found that the 32-bit binaries of OpenOffice and Adobe Reader provided the necessary libraries but they were not located in /usr/lib32. I didn't want to mess with the library path so I just symlinked the necessary libraries into /usr/lib32. I logged out and back in again and Flash 10 is working! I'll report back later so see how well this hack stands up and how well Flash 10 performs. If you want to try it out here are a couple of files you might want. Remember that this only works on 64 bit, you need nspluginwrapper, and you must have both the Adobe Reader binary and the OpenOffice binary installed.

This script will symlink the necessary libs into place. It needs to be given execute permission and run as root. Also the script is extremely dumb so check the output for failures:

symlink.sh

This ebuild is just a copy from portage but with a modified version number to get the latest beta released on August 11, 2008:

/usr/local/portage/net-www/netscape-flash/netscape-flash-10_beta20080811.ebuild

Labels: , , , , ,

Evolution-RSS

For years I have been using Liferea for RSS feeds and Evolution for email. After years of searching for information in mailing lists using Evolution then switching to Liferea for RSS I got tired of it and started looking for a RSS plugin for Evolution when I found Evolution-RSS. That was a few months ago when the stable version was 0.0.8. Since then a newer version has been released but not updated in the sunrise overlay. I took the 0.0.8 ebuild and Auke Booij's advice on Gentoo Bugzilla and created this ebuild:

/usr/local/portage/gnome-extra/evolution-rss/evolution-rss-0.1.0.ebuild

The newest Evolution-RSS has the ability to display feeds using either Gecko or Webkit (if installed). You can also use Evolution's excellent search function on your RSS feeds. It makes finding information so much easier. The downsides are that it is still incomplete and I have come across a few crasher bugs (adding a feed within evolution crashes evo for me). Also there is no dbus integration so downloading feeds directly through Epiphany is a no go. You need to manually add feeds using evolution-import-rss.

Labels: , , , , , ,

Weird icon bug

I have beeen using the now defunct gTangish icons for a couple of months now and found a weird problem where icons in 32-bit binaries (I am using 64-bit) like Acrobat Reader, Raw Therapee, and Realplayer displaying larger than life to say the least. No other icon set had this problem. After some investigating I found that it was most likely a index.theme issue. Not wanting to look for the fatal flaw all day I decided I would base a new theme.index off of the gTango icon set which has now taken the place of gTangish. (I don't really like the gTango set as much as gTangish that's why I am still using it). Anyway here is what the problem looked liked:



The modified theme makes everything look normal again:



Here is the modified gTangish theme.index

Labels: , , , ,

Saturday, August 16, 2008

Conky

Conky is a system monitor for Linux. It can be customized in pretty much any way imagineable. This is what my conky looks like:


Here is my .conkyrc

Labels: ,

Friday, August 15, 2008

sK1 svn ebuild

For ten years now UNIX has had a fantastic vector editor called Skencil (formerly Sketch). The bad news is that it hasn't been updated in over 2 years. That's where sK1 comes in. It has a new updated interface along with a cairo backend and CMYK support for use in pre-press. I've been checking out svn versions and the project looks very promising although quite incomplete at the moment. Anyway, I got tired of fetching things manually and adapted an sK1 ebuild I found on the net to fetch the latest svn version. Here it is:

/usr/local/portage/media-gfx/sK1/sK1-9999.ebuild

Labels: , , , , ,

Watch TV on the internet with Miro

If you haven't heard of it yet Miro is an opensource internet TV application available for Linux, Mac, and Windows. It uses RSS feeds to grab torrents and then downloads them for viewing. There are is also a guide to watch free television but what if you want to watch a show that isn't in the guide? There is an easy workaround that should be familiar to you if you use bittorrent already, it's called Mininova.

First you need to navigate to Mininova and search for the show you want to watch. I will use the Daily Show as an example. You will get a list like this:


Click on any actual Daily Show episode. Notice that some results that are displayed are for other shows. When you do click on a torrent it will load another page with links like this at the top of the page:



Click on the show title, in this case "The Daily Show". This will load another page that prominently displays an orange RSS feed link:



Now open Miro and and from the toolbar menu choose Channels->Add a new channel. Use the rss feed for the show you searched for as the URL. That's it. Now you have a channel in Miro that will automatically download the latest feeds.

There are a couple of things to note. While this works quite well for me it isn't without issues. You will tend to get multiple of the same episodes because of the nature of a bittorrent search site. Also Miro isn't exaclty light on resources and it is a bit buggy to boot. The good news, at least for linux users, is that Banshee is going to be incorpoarting the same technology into their 1.4 release due out in September. If you haven't used it Banshee is one of the best media players for Linux and after the aforementioned 1.4 release I believe it will be the best media player hands down on any platform.

For Gentoo users out there here is an ebuild for the latest version of Miro (1.2.6) that I adapted from an ebuild for version 1.2.4 found on the net:

/usr/local/portage/media-tv/miro/miro-1.2.6.ebuild

/usr/local/portage/media-tv/miro/files/setup.py.patch

/usr/local/portage/media-tv/miro/files/MozillaBrowser.sed

Labels: , , , , , , , ,

Fix frequency scaling on Gentoo >=2.6.25

I created this blog for a few reasons. One of those reasons is to document tips, tricks, and workarounds for computer related problems that I have come across. I have been creating notes on my computer to reference these problems but this blog will allow me to not only store my findings on the web but also allow other people to access them should they provide useful. So without futher ado here is my first fix.

First a little background, my OS of choice is Gentoo Linux. Currently I am running a 64-bit kernel with a hardened profile, and a hardened gcc 4.2 from Xake's toolchain overlay. I am using PaX/Grsec for hardening.

The Problem:

After upgrading to kernel with version 2.6.25 or higher frequency scaling stopped working with cpufreqd. After hours of investigating the problem, and a few Gentoo forum posts it was determined that the problem lay with cpufrequtils. In order to work properly cpufrequtils had to be upgraded. Unfotunately there is only one cpufrequtils package in portage and it is quite old.

The Solution:

A new ebuild had to be created for the latest cpufrequtils. I based the new ebuild on the current ebuild only modifying the "epatch" line. Here are the results for anyone who may be experiencing issues with cpu frequency scaling on Gentoo.
/usr/local/portage/sys-power/cpufrequtils/cpufrequtils-004.ebuild

/usr/local/portage/sys-power/cpufrequtils/files/cpufrequtils-conf.d

/usr/local/portage/sys-power/cpufrequtils/files/cpufrequtils-init.d

Labels: , , , ,