!# linux (chrunchbang)

trying out this debian-based distro as ubuntu is getting a bit boring
I expect to learn more using a “proper” debian I thing – openbox is a bit tricky as a window manager (opposed to a desktop manager / environment)

note: apt-get dist-upgrade apparently replaced upgrade

problems/solutions/more nifty ideas:
https://debianhelp.wordpress.com/2012/10/02/crunchbang-11-waldorf-debian-wheezy-os/

http://crunchbanglinux.org/wiki/howto_pages

some thoughts on laptop / sensors:
lm-sensors
sensors-detect

stuff to add:

apt-get install unace rar unrar p7zip zip unzip p7zip-full p7zip-rar sharutils uudeview mpack arj cabextract file-roller audacious

apt-get install w64codecs libdvdcss2 gstreamer0.10-fluendo-mp3 ffmpeg sox twolame vorbis-tools lame faad gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad

apt-get install ttf-mscorefonts-installer

apt-get install gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer0.10-gnonlin gstreamer0.10-plugins-bad gstreamer-tools

apt-get install libxine1-ffmpeg gxine mencoder mpeg2dec vorbis-tools id3v2 mpg321 mpg123 libflac++6 ffmpeg libmp4v2-2 totem-mozilla icedax tagtool easytag id3tool lame libmad0 libjpeg-progs libquicktime2 flac faac faad sox ffmpeg2theora libmpeg2-4 uudeview flac libmpeg3-1 mpeg3-utils mpegdemux liba52-0.7.4-dev

use these repositories for xv (gxine wants it)
deb http://debian.physik.hu-berlin.de/addons wheezy /
#deb-src http://debian.physik.hu-berlin.de/addons wheezy /

now let’s save some power

create /etc/pm/power.d/powersave
thanks to:

#!/bin/sh
# A script to enable laptop power saving features for #! & Debian GNU+linux.
# http://crunchbanglinux.org/forums/topic/11954

# List of modules to unload, space seperated. Edit depending on your hardware and preferences.
modlist="uvcvideo"
# Bus list for runtime pm. Probably shouldn't touch this.
buslist="pci spi i2c"

case "$1" in
true)
# Enable some power saving settings while on battery
# Enable laptop mode
echo 5 > /proc/sys/vm/laptop_mode
# Less VM disk activity. Suggested by powertop
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
# Intel power saving
echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
# Set backlight brightness to 50%
echo 5 > /sys/devices/virtual/backlight/acpi_video0/brightness
# USB powersaving
for i in /sys/bus/usb/devices/*/power/autosuspend; do
echo 1 > $i
done
# SATA power saving
for i in /sys/class/scsi_host/host*/link_power_management_policy; do
echo min_power > $i
done
# Disable hardware modules to save power
for mod in $modlist; do
grep $mod /proc/modules >/dev/null || continue
modprobe -r $mod 2>/dev/null
done
# Enable runtime power management. Suggested by powertop.
for bus in $buslist; do
for i in /sys/bus/$bus/devices/*/power/control; do
echo auto > $i
done
done
;;
false)
#Return settings to default on AC power
echo 0 > /proc/sys/vm/laptop_mode
echo 500 > /proc/sys/vm/dirty_writeback_centisecs
echo N > /sys/module/snd_hda_intel/parameters/power_save_controller
echo 0 > /sys/module/snd_hda_intel/parameters/power_save
echo 10 > /sys/devices/virtual/backlight/acpi_video0/brightness
for i in /sys/bus/usb/devices/*/power/autosuspend; do
echo 2 > $i
done
for i in /sys/class/scsi_host/host*/link_power_management_policy
do echo max_performance > $i
done
for mod in $modlist; do
if ! lsmod | grep $mod; then
modprobe $mod 2>/dev/null
fi
done
for bus in $buslist; do
for i in /sys/bus/$bus/devices/*/power/control; do
echo on > $i
done
done
;;
esac

exit 0

dont forget to make it executable!

more info on powersaving on linux:

Replace ice weasel with Firefox
install from ubuntuzilla repo
add to sources.list: deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main
apt-key adv –recv-keys –keyserver keyserver.ubuntu.com C1289A29
apt-get install firefox, thunderbird, seamonkey
change / create symlink in /usr/bin
ln -s /opt/firefox/firefox /usr/bin/firefox
ln -s /usr/lib/mozilla/plugins /opt/firefox/plugins
(use -f to overwrite if exists in /opt)
update-alternatives –install /usr/bin/x-www-browser x-www-browser /opt/firefox/firefox 100

install adblockplus, java, flash?
apt-get install default-jre
# apt-cache search sun-java (find oracle-something)

what else… ? see chrunchbang thread for ideas :)

http://techpatterns.com/forums/about1435.html
http://crunchbang.org/forums/viewtopic.php?pid=271769

install keyring, GPG keys, SSH keys
.ssh/ needs to be 700, the actual key 600
don’t forget to add it to the system using ‘ssh-add’ – see below for more tips

easier: install ‘keychain’ and tie it to the terminal to unlock ssh key

update your $HOME/.bash_profile file
$ vi $HOME/.bash_profile
Append the following code:

### START-Keychain ###
# Let re-use ssh-agent and/or gpg-agent between logins
/usr/bin/keychain $HOME/.ssh/id_rsa
source $HOME/.keychain/$HOSTNAME-sh
### End-Keychain ###

this will work for shell – add it for “terminator” aswell, the default for !#

next, install mosh,
Apt-get install mosh
open a port on the remote server between 60000 and 61000 and apply it to the raspi as server
take over a screen session using mosh:
$ mosh remotebox — screen -dr

raspberry installation

so I got this raspberry with free transit and hosting so I thought I’d turn it into a chat server, VPN/proxy server and a remote nagios probe

log:
after setting up hostnames and hosts file and manipulating my DNS settings

A-record, AAAA-record set up
/etc/hostname replaced with FQDN (matching DNS)
/etc/hosts amended with:
ip.ad.dr.ess fully.qualified.domain.name fully
[IPv6 address] fully.qualified.domain.name fully
reboot and test ssh to it, etc..

then:
apt-get install nagios-nrpe-server irssi irssi-scripts

consider:
iptables
logrotation

set up irssi with screen:
very nice website: http://quadpoint.org/articles/irssi
split-screen notify is nice
the hilight script makes it even better:

To do this, first load the script. The script I use is a modified version of cras’s hilightwin.pl that logs timestamps as well. It is available here: http://static.quadpoint.org/irssi/hilightwin.pl

Put the script in ~/.irssi/scripts/autorun/ and type /run autorun/hilightwin.pl in irssi.

Next, create the split window. This is done with the /window command. See /help window for details on how this works.

/window new split
/window name hilight
/window size 6

another nice idea: auto-away inside screen:

/set screen_away_active ON
/set screen_away_message
/set screen_away_nick <-- optional.. Annoys people Download: scripts.irssi.org/scripts/screen_away.pl Install mosh http://mosh.mit.edu/#getting