Here's a simple script that can be used in a cron job on Linux/Unix server.
mysqldump -u [mysqluser] -p [mysqlpass] --all-databases | gzip -9 > `date +%y-%m-%d_%H%M`export.gz
This kind of command is obvious to anyone who's used Linux with any frequency, but can be cryptic to a newbie.
Here are some notes, in case you are interested:
I have recently installed Plogger, an open-source, php app that creates an image gallery. I am looking for software very close to what this one offers, but find this one a little lacking. I think I may submit some patches, however, because overall, the product is pretty good.
Here's what I wish it had
Awesome features
Here's a list of my favorite Unix tools from the Free Software Foundation.
Here are some Gnu Linux/Unix commands that I run so often, I've pulled them into some simple shell scripts.
Search and Destroy
This script will kill any processes that match the argued parameter
#!/bin/sh
if [ $# -lt 1 ]; then
echo 1>&2 Usage: $0 [search string]
echo 1>&2 Search and Destroy will take a command argument
echo 1>&2 and kill all processes that
echo 1>&2 match the search string in a 'ps -aef' command
echo 1>&2 example: $0 httpd - kills all apache processes
exit 1
fi
ps -aef | grep $1 | grep -v grep | awk '{print $2}' | xargs kill -9
Fake CVS Update
Find out what would be performed by a cvs update
Optionally takes an arguement to allow you to pass other cvs Flags (like -A for sticky tags)
#!/usr/bin/sh
cvs -n update $1 2>&1 | grep -v ^cvs
Escape to Paradise
Will convert any input from x to "x"
#!/bin/sh
sed -e 's:\(.*\):"\1":g'
I'm so excited! I was able to get my Apache web server instances to use Microsoft's Active Directory as an LDAP server for authentication and role definitions. It was surprisingly easy. Here's how I did it for both 1.3 and 2.x series Apache servers. Incidentally, I'm using Debian Linux, so I'm not going to go through the details on building those modules.
Apache 1.3
Install the mod_ldap and auth_ldap modules into your Apache server. On Debian, this was as easy as this..
I checked for the necessary modules using APT
> apt-cache search --names-only ldap | grep apache
libapache-auth-ldap - LDAP authentication module for Apache
libapache-mod-ldap - Apache authentication via LDAP directory
...
Install the necessary modules
> apt-get install libapache_mod_auth_ldap
> apt-get install libapache_mod_ldap
Modify the http.conf or module.conf files to include the modules
LoadModule ldap_module /usr/lib/apache/1.3/mod_ldap.so
LoadModule auth_ldap_module /usr/lib/apache/1.3/auth_ldap.so
Configure your LDAP bindings for the user and the groups (see here for a discussion on configuring mod_auth_ldap)
<directory "/">
...
AuthType Basic
AuthName "Active Directory Login"
AuthLDAPEnabled On
AuthLDAPURL ldap://[servername]:389/dc=xxxxxx,dc=com?sAMAccountName
AuthLDAPBindDN "cn=[ad user name],ou=[organizational units]...,dc=xxxxxx,dc=com"
AuthLDAPBindPassword "[your password here]"
require valid-user
require group "ou=[required groups]"
...
</directory>
Apache 2.x
Apache2 is much the same as Apache 1.3, only one is able to take advantage of the easier server layout. I'll only include notes on changes from the 1.3 install above.
With Apache2, you will simply need to sym-link the modules to load in the mods-enabled from the mods available. I ended up with
/etc/apache2$ ls -al mods-enabled/
lrwxrwxrwx 1 xxxx yyyy 42 Nov 30 15:55 auth_ldap.load -> ...
lrwxrwxrwx 1 xxxx yyyy 41 Nov 29 09:58 auth_pam.load -> ...
lrwxrwxrwx 1 xxxx yyyy 36 Nov 21 15:40 cgi.load -> ...
lrwxrwxrwx 1 xxxx yyyy 37 Nov 21 15:40 php5.conf -> ...
lrwxrwxrwx 1 xxxx yyyy 37 Nov 21 15:40 php5.load -> ...
At the end, I had LDAP authentication against my Active Directory server!
:: Next Page >>
A weblog focusing on software development, computer science, mathematics, music, and probably lacking focus.
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| << < | > >> | |||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | ||