4,474 reputation
1724
bio website BlackMesh.com
location
age
visits member for 4 years, 6 months
seen Dec 3 at 20:52

Director of Emerging Technology at BlackMesh Managed Hosting, longtime Linux aficionado, sometime Drupal developer (and d.o sysadmin), and occasional filesystem tinkerer.


Jun
15
comment CentOS - PHP - Yum Install with Custom ./configure params
--target is typically not necessary unless you're cross-compiling, but check your spec file for other requirements. For example, for building a CentOS 6 kernel, you'll typically want --with-firmware and -D 'dist el6' -D 'rhel 6'.
May
16
comment Redirect to SSL only if browser supports SNI
This will throw a name/cert mismatch error; they will only be downgraded back to HTTP (assuming you've set up an appropriate redirect) after accepting the mismatched cert. Further, you can't auto-upgrade them to HTTPS without some sort of state maintenance, or they'll jump right back into the SSL VHost again.
May
7
comment Why is this tee losing stdout?
Since the evolution of my answer can be confusing to read: I've updated my answer with the final analysis of why this failed in the first place.
May
4
comment Correct recursive chmod, separate for files & dirs
@Safado: find . type d -print0 | xargs -0 chmod 0755 and find . -type f -print0 | xargs -0 chmod 0664.
May
4
comment Correct recursive chmod, separate for files & dirs
@Iain: I recently discovered this behavior, but I'm not insignificantly baffled by it, and I'm pretty sure find hasn't always worked this way. Thus, my "depending on your version" disclaimer.
May
4
comment Correct recursive chmod, separate for files & dirs
If you're doing this so frequently that you can't be subjected to the numbing repetition of the few extra characters of a simple find, it begs the question: why not fix the permissions via umask (or some program-specific option) so that they're correct in the first place?
May
4
comment Correct recursive chmod, separate for files & dirs
Dangerous with files whose names contain certain reserved characters (like spaces, depending on your version of find). Consider -print0 and xargs -0.
Mar
27
comment Two SSL certs for a domain in DirectAdmin
@sonassi: You can likely ask Verisign to provide a replacement certificate that covers both (I've asked this of GeoTrust in the past when I've accidentally submitted in a way that didn't result in a SAN being attached for both name variations). Otherwise, switch to a cheaper cert that includes SANs; most CAs offer a competitive-replacement program for low, no, or sometimes negative cost (i.e., they give you a rebate).
Mar
27
comment Two SSL certs for a domain in DirectAdmin
A certificate with a SAN specifically avoids the SNI requirement. SNI is only required when you have two different certificates from which to choose.
Mar
19
comment Two SSL certs for a domain in DirectAdmin
@sonassi: I've yet to have a client willing to accept SNI's limitations. Give it another five years (sadly, that's literal—*another* five years) and it'll hit effectively 100% of clients, at which point the argument may change. Even then, personally, the information-disclosure MitM potential of SNI creeps me out.
Mar
16
comment Two SSL certs for a domain in DirectAdmin
A given (IP address,port) tuple can only have a single SSL certificate associated with it. So you'll need to have a second IP address available to you to be able to run both certs.
Mar
16
comment PHP on command line displays “Out of Memory”, no file name, line number or memory value
Please run: which php, rpm -qf $(which php), and rpm -qf $(which php) --verify .
Mar
15
comment Download file through SSH
@DanielPittman Absolutely. In this case, though, lzop might have some advantages over the built-in gzip capability for certain types of connections, so something like ssh backup-server 'cat somefile | lzop' | lzop -d - > somefile might be very useful. For bonus points, work pv into it somewhere. Similarly, for very small connections with beefy boxen at either end, I've been known to pipe through bzip2/bzcat.
Mar
15
comment Why is this tee losing stdout?
-fF is the same as -f -F. The -F is actually unneeded on most of the systems I work on, but it (tries to) follow vforks on older versions of strace, and has no effect on newer ones, but it doesn't hurt. -ff ends up writing a bunch of files (one per PID) that you then have to collate back into a sensible timeline, so I avoid it in the vast majority of situations. That said, -ff should work, but the output files will be oddly-named.
Mar
14
comment Why is this tee losing stdout?
On the strace front, try strace -fF. Works like a champ for me.
Mar
14
comment Why is this tee losing stdout?
It also happens with the order reversed (that is, with the cat>tar inside the >()). Neat. Adding the -i flag to tee (on a blind hunch) didn't help.
Mar
14
comment Why is this tee losing stdout?
I can get the problem to reliably recur with dd if=/dev/urandom bs=1M count=20 | tee >(md5sum - | ssh user@host 'cat - > /tmp/foo.md5') | ssh user@host 'cat > /tmp/foo.tar'. Working on debugging why now.
Mar
14
comment Why is this tee losing stdout?
Changed; please try again. Yes, I know that doesn't do exactly what you want, but I just want to try it. Please be sure you're running it the same way (i.e., as a script, not directly on the command line).
Feb
26
comment Organizing .conf apache configuration per domain
On RHEL/CentOS at least, this is the RedHat-endorsed approach. In fact, doing things this way, it's exceedingly rare you'll ever have to edit httpd.conf, which is the whole point: you can do version upgrades and modify the server's mode of operation extensively by doing simple, naïve file manipulation à la that done by RPMs. The sites-available/sites-enabled approach is just another way to achieve the same goal.
Feb
2
comment In what condition, should I create a system user instead of a normal user?
Probably not terribly often, no. But if you were compiling the software from scratch yourself, it's easy to imagine a need as part of make install. Since there's not a tradition in *NIX of hiding the options used by scripts like the one run by make install from users (even in situations where it's rare for a user to want to use such an option, like mysql's -B flag), the option is available for you to use interactively on the off chance you'd ever need it.