Disable screensaver in Ubuntu

#To disable the screensaver:
gconftool-2 -s /apps/gnome-screensaver/idle_activation_enabled --type=bool false

#To disable monitor sleeping:
gconftool-2 -s /apps/gnome-power-manager/ac_sleep_display --type=int 0
(via: http://ubuntuforums.org/showthread.php?t=428967)
Permalink
Posted in: |

Fedora - replace NetworkManager with netwok init script

chkconfig NetworkManager off
chkconfig –levels 35 network on
/etc/init.d/network restart
Permalink
Posted in: |

UC-232A USB 2 Serial adapter with Ubuntu

The Aten UC-232A is a serial interface adapter for RS232 to USB. Since there are no hints regarding the chip on neither the plug nor the package, googling unveiled that it is about a `PL-2303'. The appropriate kernel module can be configured under USB-to-Serial -> Generic Driver -> Prolific-2303 and leads to a module named pl2303.ko

Permalink
Posted in: |

X resolution switching script

A little script to switch between different screen resolutions.

#!/bin/bash
xrandr -q |
grep "^[ *][0-9]" |
cut --output-delimiter : -c0-3,6-16,40- |
sed "s/:/\n/g" |
sed "s/*/ /g"  |
zenity --list --column "No" --column "Resolution" 
    --column "Refresh" --separator : |
xargs -n1 xrandr -r 60 -s
Permalink
Posted in:

Where do you want to vpn today?

Linux Kernel 2.6.15 has been released and includes a PPP MPPE (Microsoft Point to Point encryption) module. MPPE is used i.e. by Microsofts pptp sever for encrypting data ( See the Kernel Changelog for more details). The kernel config. option is CONFIG_PPP_MPPE. Once at it, i suggest to also enable CONFIG_PPP_FILTER, CONFIG_PPP_ASYNC. The previously required module/patch from the pptpclient project becomes obsolete.


Permalink
Posted in:

Suspend2

Installing Software Suspend 2 for Ubuntu breezy, Kernel 2.6.12
Download the appropriate versions of Software Suspend 2 Kernel patches and the hibernate scripts from http://www.suspend2.net/downloads/all/.

Applying the kernel patches:
~# cd /usr/src/linux
~# /path/to/software-suspend-version-for-kernel-version/apply
An `All Happy' response from the script confirms the successful application of the patches.

Configuring the new options available:
# Softwareuspend2
CONFIG_SOFTWARE_SUSPEND2=y
CONFIG_SOFTWARE_SUSPEND2_BUILTIN=y
CONFIG_SOFTWARE_SUSPEND_SWAPWRITER=y
CONFIG_SUSPEND2_FILEWRITER=y
CONFIG_SOFTWARE_SUSPEND_LZF_COMPRESSION=y
CONFIG_SOFTWARE_SUSPEND_TEXT_MODE=y
CONFIG_SOFTWARE_SUSPEND_DEFAULT_RESUME2='swap:/dev/resume_partition'
# CONFIG_SOFTWARE_SUSPEND_KEEP_IMAGE is not set
CONFIG_SOFTWARE_SUSPEND_CHECK_RESUME_SAFE=y
# CONFIG_SOFTWARE_SUSPEND_DEBUG is not set
# CONFIG_SOFTWARE_SUSPEND_DEVELOPER is not set
... where `/dev/resume_partition' is the default swap partition - fdisk -l knows more if in doubt. (Also configurable via the resume2=swap:/dev/resume_partition/ kernel boot option.)

Finally, the hibernate scripts provides a convenient and configurable way to send the system to sleep. After executing ./install.sh from the hibernate-script source dir, the program gets installed in /usr/local/sbin/hibernate with the appropriate configfiles in /etc/hibernate/

Basic suspend worked fine - now playing around with the configuration :)
A more extensive howto can be found at http://www.suspend2.net/HOWTO.html
Permalink
Posted in: |

mass mailer

Mass mailer in few lines:

#!/bin/sh
addrfile="/file/with/thousands_of_addresses.txt"
subject="subject message"
msg="/file/with/msg.txt"
attach="/file/to/attach.jpg"

for address in `cat $addrfile`
do
    mutt -s "$subject" -a "$attach" "$address" \
        <  $msg >> /tmp/spam.log 2>&1
    sleep 1
done

Permalink
Posted in:

LOTS 2005

Soon the swiss open source `bazaar` is opening its gates. For the first time, LOTS is providing an open conference blog for visitors to post their impressions, coments etc. The blog is a BxCMS Blog instance that is publicly accessible from two Boxes at the LOTS venue (at the entrance and the dome) and generally at http://lots.bitflux.ch.

Some interesting sessions (professional day, 18.02.):


Moreover, etoy is recruiting agents for the etoy.ETERNITY project and the etoy.PAINSTATION will be setup for battles!
(1)
Permalink
Posted in:

burning CD-Roms over the network

I found this very useful, to pull a backup from a host out of physical reach.
One way to remotely burn CDs is by using rscsi[1] from within cdrecord[2]
cdrecord dev=REMOTE:user@host:0,0,0 speed=0 .... theimage.iso
somehow i couldn't get this working through an ssh tunnel. The ssh-only method proved to be more successful

we're behind a NAT, so first init. a tunnel

ssh -l user -R 4001:localhost:22 remotehost

on the remotehost we can now do
ssh -l localuser -p 4001 localhost "cdrecord dev=0,0,0 speed=0 -v -eject -"
< theimage.iso

if cdrecord says something like ...
Track 01: 0 of 168 MB written.
/usr/bin/cdrecord: Input/output error. write_g1: scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 03 00 00 00 00 0A 00 00 00 00 73 03 00 00
Sense Key: 0x3 Medium Error, Segment 0
Sense Code: 0x73 Qual 0x03 (power calibration area error) Fru 0x0
Sense flags: Blk 0 (not valid)

... chances are, that DMA is not enabled on the cdrom device
hdparm -d1 -c1 /dev/hdX
(where X is the device)

another variant is to pipe mkisofs output directly to cdrecord

getting data-track size first
mkisofs -r -J -q -print-size /dir/with/data

then:
mkisofs -r -J [moreoptions] /dir/with/data |
ssh -l localuser -p 4001 localhost "cdrecord dev=0,0,0 speed=0 -tszie=XXXs -v -eject -"
where XXX is the output of the formerly issued mkisofs command

In order to make cdrecord suid root and executable for other users:
chmod 4755 `which cdrecord`

obviously this works without the portforwarding as well ...
Permalink
Posted in:

daemonizer

daemonizer is a small utility to execute arbitrary commands detached from the running process or console. It was used to start a daemon process from within php (hence the name), but proved useful for other tasks as well. Daemonizer compiles on Linux only afaik

usage


daemonizer [ -pld ] -e "command to execute"

Options:
-d exec-dir (default: current working directory)
-p pidfile (default: /tmp/daemonizer.pid)
-l logfile (default: /tmp/daemonizer.log)
-e command to execute

Example:

daemonizer -p /var/run/daemonizer.pid -l /var/log/daemonizer.log -d /home/silvan -e "sox inputfile.ogg outputfile.wav"



usage with php
Theres a php5 class which execs daemonizer with the according parameters

include_once 'daemonizer.php';

$command = "sox inputfile.ogg outputfile.wav";
$d = new daemonizer($command);
$pid = $d->daemonize();


Daemonizer doesn't knows anything about the executed process. Therefore error/signalhandling has to be done elsewhere. Daemonizer only checks whether the forked child returns an error, writes that to the logfile and exits.

Download: daemonizer-0.1.tar.gz (12K)

update:
default execdir is now the current working directory instead of /
Permalink
Posted in:

Next1-10/17

LiveSearch

Blogroll

Relayed

Archive

Buttons

  • RSS 2.0 Feed
  • Latest comments
  • XHTML 1.0 compliant
  • Powered by Flux CMS
  • Powered by Popoon

Login


BXCMSNG Errors:
Notice[8] Undefined index: 0 in [BX_PROJECT_DIR]/inc/bx/plugins/blog/categories.php at line 59.