Tech & Toys
-
FreeBSD ports WITHOUT_X11
I never remember the syntax for this, should you need to build a port without X11 support do this:
# make WITHOUT_X11=yes
-
Apache Directory permissions
I just got caught out with apache directory permissions while installing gallery for a virtual host. I previously had all the virtual hosts using the same strict directory permissions shown below:
<Directory /sites/<domain>/www/htdocs> AllowOverride AuthConfig </Directory>
This will generate 2 errors in the virtual host error log, the first of which is a php error:
[alert] /sites/<domain>/www/htdocs/gallery/setup/.htaccess: php_value not allowed here
This can be fixed by adding the
Options
option to theAllowOverride
statement, the second error:[alert] /sites/<domain>/www/htdocs/gallery/setup/.htaccess: RewriteEngine not allowed here
can be fixed by adding the
FileInfo
option. So the final directory block should look like this:<Directory /sites/<domain>/www/htdocs> AllowOverride AuthConfig Options FileInfo </Directory>
-
New OS category
Will mainly be a parent for the other OS categories beneath it…
-
SuSE sudo weirdness
On SuSE 9.2 we have noticed that sudo didnt seem to work out of the box. Have tracked this to SuSE changing a default from the way it is shipped in the sudo package, from the man sudoers(5) man page:
targetpw If set, sudo will prompt for the password the user specified by the -u flag (defaults to root) instead of the password of the invoking user. This flag is off by default.
If you comment out the following line sudo will ask for the password of the current user NOT the user they are trying to run the command as:
Defaults targetpw
-
SuSE 9.1 ifconfig weirdness
Have just found out that
ifconfig
on SuSE 9.2 doesnt seem to show virtual intefaces:message2:~ # ifconfig eth0 Link encap:Ethernet HWaddr 00:80:3F:2B:7B:60 inet addr:192.168.0.200 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::280:3fff:fe2b:7b60/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:40203054 errors:0 dropped:0 overruns:0 frame:0 TX packets:4386872 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2879540080 (2746.1 Mb) TX bytes:321973799 (307.0 Mb) Base address:0x2000 Memory:dd200000-dd220000 eth1 Link encap:Ethernet HWaddr 00:80:3F:2B:7B:61 inet addr:XXX.XXX.XXx.XXX Bcast:XXX.XXX.XXx.XXX Mask:255.255.255.224 inet6 addr: fe80::280:3fff:fe2b:7b61/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:66946630 errors:0 dropped:0 overruns:0 frame:0 TX packets:43575297 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4317777 (4.1 Mb) TX bytes:4011082191 (3825.2 Mb) Base address:0x2040 Memory:dd220000-dd240000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1692 errors:0 dropped:0 overruns:0 frame:0 TX packets:1692 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:113193 (110.5 Kb) TX bytes:113193 (110.5 Kb) message2:~ #
However if you use the
ip
command from the iproute2 package it shows that in facteth1
does have some aliases:message2:~ # ip addr 1: lo: mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 brd 127.255.255.255 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: sit0: mtu 1480 qdisc noqueue link/sit 0.0.0.0 brd 0.0.0.0 3: eth0: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:80:3f:2b:7b:60 brd ff:ff:ff:ff:ff:ff inet 192.168.0.200/24 brd 192.168.0.255 scope global eth0 inet6 fe80::280:3fff:fe2b:7b60/64 scope link valid_lft forever preferred_lft forever 4: eth1: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:80:3f:2b:7b:61 brd ff:ff:ff:ff:ff:ff inet XXX.XXX.XXx.XXX/YY brd XXX.XXX.XXx.XXX scope global eth1 inet XXX.XXX.XXx.XXX/YY brd XXX.XXX.XXx.XXX scope global secondary eth1 inet6 fe80::280:3fff:fe2b:7b61/64 scope link valid_lft forever preferred_lft forever message2:~ #
How weird is that. Versions shown below:
message2:~ # cat /etc/SuSE-release SuSE Linux 9.1 (i586) VERSION = 9.1 message2:~ # ifconfig -V net-tools 1.60 ifconfig 1.42 (2001-04-13) message2:~ #
**NB:**IP addresses changed to protect the innocent…
-
backspace not working in xterms
Add the following to
/etc/X11/Xresources
and restart X / [gkx]dmxterm*VT100.Translations: #override BackSpace: string(0x7F)n Delete: string(" Home: string(" End: string(" *ttyModes: erase ^?
Tested on RHEL3.
Thanks to Justin for this
-
Moving the /Users directory
Recently I needed to move the /Users tree onto another partition on a OS X machine at work, I found this great howto.
-
Mapping Between Logical and Physical Device Names on a Sun E450
If you need to find the slot that a disk is in from a given logical name (
c3t3d0
) you can follow this (Broken linkhttp://sunsolve.sun.com/search/document.do?assetkey=1-9-16735-1&searchclause=16735) document from sun. I’ve mirrored the important bits below incase it disapears- Determine the UNIX physical device name from the SCSI error message.
SCSI error messages are typically displayed in the system console and logged in the /usr/adm/messages file. ```
WARNING: /pci@6,4000/scsi@4,1/sd@3,0 (sd228) Error for Command: read(10) Error level: Retryable Requested Block: 3991014 Error Block: 3991269 Vendor: FUJITSU Serial Number: 9606005441 Sense Key: Media Error ASC: 0x11 (unrecovered read error), ASCQ: 0x0, FRU: 0x0
In the example SCSI error message above, the UNIX physical device name is `/pci@6,4000/scsi@4,1/sd@3`. * Determine the UNIX logical device name by listing the contents of the `/dev/rdsk` directory. Use the grep command to filter the output for any occurrence of the UNIX physical device name determined in Step 1: ``` % ls -l /dev/rdsk | grep /pci@6,4000/scsi@4,1/sd@3 lrwxrwxrwx 1 root root 45 Jan 30 09:07 c12t3d0s0 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:a,raw lrwxrwxrwx 1 root root 45 Jan 30 09:07 c12t3d0s1 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:b,raw lrwxrwxrwx 1 root root 45 Jan 30 09:07 c12t3d0s2 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:c,raw lrwxrwxrwx1 root root 45 Jan 30 09:07 c12t3d0s3 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:d,raw lrwxrwxrwx 1 root root 45 Jan 30 09:07 c12t3d0s4 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:e,raw lrwxrwxrwx 1 root root 45 Jan 30 09:07 c12t3d0s5 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:f,raw lrwxrwxrwx 1 root root 45 Jan 30 09:07 c12t3d0s6 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:g,raw lrwxrwxrwx 1 root root 45 Jan 30 09:07 c12t3d0s7 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:h,raw
The resulting output indicates the associated UNIX logical device name. In this example, the logical device name is `c12t3d0` * Determine the disk slot number using the `prtconf` command. Substitute the string disk@ for sd@ in the physical device name determined in Step 1. The result in this example is `/pci@6,4000/scsi@4,1/disk@3`. Use the grep command to find this name in the output of the prtconf command: ```
% prtconf -vp | grep /pci@6,4000/scsi@4,1/disk@3 slot#11: ‘/pci@6,4000/scsi@4,1/disk@3’
-
Daemontools run scripts collection
Found this nice collection of daemontools run scripts. Will find that useful someday
-
Partitioning >1Tb volumes
If you need to create partitions on a disk (or raid volume) which is larger than 1Tb you will need to use parted and set the disk label to
GPT
. This is an example session creating 2 1Tb partitions on a 2Tb raid5 volume:[root@sn-b03 parted]# parted /dev/sdb GNU Parted 1.6.9 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This program is free software, covered by the GNU General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Using /dev/sdb Information: The operating system thinks the geometry on /dev/sdb is 291775/255/63. Therefore, cylinder 1024 ends at 8032.499M. (parted) mklabel gpt (parted) mkpart primary 0 1048576 (parted) mkpart primary 1048577 2097152 (parted) p Disk geometry for /dev/sdb: 0.000-2288754.000 megabytes Disk label type: gpt Minor Start End Filesystem Name Flags 1 0.017 -1048576.000 ext3 2 -1048575.000 0.000 (parted) quit Information: Don't forget to update /etc/fstab, if necessary. [root@sn-b03 parted]#