6,382 reputation
918
bio website taz.net.au/blog
location Australia
age 47
visits member for 3 years, 5 months
seen Dec 17 '13 at 2:57

Craig Sanders

http://taz.net.au/~cas/


Oct
5
comment How to use awk or sed to convert csv diffs into more readable format
you say that the real-life file would have a large number of columns...which implies that there could be differences in the values of any or all of those columns, so a simple three-column output format will not be sufficient.
Oct
5
comment How to write a Shell Script using the condition from a database
assuming that $1 actually contains a valid pg dbname, that should work (but it's good practice to quote all variables including positional parameters - i.e. use "$1" rather than just $1). Also, if you're using a ~/.pgaccess file as I suggested, you won't need -U postgres.
Oct
5
comment What is the difference in these two bash environments?
see unix.stackexchange.com/questions/29608/… and take note of what it says about passing arguments to the interpreter. IMO using /usr/bin/env like this is an abuse of the env program perpetrated mostly by the python community because they can't manage interpreter and library versioning properly.
Oct
5
comment run x and getty on the same virtual console?
I used to use mrxvt until about a year ago because it was many times faster than any of the libvte based terminals (gnome-terminal, roxterm, etc). I gave it up because of lack of unicode support and switched to roxterm (IMO, the least bad of the libvte terms).
Oct
5
comment Resize an extended partition to the whole drive
or since queueoverflow mentioned ubuntu, just run apt-get install gparted and then sudo gparted
Oct
5
comment Resize an extended partition to the whole drive
It can be difficult to find a free download of Parted Magic - the only download link on that site is behind a $5 paypal "donation". I have found Parted Magic on various bit-torrent sites, but I'd recommend the GParted Live CD instead gparted.sourceforge.net/livecd.php
Oct
4
comment Rename multiple files, sub directories, and insert characters at specific location on OSX
typo in finddetph - should be finddepth?
Oct
4
comment Why do *nix filesystems support file names with newlines?
Ctrl-O can mess up your tty, and Ctrl-G can make you want to strangle someone. IMO all control characters are problematic.
Oct
4
comment My Debian freezes
can you post the output of lspci | grep VGA | cut -d' ' -f1 | xargs -n1 lspci -v -s. That will tell us what video card(s) and driver(s) you have.
Oct
4
comment Monitor does not switch off
cool, nice to see that my suggestion worked. thanks for coming back and letting us know the result.
Oct
4
comment Can I label a disk device rather than a partition?
no problem, as you said it didn't directly answer the question. but it was useful and hopefully someone else will find it useful in future. btw, here's an improved version of the alias: alias list_disks='find /dev/disk/by-id/ -iname scsi-* -o -iname usb-* | grep -v -- -part | while read disk ; do echo $(basename $(readlink $disk)) $(basename $disk); done | sed -re "s/(usb|scsi)-// ; s/(SATA|Generic)_//" | sort'. it finds usb disks as well and gets rid of extraneous data in the output.
Oct
4
comment Why do *nix filesystems support file names with newlines?
Yes, i understand WHY newlines are legitimate characters in a filename. I just don't think that there's any good reason for them to be allowed, and certainly no good reason to use them. It's possible to login as root to run X and all the usual user GUI apps, but it's a bad idea to do that. same with newlines in filenames - legit but stupid.
Oct
4
comment Why do *nix filesystems support file names with newlines?
worse, an extremely common file format (i.e. "one filename/item per line, separated by newlines") is made unreliable by the presence of newlines in filenames. There's not even a reliable way to convert that format to NUL-separated. All you can do is hope/assume that your users are relatively sane and haven't used \n in their filenames.
Oct
4
comment Why do *nix filesystems support file names with newlines?
There's no good reason to allow newlines in filenames, but unfortunately we're stuck with them..too late to change now. And the Robustness Principle is subverted because the presence of \n in filenames leads to more fragile scripts as most shell programmers even find dealing with spaces in filenames to be difficult and most of the reset only know about find ... -print0 and xargs -0 (and don't realise, e.g., you can tell bash's built-in read to use NUL as a delimiter with -d $'\0', or that many GNU tools have -0, -z or -Z options for handling NUL-terminated stdin)
Oct
4
comment Getting terminal access on old, strange hardware
have you tried searching the filesystem for xterm or terminal or similar?
Oct
4
comment Optimized way to list and delete files
Oliver means run it once with ... -exec echo rm {} + and if it looks like it's going to do what you want/expect, run it for real with ... -exec rm {} +. i.e. a dry-run first. can do the same thing with xargs easily enough, too, with xargs echo rm and xargs rm.
Oct
4
comment What does this command-line do?
One other difference worth noting is that redirecting ps ax to a file is effectively taking a snapshot of the process table as it was at that moment in time - every time you search that file with grep it will search the same data. By contrast, ps ax | grep barrymp will always search the current process table, which will be different every time you run it.
Oct
4
comment Piped Logs in Apache?
why not just modify your web app so that it doesn't log sensitive information, and doesn't include such info in the URLs? i.e. fix the problem at the source rather than patch over it later. if your devs need extra debugging info then that should be enabled on test and dev servers, but disabled on production servers.
Oct
4
comment How do add GNU findutils into an existing location
sunfreeware.com died (or went paid subscription only) several years ago, but you can still find pre-packaged GNU software for Solaris at opencsw.org
Oct
4
comment dual boot windows XP/debian, I can't boot windows
just looking at that fdisk output hurts my brain. IMO your partition table is so messed up that you should backup your data, re-partition the disk and re-install everything from scratch. install windows xp first into a primary partition. then install linux and grub.