Ownership Permissions of /var in Debian Squeeze

Suppose you happen to accidentally do sudo chown -R www-data:www-data * whilst the current directory is /var. Now that’s a fairly daft thing to do! but we all make mistakes. There doesn’t seem to be an easy way to correct this other than restore a backup or look at another machine with a similar setup. Rather than having to restore a backup I looked at a machine with a similar setup, the machine has lighttpd, mysql, and sendmail installed on it so I built the following script based on the permissions with those packages installed on a fresh install of Debian Squeeze

#!/bin/bash

echo "Setting Directory ownership" &&
chown -R root:root /var &&
chown -R man:root /var/cache/man &&
chown -R www-data:www-data /var/cache/lighttpd &&
chown -R libuuid:libuuid /var/lib/libuuid &&
chown -R smmta:smmsp /var/lib/sendmail &&
chown -R mysql:mysql /var/lib/mysql &&
chown -R www-data:www-data /var/log/lighttpd &&
chown -R mysql:adm /var/log/mysql &&
chown -R www-data:www-data /var/run/lighttpd &&
chown -R mysql:root /var/run/mysqld &&
chown -R smmsp:smmsp /var/run/sendmail/msp &&
chown -R smmta:smmsp /var/run/sendmail/mta &&
chown -R smmta:smmsp /var/spool/mqueue &&
chown -R smmsp:smmsp /var/spool/mqueue-client &&
chown -R root:staff /var/local &&
chown -R root:mail /var/mail &&
chown -R root:smmta /var/run/sendmail &&
chown -R root:smmsp /var/run/sendmail/stampdir &&
chown -R root:crontab /var/spool/cron/crontabs &&
chown -R www-data:www-data /var/www &&
echo "Setting File ownership" &&
chown root:smmsp /var/lib/sendmail/dead.letter &&
chown root:adm 
 /var/log/auth.log 
 /var/log/boot 
 /var/log/daemon.log 
 /var/log/debug 
 /var/log/dmesg* 
 /var/log/fsck/checkfs 
 /var/log/fsck/checkroot 
 /var/log/kern.log 
 /var/log/lpr.log 
 /var/log/mail.err 
 /var/log/mail.info 
 /var/log/mail.log 
 /var/log/mail.warn 
 /var/log/messages 
 /var/log/news/news.crit 
 /var/log/news/news.err 
 /var/log/news/news.notice 
 /var/log/syslog 
 /var/log/user.log &&
chown root:utmp 
 /var/log/lastlog 
 /var/log/btmp 
 /var/log/wtmp 
 /var/run/utmp &&
chown root:smmsp 
 /var/run/sendmail/mta/smsocket 
 /var/run/sendmail/stampdir/reload &&
chown -f root:smmsp /var/run/sendmail/mta/sendmail.pid &&
chown mysql:adm 
 /var/log/mysql.err 
 /var/log/musql.log &&
chown -f mysql:adm /var/run/mysqld.pid &&
echo "Done."

In addition you will need to set the ownership permissions of /var/spool/cron/crontabs/<user> and /var/mail/<user> depending on the users on the system.

Advertisements

Nutrition Information Calculator

Often food in the United Kingdom is labelled with nutrition infomation per 100g. This handy calculator allows you to calculate the values if you eat the whole lot! or a smaller portion of it for that matter.

Nutrition Information

Per 100g Per
g
serving
Energy kcal kcal
Protein g g
Carbohydrate g g
  (of which sugars) g g
Fat g g
  (of which saturates) g g
Fibre g g
Sodium g g
Update

Meddeling with Mendel

Its been nearly a year and a half since I last posted about my Reprap Mendel.  I haven’t actually made any progress building it either! This is because I got side tracked with other things including developing RapCAD
Well recently I have taken interest again and started meddling with my Mendel. The first outstanding task was to solder the voltage reg and capacitor to the motherboard. I didn’t much like the official reprap solution of powering the motherboard entirely via the usb port! so rather than add a jump wire between the comms port and the 5v track I instead used a spare track to connect a power connector at J4. This still leaves J1 J2 and J3 to be used for additional extruder’s.
The motherboard will be powered instead from my previously hacked ATX power supply which will provide 0v 5v and 12v via the XLR connections. For some reason the official reprap uses these 3 wire connectors as well but doesn’t utilise the third wire.

New Interest

I haven’t been able to work on RapCAD for a few months as I have been busy with other activities. I have however been contacted by a few people who are still interested in the project. I have even had one person willing to help out with the coding, so I would like to take the opportunity to welcome Steve Kelly aboard the dev team.

Build Server

RapCAD builds are becoming a bit tedious so I am trying to streamline the process by setting up a build server that hopefully will automagically build for Windows, Mac, and Linux. Because of this, I have not done much development on RapCAD this month just a few bug fixes.

The build server is a small mini-itx based rackmount server that stays on permanently and runs a few other daemons and cron jobs. It has quite a nice hard disk layout with the main readonly partition being on a flash drive and the /home on a large RAID array. /tmp and swap are on partitions of the disks that do not form part of the array. The server runs some VirtualBox VMs that do the build processes for the various platforms.


Version 0.6.0 is available this month. See the Download Page for details.

Revisited – make a DVD out of just about any video file.

I recently was asked to create a DVD from a .mov video file. I had already made a post about how to do this under windows using windows ports of various linux based applications. Coming back to it and this time running completely on linux, I have realised that it can be done much more simply.

The required software can be installed using

sudo apt-get install ffmpeg dvdauthor growisofs

First off the video file has to be transcoded into an dvd compatible mpeg2 file.

ffmpeg -i <video.mkv> -aspect 16:9 -target pal-dvd output.mpg

Then the file has to be authored into the correct VOB files using dvdauthor. To make sure that there are no errors in the process the following environment variable must be set.

export VIDEO_FORMAT=PAL

Rather than using an xml control file for simple DVD’s the following two dvdauthor commands will suffice.

dvdauthor -o DVD/ -t output.mpg &&
dvdauthor -o DVD/ -T

Finally the files are burned to DVD media using growisofs

growisofs -dvd-compat -Z /dev/dvd -dvd-video -V "<name>" ./DVD

RapCAD printer interface

I have been starting to think about how to integrate the controls for my Reprap Mendel into RapCAD. I was inspired by Kliments pronterface console which as well as being colorful also looks very intuitive and clutter free. So far all I have done is added a simple prototype GUI interface which can be accessed via the print button from the RapCAD main toolbar. This will allow basic integration and testing with the libreprap library.

Ideally of course I also need to finish off the remaining electronics on my Reprap Mendel so that the integration can be tested properly. So in many ways I want the features that I am developing now to motivate me to finish of my Mendel, which after an initial bout of progress has been sitting on the shelf and collecting dust for a year. The reason it has been so long is that I got distracted writing RapCAD. For some reason I thought that I would have enough time to spend on both projects, but as always I am going to have to manage my spare time more carefully.


Version 0.5.0 is available this month. See the Download Page for details.