Archive for January, 2007
Slackware Todo fixed
I kept getting a 404 error when trying to access my Slackware TODO page, so I deleted it and change the title to Slackware Todo. I’m not sure what the problem was, but the page seems to be working now.
SVN Backup Tree
This is just notes to myself about how I set up the SVN directories for backup. (This is not final yet) If you have any suggestion about the layout I’d love to hear them.
On the hard drive
- /home/svnroot
- username1 – Repo
- username2 – Repo
- weekly-dumps/ – ideally only holds 1 dump file per day of the week, I’ll probably end up switching the day of the week and the date (yyyymmdd-dump-DayOfWeek) to make sorting easier
-
- `date +%A-dump-%Y%m%e` = Monday-dump-yyyymmdd
- `date +%A-dump-%Y%m%e` = Tuesday-dump-yyyymmdd
- `date +%A-dump-%Y%m%e` = Wednesday-dump-yyyymmdd
- `date +%A-dump-%Y%m%e` = Thursday-dump-yyyymmdd
- `date +%A-dump-%Y%m%e` = Friday-dump-yyyymmdd
- `date +%A-dump-%Y%m%e` = Saturday-dump-yyyymmdd
- `date +%A-dump-%Y%m%e` = Sunday-dump-yyyymmdd
The main problem I have with this is that I don’t like the backup directory being in the same directory as the $HOME repositories, but I don’t know where to put it.
Managing your $HOME with Subversion
I finally got around to using subversion on my home directories. (well, I got around to figuring out how to get started) Here’s how to get started:
Make a directory to store all the subversion database. (I used /home/svnroot) Next cd into that directory and run svnadmin create --fs-type fsfs $somedir
. $somedir
should be the same as the user’s home. Now su -
to the user that is having their home subversioned. As that user cd to /home and run svn co file:///path/to/svnrepo
Now you can use normal svn commands to add files, or manage your home directory. You can do this on a home directory that already has files in it, which is a big plus 😉
udev Rules
I decided to format one of my flash drives as ext2. This creates a bit of a problem mounting the drives because the other is FAT16. Fortunately there’s a quick fix. (If you’re using udev) For the most part I used the tutorial on Arch Linux’s wiki. The ATTRS part didn’t transfer (not sure if it was just a Slackware or Arch thing or if the wiki entry was a little dated), but it works when SYSFS is used. Put your new rules in a file in /etc/udev/rules.d
, restart udev, and plug/unplug your drives.
To get some information you might want to add to your rule run `udevinfo -a -p /sys/block/sda`
Here’s my new rules file:
KERNEL=="sd?", SYSFS{idVendor}=="08ec", SYMLINK+="vbtm"
KERNEL=="sd?", SYSFS{idVendor}=="054c", SYMLINK+="sony"
I’ll probably change SYSFS{idVendor}
to SYSFS{serial}
now that I figured out the ATTRS bit, and add partition numbering support. (add %n
to the end of the SYMLINK
) I also bought a new 300GB external hard drive (seagate) for backups, so I’ll need to add that to my rules file eventually.
State of the Union
I finally managed to sit through at least some of President Bush’s State of the Union address. It’s really funny to watch when the President says something that is obviously conservative or liberal and one side of the audience starts standing up and clapping, while the other grudgingly begins to do the same. It’s even more funny when they show close ups of the audience when this happens. We have quite a few characters in congress. 😛
More ACPI
I finished writing about the lid scripts that Xubuntu uses (I’ll post after some cleanup), so I’m trying to decide the next target for explanation. Some of the scripts rely heavily on other scripts so they won’t be as straight foward to explain. I think I might work on the script for the AC adapter.
I think I figured out how I’m going to arrange my scripts. I’ll have all the event detection scripts in /etc/acpi/events which will call the response scripts in /etc/acpi/. I want a separate directory (/etc/acpi/actions) to store common power saving functions, so for example if I run the lid script I can easily call spin_down_harddisks, blank_screen, etc. Hopefully this will be cleaner looking than Xubuntu’s current acpi arrangement.
Clearing up the Ubuntu root Myth
I just want to clear something up about Ubuntu and it’s counter parts. Ubuntu DOES have the user root. (He’s just hidden really well hidden 😉 ) You don’t have to use the account, and may not be able to login as root with normal means, but it’s there.
Don’t believe me? Open up a terminal and type sudo su -
and you’ll be sitting at a prompt that says root@yourhostname#
. Still don’t believe me try grep root /etc/passwd
# Notes to self about sudo
Sudo can be configured easily enough to ask for your own password instead of the user you are sudoing to, which explains why you never have to know the root password. (no password’s set anyway) Your user is a member of the admin group (along with many other groups) which would be like the wheel group on most other distros.
The Ubuntu permissions configuration is defiantly something I’ll look at after ACPI, but it will have to be heavily modified when I configure Slackware.
Xubuntu ACPI: The Lid
So what exactly does Xubuntu do when you close your laptop lid? acpid
parses all the files in /etc/acpi/events
for every file looking for an event=
line that contains something that matches button/lid LID 00000080 00000005
or any part of it. On Xubuntu this would be /etc/acpi/events/lidbtn
which calles /etc/acpi/lid.sh
to handle this event.
So what exactly does /etc/acpi/lid.sh
do? (The rest of this post goes line by line through /etc/acpi/lid.sh
in chunks and explains what’s going on. Code from the script should be in mono spaced font and blockquoted.)
#!/bin/bash
. /usr/share/acpi-support/power-funcs
. /usr/share/acpi-support/policy-funcs
. /etc/default/acpi-support
These lines load some scripts containing utilities functions.
. /usr/share/acpi-support/power-funcs
– functions to get misc state info. /usr/share/acpi-support/policy-funcs
– checks for GNOME/KDE power management programs. /etc/default/acpi-support
– power conf file
[ -x /etc/acpi/local/lid.sh.pre ] && /etc/acpi/local/lid.sh.pre
This line looks for the executable file /etc/acpi/local/lid.sh.pre
and runs the script if found. I assume this script is for personal user actions to be done before everything else since it does not exist by default.
if [ `CheckPolicy` == 0 ]; then exit; fi
This line checks for GNOME or KDE power managers running. If they are running the script trusts them take over and doesn’t do anything further.
grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
then
If the word “closed” is in /proc/acpi/button/lid/*/state
this means that the laptop is shut and needs to do the following.
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
To be continued…