Tuesday, 28 May 2013

#! SSD tweaks

In /etc/fstab set noatime,discard

Also add the line:
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0 

to move /tmp to RAM

Change Scheduler to deadline. This is done through grub, read up on elevator=deadline.

Can also move the web browser cache to RAM. Search for firefox config key:
browser.cache.disk.parent_directory
 
http://crunchbang.org/forums/viewtopic.php?id=13129 

Wednesday, 17 April 2013

run a script when a device is mounted

  1. Make sure udev-automount is installed
    pacman -Sy udev-automount
  2. Work out udev rules with udevadm (see Arch Wiki - udev)
    udevadm info -a -n /dev/sdc
  3. Create a udev rule file based on step 2, e.g. /etc/udev/rules.d/81-sdcard-sync.rules, with contents like this:
    KERNEL=="sd?1", ATTRS{idVendor}=="0781", ATTRS{idProduct}=="a7a8", ATTRS{serial}=="6333011111B1", RUN+="/usr/bin/sd-card-sync-start.py"

Sunday, 10 March 2013

Restore screen brightness on start-up

For HP Pavilion g6 with intel graphics, change /etc/rc.local to


#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

echo 976 > /sys/class/backlight/intel_backlight/brightness
exit 0

Wednesday, 6 March 2013

mount samba share

sudo mount -t cifs //192.168.1.1/data_ro /media/network -o user=bob

Monday, 22 October 2012

devmon to automount usb

automount usb drives

devmon &

Sunday, 27 November 2011

rsync from android

1) /root/rsyncpassword should contain rsync password, with each of owner, group and other all denied read/write (chown o-r, o-w, g-w, etc)

2) rsync.conf should set secrets-file for the 'access module' (e.g. ::data in the rsync command below) which contains:

user:password

3) Use tasker to run:
rsync --recursive --update --delete --password-file=/root/rsyncpassword vin@192.168.1.2::data/video/Queue/Podcasts/ /sdcard/media/audio/podcasts/

Monday, 17 October 2011

Open deluge console

deluged runs as user deluge, so to run deluge console with the correct config:

deluge-console -c /srv/deluge/.config/deluge