cas
  • Member for 12 years, 5 months
  • Last seen this week
  • Melbourne, Victoria, Australia
5 answers
votes
35k views
What's the best way to automate backing-up of PostgreSQL databases?
Accepted answer
50 votes

the same as you do for any other repetitive task that can be automated - you write a script to do the backup, and then set up a cron job to run it. a script like the following, for instance: (Note: ...

View answer
4 answers
votes
57k views
How to escape ! in password?
Accepted answer
43 votes

Use single quotes around the password like this: -p'one_@&!two' To put it in an alias, you'd do something like: alias runmysql='mysql -umyuser -p'\''one_@&!two'\'''

View answer
6 answers
votes
5k views
Avoid to keep command in history
Accepted answer
40 votes

and i just remembered another answer, this one is the actual answer to your question. if you have "ignorespace" in HISTCONTROL, then bash wont remember any line beginning with a space character. it ...

View answer
5 answers
votes
106k views
How do I make ssh fail rather than prompt for a password if the public-key authentication fails?
39 votes

To disable password authentication for the current ssh connection attempt, pass this option on the command line: -o PasswordAuthentication=no To disable password authentication for all future ...

View answer
3 answers
votes
64k views
How do I tell if grub is installed on a device?
Accepted answer
27 votes

This is a simple way to tell if GRUB is installed. If it doesn't work your file command's database is likely out of date and you can either update the its database or use an alternate method from ...

View answer
8 answers
votes
16k views
Is there a smarter tar or cpio out there for efficiently retrieving a file stored in the archive?
Accepted answer
20 votes

tar (and cpio and afio and pax and similar programs) are stream-oriented formats - they are intended to be streamed direct to a tape or piped into another process. while, in theory, it would be ...

View answer
2 answers
votes
26k views
Permission denied: /home/.htaccess pcfg_openfile: unable to check htaccess file
Accepted answer
19 votes

you've probably changed the permissions on the directory (or one of its parents) that the web server is looking for .htaccess in, so that the web server can no longer check to see if there's a ....

View answer
4 answers
votes
10k views
How do I get ec2 Linux instance info while logged-in on the command-line (public dns, AMI, etc.)
Accepted answer
18 votes

I'm assuming you want to do this from the bash shell rather than with the boto python library or similar... You should be able to query the metadata service on 169.254.169.254. e.g. AMI_ID=$(curl ...

View answer
2 answers
votes
13k views
debian: FATAL -> Failed to fork
Accepted answer
16 votes

that error message generally means aptitude or apt-get ran out of memory. some suggestions: if it's a VM, try increasing the RAM allocated to it. if it's a physical machine, try upgrading RAM. if ...

View answer
3 answers
votes
30k views
How to setup samba share to be mounted as specific user?
Accepted answer
16 votes

ok, i've re-read your question and have another answer. when you mount it in /etc/fstab or with sudo mount from the command line, you need to set the uid and gid and optionally the umask too (...

View answer
1 answers
votes
3k views
MX Backup service
Accepted answer
16 votes

it used to be the case that having a backup MX was a Good Thing. the internet was unreliable, email was unreliable, smtp was not so common, bang-path addressing and other forms of manually-specified ...

View answer
4 answers
votes
35k views
Drawbacks of mounting a filesystem with noatime?
12 votes

the main disadvantage that hasn't been mentioned yet is that if you have a tmpreaper process (i.e. a program that deletes files in /tmp that haven't been accessed for a while), it could delete tmp ...

View answer
4 answers
votes
9k views
Can you change the partition type on a linux server without starting up fdisk?
Accepted answer
12 votes

or you could use sfdisk, it's also designed to be scriptable. e.g. to change partition 1 of /dev/sda to type 0xfd (linux raid): sfdisk --id /dev/sda 1 fd you can also dump out an existing ...

View answer
1 answers
votes
2k views
Why I can't edit the file though I have permissions to do it?
Accepted answer
11 votes

How recently were you (lexsys) added to the devel group? If you were added after your current login session, then you need to log out and then log back in again. Is the filesystem that contains view....

View answer
4 answers
votes
2k views
How visible is my /var/www to the outside world?
Accepted answer
11 votes

To directly answer your questions - you can either keep such files somewhere else or you can configure apache to deny access to them - denying access to *.bak is relatively simple. Apache will, ...

View answer
4 answers
votes
5k views
Debian - What to do when upgrading packages and a config file has changes?
Accepted answer
10 votes

that seems like a reasonable way of doing it. similar to what i've been doing for about 15 years (been using debian since 1994). it's always worked for me :) i start with the basic assumption that ...

View answer
6 answers
votes
5k views
Avoid to keep command in history
8 votes

If you just want to remove the last command from the history, then you can hit Up-arrow, followed by Ctrl - U (erase to beginning of line), then Up-arrow again. You can erase any individual line from ...

View answer
7 answers
votes
14k views
ZFS alternative for Linux?
8 votes

There's a native kernel implementation of ZFS available for linux now, being developed by LLNL. There are packages for ubuntu available in a PPA, which are easily compiled on debian (just add the deb-...

View answer
5 answers
votes
294k views
How to send jobs to background without stopping them?
8 votes

you can also start a program as a background job with an "&" on the command line. e.g. myprogram & note that output (both stdout and stderr) will still go to the current tty, so it's generally ...

View answer
27 answers
votes
4k views
What's The Worst Server Configuration/Setup That You Have Ever 'Inherited'
8 votes

about 12 years ago i started work as sysadmin at a medium-sized ISP, with about 30 staff working there. they'd never really had a real sysadmin before, just some people who thought they knew what ...

View answer
2 answers
votes
10k views
fsck root filesystem on a remote machine
7 votes

it's also a good idea on debian and debian-derivatives like ubuntu to edit /etc/default/rcS on remote servers and set "FSCKFIX=yes" that adds "-y" to the boot time fsck, so it doesn't risk the remote ...

View answer
18 answers
votes
248k views
What's the best way to check if a volume is mounted in a Bash script?
7 votes

the following is what i use in one of my rsync backup cron-jobs. it checks to see if /backup is mounted, and tries to mount it if it isn't (it may fail because the drive is in a hot-swap bay and may ...

View answer
5 answers
votes
510 views
Usage ideas for a cluster at a university
Accepted answer
7 votes

you could install debian plus the various debian-science packages on these machines. that includes quite a large collection of free software programs for several common computation problems in ...

View answer
3 answers
votes
30k views
How to setup samba share to be mounted as specific user?
6 votes

the mount command is on the client side and doesn't control what the server allows. you need to set up the share on the server so that anyone in a particular group ("valid users = groupname") can ...

View answer
12 answers
votes
2k views
Optimum way to serve 70,000 static files (jpg)?
6 votes

it really depends on the file system you're using to store the files. some filesystems (like ext2 and to a lesser extent ext3) are hideously slow when you have thousands of files in one directory, so ...

View answer
3 answers
votes
11k views
ZFS on enterprise RAID pass-through, and ZFS on FreeBSD root
Accepted answer
5 votes

You can control the PERC H730 and H330 using the LSI MegaCLI utility as both of these cards are Dell PERC badged LSI cards. There is an excellent article and tutorial on how to do this at https://...

View answer
1 answers
votes
5k views
Unattended grub-pc update
Accepted answer
5 votes

you can pre-load debconf answer with 'debconf-set-selections' first, install debconf-utils on a host that already has grub-pc installed. then run: debconf-get-selections | grep grub-pc > /tmp/...

View answer
3 answers
votes
257 views
Understanding "top" users
5 votes

nobody so far has answered your question about the "nobody" user....here goes: when top lists the username 'nobody', it has NOTHING at all to do with which user is logged in to your web site. top ...

View answer
1 answers
votes
2k views
Immediate logout after login with PAM, Kerberos, and LDAP
4 votes

Some questions to think about: Does the user have a valid shell (that isn't /bin/false or similar)? Is the user's UID >= 1000 (required by your pam_krb5.so config)? Is the uid the same on the NFS ...

View answer
3 answers
votes
14k views
Postfix : Only receive emails from specific domains?
4 votes

phil's answer is good except for one detail. don't use "OK" on the RHS of /etc/postfix/access or /etc/postfix/client_access. that makes your mail server a partial open relay for anyone claiming to ...

View answer
1
2 3 4 5