I Will Convince Someone….

…That I Am Only Slightly Insane

PulseAudio Extravaganza! - from ubuntuforums.org

This guide is specially designed to fix certain issues present with Ubuntu Hardy’s current implementation of PulseAudio and to enable equalized output. I have divided this guide into different sections, based on your needs:

Part A: Required Fixes (bug #198453)
Part B: Adobe Flash & PulseAudio Fix - i386 only(bug #192888)
Part C: Stuttering Audio Fix (bug #188226 and bug #190754)
Part D: Equalizer Support (adapted from my original research here and using updated values from the ArchLinux wiki)
Appendix A: General Tips
Appendix B: Troubleshooting Audio Playback/Mixing
Appendix C: Removal Instructions

Before you start: The purpose of this guide is to make PulseAudio work smoothly with all applications, not to fix a system that does not play sound at all.

  • If you are running Kubuntu/Xubuntu/Edubuntu, this guide is not for you (as PulseAudio is not included by default).
  • If you cannot get sound working under any circumstances, then you are probably suffering from a kernel or ALSA bug - this guide is not for you.
  • If you have a brand-new sound card that is not supported in ALSA, and you are using OSS v4 - this guide is not for you.
  • If you can get sound working in some applications but not others, or you find that audio mixing is broken - this guide is for you.

Which part(s) should I follow?
Part A is a required step you must follow, as it will enable proper PulseAudio support in most ALSA-aware applications.

Part B (i386 only) will install version 10 (beta) of Adobe’s Flash plugin, as it has better compatibility with PulseAudio.

Part C is highly recommended if you notice a lot of stuttering audio in some applications. The settings proposed in this guide work well for my system, but you may need to do some manual tweaking to get the best results for your hardware.

Part D is an optional step that enables a system-wide audio equalizer (which can be customized using any LADSPA audio processing plugin). The settings provided in this guide are ideal for laptop users who notice poor quality audio playback using their built-in laptop speakers.

Appendix A gives information on specific applications including Skype, WINE as well as SDL and OSS applications. Appendix B helps troubleshoot audio playback/mixing issues using the PulseAudio Volume Control application. Appendix C will revert all changes made by this guide (if for some reason you can’t get PulseAudio working properly).

Note 1: Changes to PulseAudio will not take effect immediately! Please remember to log out and back in after you have completed all desired steps in this guide, or reboot if you performed a kernel upgrade.

Note 2: If you still experience problems after using this guide, please follow the steps of Appendix B and report the requested information in your post.

Part A: Core Fixes (bug #198453)
This section will adjust your PulseAudio setup to allow almost every ALSA-aware application to work properly with PulseAudio. If you don’t complete this step, any ALSA applications without native PulseAudio support will block access to the sound card, preventing PulseAudio from using it simultaneously.

1. Backup important configuration files (don’t worry if you see “no such file or directory” warnings):

Code:
$ mkdir ~/pulse-backup; sudo mv ~/.asoundrc* /etc/asound.conf ~/pulse-backup/

2. Copy the base PulseAudio configuration files to the local user directory:

Code:
$ cp /etc/pulse/daemon.conf /etc/pulse/default.pa -t ~/.pulse/

3. Install the following packages to ensure proper PulseAudio functionality:

Code:
$ sudo apt-get install libasound2 libasound2-plugins libasound2-dev padevchooser swh-plugins libao-pulse libsdl1.2debian-pulseaudio ladspa-sdk

4. Create a new “~/.libao” file and set the default driver to “pulse” for libao applications:

Code:
$ echo "default_driver=pulse" >~/.libao

5. Create a new “~/.asoundrc” file:

Code:
$ gedit ~/.asoundrc

Paste the following text into the file and save:

Code:
pcm.!default {
  type pulse
}

ctl.!default {
  type pulse
}

pcm.pulse {
  type pulse
}

ctl.pulse {
  type pulse
}

pcm.equalized {
  type plug
  slave.pcm "equalizer";
}

pcm.equalizer {
  type ladspa

  # The output from the EQ can either go direct to a hardware device
  # (if you have a hardware mixer, e.g. SBLive/Audigy) or it can go
  # to the software mixer shown here.
  slave.pcm "plughw"
  #slave.pcm "plug:dmix"

  # Sometimes you may need to specify the path to the plugins,
  # especially if you've just installed them.  Once you've logged
  # out/restarted this shouldn't be necessary, but if you get errors
  # about being unable to find plugins, try uncommenting this.
  path "/usr/lib/ladspa"

  plugins [
    {
      label mbeq
      id 1197
      input {
       #this setting is here by example, edit to your own taste
       #bands: 50hz, 100hz, 156hz, 220hz, 311hz, 440hz, 622hz, 880hz,
       #       1250hz, 1750hz, 25000hz, 50000hz, 10000hz, 20000hz
       #range: -70 to 30
        controls [ -1 -1 -1 -1 -5 -10 -20 -17 -12 -7 -6 -5 -5 0 0 ]
      }
    }
  ]
}

Note: Although an equalizer is defined in this configuration, it will not be used unless you follow Part D, so don’t worry.

Part B: Adobe Flash & PulseAudio Fix - i386 only (bug #192888)
The latest stable version of Adobe Flash does not work very well in conjunction with PulseAudio. Although there are workarounds available (installing the packages “libflashsupport” and “nspluginwrapper”), Flash still has stability problems when configured to use PulseAudio. The latest Flash v10 beta release works correctly, however.
WARNING: Part B is for i386 users only. 64bit users shouldn’t notice as many crashes anyway.

1. Make sure you don’t have “libflashsupport” installed, as it can cause instability:

Code:
$ sudo apt-get remove libflashsupport

2. Download and install the following packages from Intrepid’s repository:

Code:
$ wget http://archive.ubuntu.com/ubuntu/pool/multiverse/f/flashplugin-nonfree/flashplugin-nonfree_10.0.1.218+10.0.0.525ubuntu1_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/a/alsa-lib/libasound2_1.0.16-2ubuntu1_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/a/alsa-lib/libasound2-dev_1.0.16-2ubuntu1_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/a/alsa-plugins/libasound2-plugins_1.0.16-1ubuntu1_i386.deb
$ sudo dpkg -i flashplugin-nonfree_10.0.1.218+10.0.0.525ubuntu1_i386.deb libasound2_1.0.16-2ubuntu1_i386.deb libasound2-dev_1.0.16-2ubuntu1_i386.deb libasound2-plugins_1.0.16-1ubuntu1_i386.deb

Part C: Stuttering Audio Fix (bug #188226 and bug #190754)
PulseAudio appears to create stuttering audio issues on many systems, perhaps due to the default CPU scheduler in Hardy’s shipping kernel 2.6.24-16-generic (bug #188226), buffering problems (bug #190754), or both combined. This information should hopefully solve or at least reduce these problems.

These settings are ideal for my audio card, an “Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC’97 Audio Controller (rev 01)”. They may not work as well for you, so try adjusting the fragment values if you have problems.

1. Make sure your system is up-to-date and you are using at least kernel 2.6.24-18-generic, as it provides important scheduler fixes to prevent PulseAudio skipping.

2. Add your user to the groups “pulse-access” and “pulse-rt”:

Code:
$ sudo adduser $USER pulse-access
$ sudo adduser $USER pulse-rt

3. Edit “~/.pulse/daemon.conf”:

Code:
$ gedit ~/.pulse/daemon.conf

Add the following lines to the end of the file, and save:

Code:
high-priority = yes
nice-level = -11
realtime-scheduling = yes
realtime-priority = 5
default-fragments = 8
default-fragment-size-msec = 5
resample-method = speex-float-0

Note 1: If you still notice stuttering, try modifying the fragment sizes marked in red.
Note 2: The resample method listed in blue will reduce CPU usage, potentially at the cost of some audio quality. Change back to “speex-float-3″ if you don’t care about higher CPU usage.

Part D: Equalizer Support (adapted from my original research here and using updated values from the ArchLinux wiki)
In this section we will configure a LADSPA audio processing plugin (http://www.ladspa.org/) to equalize PulseAudio output.

Here’s a quick explanation of how it works: the configuration in “~/.asoundrc” from Part A uses the LADSPA plugin named “mbeq_1197″, otherwise known as “Multiband EQ”. The integers in the section “controls” set the gain for fifteen different bands, starting at 50Hz and ending at 20Khz. You can use the “listplugins” command to get a full listing of all LADSPA plugins installed on your system, and to see the options of a particular plugin, use the “analyseplugin” command (from the package “ladspa-sdk”). To see the settings for the plugin used in this guide, therefore:

Code:
$ analyseplugin /usr/lib/ladspa/mbeq_1197.so

The settings provided in this guide are intended to help laptop users; if you notice that your sound seems “tinny” and your built-in speakers seem to “rattle” at a high volume, these settings will improve the quality of your sound immensely. The following section will configure PulseAudio to use this equalized output.

1. Edit the file “~/.pulse/default.pa”:

Code:
$ gedit ~/.pulse/default.pa

Navigate to line 32 (marked here in red):

Code:
### Load audio drivers statically (it's probably better to not load
### these drivers manually, but instead use module-hal-detect --
### see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device=”/dev/dsp” sink_name=output source_name=input
#load-module module-oss-mmap device=”/dev/dsp” sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

Change the line marked in red to the following, making sure the hash symbol (this: “#”) is removed, and save changes:

Code:
load-module module-alsa-sink device=equalized

Appendix A: General Tips
Certain applications will not work correctly even with these fixes, but there are workarounds available:

  1. Skype (available in the Medibuntu repository): some special configuration is required. Open Skype’s Options, then go to Sound Devices. You need to set “Sound Out” and “Ringing” to the “pulse” device, and set “Sound In” to the hardware definition of your microphone. For example, my laptop’s microphone is defined as “plughw:I82801DBICH4,0″. Due to a bug in Skype’s ALSA support, you must also follow Part C of this guide to prevent stuttering.
  2. ZSNES: due to bug #188567 you need to change the default audio driver in this application. Run zsnes with the following parameters (note that you only need to do this once, as the default sound driver will be saved):
    Code:
    $ zsnes -ad sdl
  3. WINE: please ensure you are always using the latest version of WINE, available here. The ALSA driver in WINE has been improved and should work with PulseAudio in some cases. If it doesn’t work, set the audio driver to OSS in the “Configure WINE” (winecfg) application, and use padsp as shown below.
  4. OSS applications: You must use the “padsp” wrapper (part of the “pulseaudio-utils” package) to allow OSS-compatible applications to work properly with PulseAudio. Simply invoke the application prefixed with “padsp”, e.g.:
    Code:
    $ padsp quake3
  5. For everything else, please see: http://www.pulseaudio.org/wiki/PerfectSetup (though keep in mind that many steps outlined on that page are already covered in this guide)

Appendix B: Troubleshooting Audio Playback/Mixing
If you cannot get an application to play audio, or share audio with other applications simultaneously, try the following:

  1. Open the “PulseAudio Device Chooser” from Applications/Sound & Video. Click on the applet icon, and click “Volume Control…”. Click on the “Playback” tab.
  2. Run an application and allow it to play sound.
  3. Check PulseAudio Volume Control’s Playback tab and see if the application displays an entry while the application is (or should be) playing audio.

There are three possible results:

  1. The application plays audio and lists an entry in PulseAudio Volume Control.
  2. The application plays audio and does not list an entry in PulseAudio Volume Control.
  3. The application fails to play audio and does not list an entry in PulseAudio Volume Control.

Result A means the application is configured correctly and working properly with PulseAudio.
Result B means the application is not using PulseAudio, but it managed to play audio because the PulseAudio server was in a suspended state (and not accessing the sound card).
Result C is the same as result B, except that the PulseAudio server was not in a suspended state, and so the application could not access the sound card directly.

If you experience result B or C for just a few applications, those particular applications are probably buggy or using OSS output (see Appendix A). If you experience result B or C for most applications, however, your system is configured incorrectly. Ensure you have followed this guide to the letter.

If you have trouble, please reply to this thread giving the following information, and I’ll do my best to help:
1. The result of the troubleshooting steps listed above, using at least two applications if possible. Give the application names and results (A, B or C) for each.
2. The verbose output of PulseAudio, i.e.:

Code:
$ pulseaudio -k; sleep 4; pulseaudio -vv

Appendix C: Removal Instructions
If you cannot get PulseAudio to behave on your system with this guide, the following steps will restore PulseAudio to its original state.

Code:
$ sudo apt-get install flashplugin-nonfree/hardy libsdl1.2debian-alsa
$ sudo rm ~/.asoundrc* /etc/asound.conf ~/.libao ~/.pulse/daemon.conf ~/.pulse/default.pa
$ sudo cp ~/pulse-backup/asound.conf /etc/
$ cp ~/pulse-backup/.asoundrc* ~/

Conclusion
I hope this HOWTO can assist users that have been frustrated by certain shortcomings of PulseAudio. I do hope these fixes make it into Hardy (or at least Intrepid) in an official form, but in the meantime I have outlined the steps necessary to fix the most common problems. Additionally, the Equalizer (LADSPA) setup for PulseAudio (Part D) will most likely remain unique and apart from any “official” changes to Ubuntu, so be sure to check it out if you’re interested. Feedback is welcome!

Friday, July 4, 2008 Posted by James Nealon | HOWTO, Linux, Ubuntu | , , , , , , | No Comments

Recursively Generating MD5SUM’s

I got this wild hair up my ass this morning and since my wife was home to keep an eye on the oldest of the wee ones, I sat down and decided to backup my MP3 collection.  I have a relatively modest collection at about 50 GB, but I like to keep it on my external 750 GB WD MyBook just in case get all retarded and accidentally rm -rf / or something equally as stupid.

So I set up a simple rsync command and that was that in respect to the backup.

Then I decided, for reasons I do not know, that i was going to generate MD5SUM’s for all of the files in that Music directory (a little over 11,000).  I didn’t want to get all bored by doing it directory by directory, so I Googled it a bit and found md5deep.

md5deep easily goes through entire directories trees and generates the md5sums, as well as sha128, sha256, Tiger and Whirlpool.

It is used as easily as typing:

md5deep -r Music/ > /home/myusername/Desktop/md5sums

Yes, it will take a great deal of time to do and yes, it isn’t necessary per-se, but I am just happy that it is available for me to use.

Monday, June 30, 2008 Posted by James Nealon | Computers, HOWTO, Linux, Ubuntu | , , , , , , | No Comments

All Hail The Power Of Conky!

You ever wondered how hot your hard drive is?  Wondered what kinda wattage your power supply is using?  Never can remember exactly how much space you have left?

Well, have no fear young one, I am here and so is Conky, and together we will take you to a place of safety.

Firstly, a little picture.

 My Conky

Now, this may look all hard and owwie, but fear not young one, I shall guide thee on the proper paths.

First, why don’t we install conky?

sudo aptitude install conky

Now, when you first install it, there is a basic setup that is pretty lame. Just go ahead into the terminal and type
conky, and you will see conky.

Now the fun part.

Lemme show you my config file, which in this case is called
.conkyrc

#border_width 1
#default_outline_color white
#default_shade_color white
#draw_borders no
#draw_graph_borders yes
#draw_outline no
#draw_shades no
font 6×10
#gap_x 5
#gap_y 60
#minimum_size 5 5
#no_buffers yes
#out_to_console no
#own_window_class Conky
#own_window_type normal
#stippled_borders 0
#update_interval 3.0
#uppercase no
#use_spacer none

# set to yes if you want Conky to be forked in the background
background yes

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Update interval in seconds
update_interval 1.0

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override #try also ‘normal’ or ‘desktop’
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
#minimum_size 250 5
maximum_width 250

draw_shades no
draw_outline no # amplifies text if yes
draw_borders no
draw_graph_borders yes

#use_xft yes
#xftalpha 0.9
#xftfont Candera:size=6
uppercase no
#override_utf8_locale yes
use_spacer no

stippled_borders 3
border_margin 9
border_width 10

# Gap between borders of screen and text
gap_x 10
gap_y 10

# Default colors and also border colors, grey90 == #e5e5e5
default_color white
color1 white
color2 green

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# stuff after ‘TEXT’ will be formatted on screen
TEXT

${color}$nodename - $sysname $kernel on $machine
${color1}$hr
${color2}Uptime:$color $uptime ${color2}- Load:$color $loadavg
${color2}Frequency (in MHz):$color $freq
${color2}Frequency (in GHz):$color $freq_g
${color2}Temperature:$color ${acpitempf} F
${color2}CPU Usage:${color #cc2222} $cpu% ${cpubar}
${color #cc2222}${cpugraph 0000ff 00ff00}
${color2}RAM Usage:$color $mem/$memmax
$memperc% ${membar}
${color2}Swap Usage:$color $swap/$swapmax
$swapperc% ${swapbar}
${color2}Processes:$color $processes ${color2}Running:$color $running_processes
${color1}$hr
${color2}Networking:
$color Down:${color #0000ff} ${downspeed eth0} k/s${color} ${offset 60}Up:${color #22ccff} ${upspeed eth0} k/s
${color #0000ff}${downspeedgraph eth0 32,125 ff0000 0000ff} ${color #22ccff}${upspeedgraph eth0 32,125 0000ff ff0000}
${color2}Total down:$color ${totaldown eth0} $alignr${color2}Total up:$color ${totalup eth0}
${color2}Gateway IP:$color $gw_ip
${color2}Local IP:$color ${addr eth0} ${color2}Interface:$color $gw_iface
${color1}$hr
${color2}File systems:$color
/ $color${fs_size /}/${fs_used /}/${fs_free}
Backup $color${fs_size /media/disk}/${fs_used /media/disk}/${fs_free}
${color2}Name PID CPU% MEM%
${color1} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${color2}Mem usage
${color1} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color} ${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${color} ${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${color} ${top_mem name 4} ${top_mem pid 4} ${top_mem cpu 4} ${top_mem mem 4}
${color2}Tail /var/log/Xorg.0.log$color
${tail /var/log/Xorg.0.log 5 30}
${color2}Tail /var/log/messages$color
${tail /var/log/messages 5 30}
${color1}$hr
${color2}Port(s)${alignr}#Connections
$color Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768 61000 count}${alignr}ALL: ${tcp_portmon 1 65535 count}
${color2}Inbound Connection ${alignr} Local Service/Port$color
${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
${color2}Outbound Connection ${alignr} Remote Service/Port$color
${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
${color1}$hr

Now, it may look like a bitch, but trust me, after a little time with the command man conky and a bit of time at this thread at Ubuntuforums.org, you will be pimping your shit in no time.

Later

Loading image

Click anywhere to cancel

Image unavailable

Sunday, June 29, 2008 Posted by James Nealon | HOWTO, Linux, Ubuntu | , , , , | No Comments

Reducing Disk Activity In Hardy Heron - (Seen on Ubuntuforums.org)

HOWTO: Decrease disk activity

Overview
This guide is aimed at people who wish to reduce the frequency at which their disks are written to. Reasons to do that may include:

- The noise or sight of the disk constantly writing every few seconds is annoying.
- To reduce heat.
- To reduce Load_Cycle_Count problems as described here.

By default, Ubuntu (actually, Linux in general), has two important features that cause the disk to write every few seconds. The first is the default journal commit time of the ext3 filesystem and the second is the rate at which the kernel wakes up to write dirty pages to disk.

By default, both of these settings are set to 5 seconds which is one of the primary reasons that Ubuntu systems seem to never have idle disks. This guide will show you how to raise those settings to a higher value in order to reduce disk activity.

Disclaimer
This guide shows you how to change default Ubuntu settings that are specifically in place to reduce the amount of work lost in the case of unexpected system shutdown. If you don’t feel your system is 100% stable, do not use this guide. If you live in an area with frequent power outages, do not use this guide.

Implementation
We are going to change the default 5 second settings to 60 seconds. Anywhere were we are using the 60 seconds number, I will highlight in blue so that if you wish to adjust this value, you know exactly what to change. I’m using 60 seconds because it means that in the event of an unexpected power outage, you will lose at most around 60 seconds of work. If you are using a laptop or have an UPS for your machine, you can set this number higher if you wish.

To do this, we will backup 2 files, change the settings and then reboot to test. All these commands should be run from a new terminal where the current directory is your home directory.

The first file we will change is /etc/fstab so that it only commits the journal every 60 seconds. First, backup /etc/fstab (dda stands for Decrease Disk Activity):

Code:
sudo cp /etc/fstab /etc/fstab.dda.bak

Then, tinivole was nice enough to provide an awk command to automatically change all the ext3 partitions to have a commit time of 60 seconds. We will run the command and output to a temporary file so that we can verify that the output is correct:

Code:
awk '{if ($3 == "ext3") print $1" "$2"\t"$3"\t"$4",commit=60 “$5″\t”$6; else print}’ /etc/fstab > fstab.tmp

Now, we will verify that the changes are correct:

Code:
diff /etc/fstab fstab.tmp

You should see output that looks similar to this:

Code:
6c6
< UUID=d12eeb71-f5a8-4062-95da-d0513c37ced2 /               ext3    defaults,errors=remount-ro 0       1
---
> UUID=d12eeb71-f5a8-4062-95da-d0513c37ced2 /	ext3	defaults,errors=remount-ro,commit=60 0	1

Notice the ,commit=60. You may have more output than that but, any line in the output that begins with “>” should have it and it’s very important that it looks like this. If you have any doubt whatsoever, post the output of that command in this thread and wait until myself or someone else says that the output is ok before proceeding.

If the output looks ok, then we can replace /etc/fstab with our temporary file and then remove it:

Code:
sudo cp fstab.tmp /etc/fstab
rm fstab.tmp

That’s it for ext3 changes and we will move on to kernel tunable changes. First we will make a backup of /etc/sysctl.conf and create a file for editing:

Code:
sudo cp /etc/sysctl.conf /etc/sysctl.conf.dda.bak
cp /etc/sysctl.conf sysctl.tmp

Now open sysctl.tmp with your editor of choice and, at the bottom of the file, add:

Code:
vm.dirty_ratio = 40
vm.dirty_background_ratio = 1
vm.dirty_writeback_centisecs = 6000

In this case, we are specifying centiseconds so, rather than 60 seconds, we use 6000 centiseconds here. The top two options simply wait slightly longer to request disk writes and then write as much as possible.

Once those changes have been made, we can copy our temporary file back and remove it:

Code:
sudo cp sysctl.tmp /etc/sysctl.conf
rm sysctl.tmp

Update:
For Hardy, the final step is to disable the part of pm-utils that will reset our values. To do this we simply make the script that resets these values not executable:

Code:
sudo chmod -x /usr/lib/pm-utils/power.d/laptop-tools

This final step is not needed for versions of Ubuntu before Hardy.

That’s it for system changes.

Testing
The easiest way to test is to simply reboot your system and, once you have logged in and the system is fully up, watch your hard drive lights. You should notice them flickering far less often. As a more thorough test, you can run the following commands:

Code:
cat /proc/mounts | grep commit

You should see your commit=60 changes with that command. To test the other file we changed, issue the following three commands:

Code:
cat /proc/sys/vm/dirty_ratio
cat /proc/sys/vm/dirty_background_ratio
cat /proc/sys/vm/dirty_writeback_centisecs

The output should be, “40″, “1″ and “6000” respectively (it may actually be 5999 and not 6000. This is normal).

Saturday, June 28, 2008 Posted by James Nealon | HOWTO, Linux, Ubuntu | , , , , | No Comments

Well, I guess so…

So after the post yesterday I sat around for a bit and realized that I truly did miss Ubuntu a great deal. So this morning I had to format the MyBook I picked up the other day to fat32 so I could move some things from system to the other.  I know, fuck you too, there are thirty easier ways other than fat32, but I like it, so piss off.

I just got all the updates and what and as I discover handy-dandy little things i will post them and all of that happy horseshit.

So, about that post yesterday, I guess all I needed to do was see that in print and realize how weird it sounded to me.

So yeah, will talk later.

Friday, June 27, 2008 Posted by James Nealon | Computers, Linux, Ubuntu | , , , , , , , | No Comments

Switch Me If You Can

I was a beta tester for Hardy Heron since before it was even named that.  I remember when everyone was hoping for Hungry Hippo, but I think Hasbro might have had something to say about that in the end.  I could be wrong though, I am just a bitch little computer nerd, not the mighty forces of Open Source and vast commercialism.

Anyway, I digress.

I am using Windows again.  I was happily GPL-ing and all of a sudden, it just wasn’t all that fun anymore.

Building packages from source, adding some half-assed self-made patch because the developer forgot to add a semi-colon in the right place, or better yet, thy just completely neglected to add libraries that were necessary because they wanted to jump on the Ubuntu bandwagon before the fire went out.

So I am sitting here on a XP box with normal software.

I know Linux is better, I truly do.

Now you just need to make me believe in it like i used to.

Thursday, June 26, 2008 Posted by James Nealon | Computers, Linux, Ubuntu | , , , , , , , , | 2 Comments

Yeah, so I am retarded.

So, I remembered that I had a blog.

Yeah, I know, I’m a fuck up, thanks for noticing all my flaws.

So, I will begin posting forthwith and continue to do such until such a time, and the time will come, that I am am bodily transported by Xenu to the innards of the volcano so that I may be blown up along with the others.  This is after i am taken millions of years back into time.  So, it may be a long wait for those of you who want to see me go.

And yes, they really do believe it happened.

And no, I won’t sleep with you, unless you are down with me and my wife, then we can negotiate.

Later Fuck Sticks.

Wednesday, June 25, 2008 Posted by James Nealon | Me, Rants | , , , , | No Comments

Anniversary

Five years ago, lonely and nearly suicidal in the backwaters of Kansas, I would have never imagined that I would be married now.  I would have bemoaned my fate or something equally as dramatic and then cast myself as the role of the pathetic emo kid in a play I wrote that only uses Linkin Park lyrics.

However, here I am.  Three years down and an eternity to go.

Tuesday, November 20, 2007 Posted by James Nealon | Me | , | 3 Comments

My Ubuntu Setup - Part Three - Tweakage - Part One

Today we delve into the ever popular, and sometimes dangerous world of tweaking your Ubuntu machine for greater performance. Before we begin however, I have to tell you that I am not responsible if you hose your box because you can’t follow instructions. With that said, let’s start with something relatively simple. Fonts.

First, in your terminal, use your favorite editor to create a file named .fonts.conf. Yes, that is a dot before the file name, a very important one to I may add.

Secondly, simply copy and paste the code below and save your file. In order to see the results, you will have to log out of your current session and log back in.

<fontconfig>
<match target=”font”>
<edit mode=”assign” name=”rgba”>
<const>none<const>
<match target=”font”>
<edit mode=”assign” name=”hinting”>
<bool>true</bool>
</edit>
</match>
<match target=”font”>
<edit mode=”assign” name=”hintstyle”>
<const>hintmedium</const>
</edit>
</match>
<match target=”font”>
<edit mode=”assign” name=”antialias”>
<bool>true</bool>
</edit>
</match>
<!– Added (Ubuntu fix) –>
<match target=”font”>
<edit mode=”assign” name=”autohint”>
<bool>true</bool>
</edit>
<!– End Added –>

This will give you some nice looking fonts. Anti-aliased and everything. Nice and yummy looking I assure you. There is no way you can harm your system with this file incidentally. If you do not like it, well, delete it.

See, now that you have a taste for living dangerously you want more don’t ya? Well, far it be from me to deny you your pleasure. So the next thing we have is a little more, shall we say, intense. Grub time.

This is were paying really close attention comes in handy to be sure.

Firstly, we need to open up the file we are going to edit:

sudo nano -w /boot/grub/menu.lst

I like nano for something like this, but you can substitute nano -w with gedit, kate, vim, etc.. Now that we have the file open, we are going to start the tweaking.

You need to look for the following entries in the file:

# defoptions=quiet splash
# altoptions=(recovery mode) single

When you find them, make them look like this:

# defoptions=quiet splash rootflags=data=writeback
# altoptions=(recovery mode) single rootflags=data=writeback

That’s it. You have now sped up your computer by enabling the writeback option. Mind you, do not do this if you do not have ext3 partitions installed. It does not end well.

Save your file and then, and this is important, you need to run the following command:

sudo update-grub

This updates the grub file you just altered and will make what you just did available on your next reboot.

Now that we have updated grub, we need to update the fstab so that our hard drives are well aware of what we just did.

So, the following code needs to be entered:

sudo nano -w /etc/fstab

Again, the option of replacing the nano command is yours. This is a nasty file wher eyou can do nasty things to your system. Be vewy, vewy careful in here.

In the file, look for the code:

defaults,errors=remount-ro

Replace that code with the following:

defaults,errors=remount-ro,data=writeback,noatime 0

The trailing 0 is very important by the way, make sure to keep it in there.

Save the file and exit it. The next part is independent to your machine. For mine, I had to enter:

sudo tune2fs -o journal_data_writeback /dev/sda2

Your drive may be completely different. Pay attention to the line you are changing in your fstab and enter that partition into the code above.

Well ladies and gentleman, that is it for this morning. Tomorrow we will play with Concurrent Booting, Swapping, Broadband Internet and more.

Monday, November 19, 2007 Posted by James Nealon | Linux | , , , , , , , | 1 Comment

My Ubuntu Setup - Part Two - Software - Part Two

While I most likely could have fit this into a single post, I didn’t want to do it that way, so nyar! Today we will be focusing on the lighter side of things. Things you may not necessarily always need, but you miss if you do not have at the right moment.

I am a huge font whore. I have over 4000 myself and am always looking for more to add to my collection. Unlike windows, they do not slow your computer down to a crawl if you have a great many of them, plus, unlike windows, they come in easily obtainable packs. Like those below. Mind you, I have a great many more that what is listed below, but it is a hell of a start.

sudo aptitude install ttf-larabie-straight ttf-larabie-deco mplayer-fonts xfonts-terminus-dos xfonts-terminus xfonts-terminus-oblique xfonts-mona tv-fonts ttf-tuffy ttf-sjfonts ttf-sil-padauk ttf-sil-ezra ttf-paktype ttf-georgewilliams ttf-fifthhorseman-dkg-handwriting ttf-farsiweb ttf-essays1743 fonty ttf-opensymbol ttf-nafees ttf-mgopen ttf-gentium ttf-freefont ttf-dustin ttf-devanagari-fonts ttf-dejavu-extra ttf-dejavu-core ttf-dejavu ttf-bpg-georgian-fonts ttf-bitstream-vera ttf-alee

Again, this is just as mall sampling but will get you off to a rather pleasant start.

Next, we come to the wonderful world of the Internet. With all the myriad of things one can do, it is amazing that you can breathe with all of the selection available to you. I will list below a few yummies I particularly like, if you do not know what they are, I strongly suggest using our hundred zero suffix friend, (Google).

sudo aptitude install unace rar unrar zip unzip p7zip-full p7zip-rar sharutils aish uudeview mpack lha arj cabextract file-roller thunderbird enigmail lightning-extension deluge-torrent filezilla xchat adobereader-plugin

Like I said, nothing huge, but a nice sampling of the variety of things available.

Well folks, that does it for this one, next post is all about system configuration and customizations, tweaks if you will.

Saturday, November 17, 2007 Posted by James Nealon | Computers, Linux, Ubuntu | , , , , , , | 1 Comment