Wednesday 13 January 2010

.conkyrc for conky

# .conkyrc - Edited from various examples across the 'net
# Used by Craig Watson [ www.cwatson.org ] on Fedora 8

# --- Window Layout & Options --- #
own_window yes
own_window_colour 2B2739
own_window_transparent no
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
use_spacer right
use_xft yes
alignment bottom_right
gap_x 10
gap_y 10

# --- Colours, Sizes, Fonts & Margins --- #
update_interval 2.0
maximum_width 250
stippled_borders 3
border_width 10
default_color grey

# --- Text --- #
draw_outline no
draw_borders no
font Monospace:size=8:weight=bold
uppercase no
draw_shades no

TEXT
${color white}${time %A},${time %e} ${time %B} ${time %G}${alignr}${time %H:%M:%S}
#${color white}${alignr}$color $uptime

#${color orange}CPU ${hr 2}$color$font
Processes: $running_processes/ $processes${alignr}${color white}${freq_g 2}GHz$color
${cpugraph cpu1 25,120 000000 52496B} ${cpugraph cpu2 25,120 000000 52496B}
#${color #ff6600}${cpubar cpu1 3,120} ${color #cc0033}${cpubar cpu2 3,120}$color

#${color white}TOP ${hr 2}$color
${color white}NAME PID CPU MEM$color
1. ${top name 1}${top pid 1} ${top cpu 1} ${top mem 1}
2. ${top name 2}${top pid 2} ${top cpu 2} ${top mem 2}
3. ${top name 3}${top pid 3} ${top cpu 3} ${top mem 3}
4. ${top name 4}${top pid 4} ${top cpu 4} ${top mem 4}
5. ${top name 5}${top pid 5} ${top cpu 5} ${top mem 5}

#${color orange}MEMORY & SWAP ${hr 2}$color
${color white}RAM$color $memperc% ${membar 6}$color
#${color white}Swap$color $swapperc% ${swapbar 6}$color

#${color orange}ETHERNET (${addr eth0}) ${hr 2}$color
${color white}Down:$color ${downspeed eth0}${alignr}${color white}Up:$color ${upspeed eth0}
${downspeedgraph eth0 25,120 000000 52496B} ${alignr}${upspeedgraph eth0 25,120 000000 52496B}$color

Sunday 10 January 2010

Do not require password in cpufreqselector

From http://linux.aldeby.org/do-not-require-the-password-for-cpu-frequency-scaling-in-ubuntu-karmic-9-10.html

In Ubuntu Karmic 9.10 the frequency scaling GNOME applet always requires a password in order to allow you to change CPU frequency or governor. This is due to policykit profiles enforcing some more strict security.

Helas these profiles are not editable trough the applet in System -> Administration -> Authorisation.

Fortunately, as always in linux this can be achieved by simply editing a text file:

gksudo gedit /usr/share/polkit-1/actions/org.gnome.cpufreqselector.policy

locate the following lines

要調整 CPU 頻率需要權限。  no auth_admin_keep   

and replace the highlighted text

要調整 CPU 頻率需要權限。  no yes   

This change is unfortunately to be applied every time policykit gets updated.

The launchpad bug is #455694

Friday 1 January 2010

Configuring OnDemand CPU frequency scaling

From here http://linux.digitalsp.com/2009/08/improving-stuttering-during-flash-video.html

Problem:

You have a CPU that supports dynamic frequency scaling and you experience dropping frames or sound stuttering during flash video playback. By default the CPU governor in Ubuntu is set to 'ondemand'. It appears that the ondemand governor does not always scale up as needed.

What is ondemand ?

Ondemand is a dynamic in-kernel CPU frequency governor that can change CPU frequency depending on CPU utilization. It was first introduced in the linux-2.6.9 kernel. Not all hardware support this feature. For Intel CPUs is referred to as SpeedStep and for AMD CPUs it is referred to as Cool'n'Quiet or PowerNow!

Solution:

Add the following lines to your /etc/init.d/ondemand configuration file. You can type “sudo gedit /etc/init.d/ondemand” in the terminal to access this file. I changed my file using the root mode of Krusader.
for CPU_THRESHOLD in /sys/devices/system/cpu/cpu*/cpufreq /ondemand/up_threshold
do
[ -f $CPU_THRESHOLD ] || continue
echo -n 40 > $CPU_THRESHOLD
done
This is what my ondemand file looks like after the change:
photo of ondemand configuration file
This will scale your CPU when the processing utilization reaches 40%. You can experiment with different values here. Reboot after making these changes and you can verify that your CPU supports this feature by checking the output from the command line with the dmesgcommand. You should NOT see the following message:
ondemand governor failed, too long transition latency of HW, fallback to performance governor

This should provide an improvement for all applications (not just Firefox, Opera) that needs that extra kick to work smoothly.