Regexes in vi make me sad sometimes. I discovered today that when I wanted to replace all instances of:
||
with:
|
|
the correct command wasn't
:%s/\|\|/\|\n\|/g
but rather:
:%s/||/|<ctrl-v><ctrl-m>|/g
... where <ctrl-v> literally means "hit ctrl-v".
Tuesday, April 20, 2010
Monday, April 19, 2010
kakadu can't access shared library
We were consistently getting errors from Kakadu (within Djatoka) that it couldn't access a shared library file: libkdu_v60R.so. The permissions on everything were 2770. It turned out that the problem was the 2 being set on the kdu_expand and the kdu_compress. When we changed the permissions back to 770, on those two files only, everything was fine.
I've encountered problems with 2xxx permissions before, as a security feature/bug on Solaris, but never on linux.
I've encountered problems with 2xxx permissions before, as a security feature/bug on Solaris, but never on linux.
Thursday, February 25, 2010
listing physical disks on RHEL
/usr/sbin/lvmdiskscan and /sbin/pvscan, you are my new best friends.
cat /proc/cpuinfo -- we're still buddies. Don't worry.
cat /proc/cpuinfo -- we're still buddies. Don't worry.
Tuesday, February 9, 2010
meta refresh that IE can use
I'm constantly forgetting this. IE needs the "URL=" in the meta-refresh tag, else it chokes on it.
<meta http-equiv="refresh" content="0;URL=http://www.example.com" />
Also, as this Stack Overflow thread notes, IE may disable meta refresh entirely in its security settings.
For this and many other reasons, it's best to use an Apache (or whatever webserver you're using) redirect.
<meta http-equiv="refresh" content="0;URL=http://www.example.com" />
Also, as this Stack Overflow thread notes, IE may disable meta refresh entirely in its security settings.
For this and many other reasons, it's best to use an Apache (or whatever webserver you're using) redirect.
Friday, January 8, 2010
RHEL 5 - postfix suddenly can't send mail
As described in this RedHat bug, selinux-policy-2.4.6-255.el5_4.3 (1/7/2010) breaks postfix sendmail.
You'll see messages like:
fatal: username(1002): unable to execute /usr/sbin/postdrop -r: Success
postfix/sendmail[19202]: warning: premature end-of-input on /usr/sbin/postdrop -r while reading input attribute name
in /var/log/maillog.
You have a couple of options for dealing with this issue.
1. You can roll back to an earlier policy version and wait for a patched version to come out.
2. You can update the policy manually as described in the bug.
3. You can temporarily change selinux to permissive mode using "echo 0 > /selinux/enforce" until RHEL produces the patch. Then you can switch to enforcing again using "echo 1 > /selinux/enforce".
TIMTOWDI and all that, so perhaps you can think of others.
You'll see messages like:
fatal: username(1002): unable to execute /usr/sbin/postdrop -r: Success
postfix/sendmail[19202]: warning: premature end-of-input on /usr/sbin/postdrop -r while reading input attribute name
in /var/log/maillog.
You have a couple of options for dealing with this issue.
1. You can roll back to an earlier policy version and wait for a patched version to come out.
2. You can update the policy manually as described in the bug.
3. You can temporarily change selinux to permissive mode using "echo 0 > /selinux/enforce" until RHEL produces the patch. Then you can switch to enforcing again using "echo 1 > /selinux/enforce".
TIMTOWDI and all that, so perhaps you can think of others.
Wednesday, December 30, 2009
aliased ip not recognized by router
We had to manually assign an aliased ip to a failover host, call him jeeves, to replace a failed server, call him bertie. Assume bertie's ip is bbb.bbb.bbb.bbb.
(Note: to add an ip onto an interface, say eth0, use something like:
/sbin/ifconfig eth0:1 inet bbb.bbb.bbb.bbb netmask 255.255.248.0 broadcast bbb.bbb.ccc.255 up)
Previously, this had been all we'd had to do, but this time, we were only able to access the ip behind the router, not from hosts outside the local network.
The trick was to send a manual arp request to the router from jeeves, after co-opting bertie's ip:
/sbin/arping -c 2 -s bbb.bbb.bbb.bbb rrr.rrr.rrr.0
(where rrr.rrr.rrr.0 is the router ip)
Normally, this arp request goes to the router when you restart an interface, but aliasing on an ip does not necessarily cause your host to talk to the router. So you may need to do it manually.
(Note: to add an ip onto an interface, say eth0, use something like:
/sbin/ifconfig eth0:1 inet bbb.bbb.bbb.bbb netmask 255.255.248.0 broadcast bbb.bbb.ccc.255 up)
Previously, this had been all we'd had to do, but this time, we were only able to access the ip behind the router, not from hosts outside the local network.
The trick was to send a manual arp request to the router from jeeves, after co-opting bertie's ip:
/sbin/arping -c 2 -s bbb.bbb.bbb.bbb rrr.rrr.rrr.0
(where rrr.rrr.rrr.0 is the router ip)
Normally, this arp request goes to the router when you restart an interface, but aliasing on an ip does not necessarily cause your host to talk to the router. So you may need to do it manually.
Tuesday, December 29, 2009
can't install mtr in Leopard
I was unable to compile mtr in OS X Leopard, getting these errors on make:
dns.c:242: error: ‘PACKETSZ’ undeclared here (not in a function)
dns.c: In function ‘statmalloc’:
dns.c:318: warning: format ‘%u’ expects type ‘unsigned int’, but argument 3 has type ‘size_t’
dns.c: In function ‘dorequest’:
dns.c:756: error: ‘QUERY’ undeclared (first use in this function)
dns.c:756: error: (Each undeclared identifier is reported only once
dns.c:756: error: for each function it appears in.)
dns.c:756: error: ‘C_IN’ undeclared (first use in this function)
dns.c: In function ‘resendrequest’:
dns.c:769: error: ‘T_A’ undeclared (first use in this function)
dns.c:776: error: ‘T_PTR’ undeclared (first use in this function)
dns.c: In function ‘parserespacket’:
dns.c:866: error: ‘NOERROR’ undeclared (first use in this function)
dns.c:893: error: ‘MAXDNAME’ undeclared (first use in this function)
dns.c:918: error: ‘C_IN’ undeclared (first use in this function)
dns.c:925: error: ‘T_PTR’ undeclared (first use in this function)
dns.c:992: error: ‘T_A’ undeclared (first use in this function)
dns.c:1063: error: ‘NXDOMAIN’ undeclared (first use in this function)
dns.c: In function ‘dns_events’:
dns.c:1129: error: ‘T_PTR’ undeclared (first use in this function)
dns.c: In function ‘dns_lookup2’:
dns.c:1188: error: ‘T_PTR’ undeclared (first use in this function)
make[2]: *** [dns.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2
... the solution was to add "-lresolv" to the LIBS line:
LIBS = -lm -ltermcap -lresolv
inspired by the same issue with php 5.3.0
dns.c:242: error: ‘PACKETSZ’ undeclared here (not in a function)
dns.c: In function ‘statmalloc’:
dns.c:318: warning: format ‘%u’ expects type ‘unsigned int’, but argument 3 has type ‘size_t’
dns.c: In function ‘dorequest’:
dns.c:756: error: ‘QUERY’ undeclared (first use in this function)
dns.c:756: error: (Each undeclared identifier is reported only once
dns.c:756: error: for each function it appears in.)
dns.c:756: error: ‘C_IN’ undeclared (first use in this function)
dns.c: In function ‘resendrequest’:
dns.c:769: error: ‘T_A’ undeclared (first use in this function)
dns.c:776: error: ‘T_PTR’ undeclared (first use in this function)
dns.c: In function ‘parserespacket’:
dns.c:866: error: ‘NOERROR’ undeclared (first use in this function)
dns.c:893: error: ‘MAXDNAME’ undeclared (first use in this function)
dns.c:918: error: ‘C_IN’ undeclared (first use in this function)
dns.c:925: error: ‘T_PTR’ undeclared (first use in this function)
dns.c:992: error: ‘T_A’ undeclared (first use in this function)
dns.c:1063: error: ‘NXDOMAIN’ undeclared (first use in this function)
dns.c: In function ‘dns_events’:
dns.c:1129: error: ‘T_PTR’ undeclared (first use in this function)
dns.c: In function ‘dns_lookup2’:
dns.c:1188: error: ‘T_PTR’ undeclared (first use in this function)
make[2]: *** [dns.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2
... the solution was to add "-lresolv" to the LIBS line:
LIBS = -lm -ltermcap -lresolv
inspired by the same issue with php 5.3.0
Subscribe to:
Posts (Atom)