GNU-Linux
Apache access control the Agaric way
Clients don't like their test site competing with their live, production site for Google results. Therefore, we have put our entire set of test sites behind a pop-up requiring basic Apache authentication.
For ongoing maintenance — adding new people to access the test environment behind the authorization wall — the operative command is:
Roughly following the instructions here:
http://httpd.apache.org/docs/2.2/howto/auth.html
sudo mkdir /etc/apache2/passwd
sudo htpasswd -c /etc/apache2/passwd/passwords dan
New password:
Re-type new password:
Adding password for user dan
sudo htpasswd /etc/apache2/passwd/passwords benjamin
New password:
Re-type new password:
Adding password for user benjamin
With XAMPP, permission denied for MySQL user with % (all) host access but works for localhost
For reasons not known to man nor beast, on XAMPP on Mac OS X (and not XAMP but another all in one WAMP stack, but not that name either) will not work with the wildcard availability host name (%). It will work (or anyhow may work for you, it worked for Agaric!) with the @localhost for host name.
In a shell script, create a database if it does not exist
Use the MySQL: SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database_name'
<?php
if (mysql_num_rows(mysql_query("SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '". $dbname ."'"))) {
echo "Database $dbname already exists.";
}
else {
// go on and create the user, database, etc.
// create the user
Update or commit: See what's changed in a version-controlled file with svn diff
When you run
sudo svn status -u
and see
M 6549 www/.htaccess
you can see exactly what's up with those changes with
svn diff www/.htaccess
Showing something like:
Index: www/.htaccess
===================================================================
--- www/.htaccess (revision 6549)
RSA host key changed, requires validation: what to do
RSA host key for example.com has changed and you have requested strict checking.
Host key verification failed.
In the line above it will actually tell you where the bad key is, with known_hosts being the file and 2 being the position of the problem key:
Offending key in /home/you/.ssh/known_hosts:2
Getting out of the local permissions / server login catch 22
The first step to getting out of the local permissions / server login catch-22 is to know you're in it.
Perhaps you found this page searching for "Permission denied on publickey even though I can log into the server with a public key it doesn't make any sense grrr argh how dare it deny me i created it why won't it work permissions are correct this isn't right" or something like that.
Piston not found after installation, setting bash paths
http://neoarch.wordpress.com/2007/07/13/bash-cap-command-not-found/
vi ~/.bashrc
#Set path for Piston
export PATH=$PATH:/var/lib/gems/1.8/bin
source ~/.bashrc
server:~$ sudo vi /root/.bashrc
server:~$ source /root/.bashrc
/var/lib/gems/1.8/bin
restart bash
ben@server:~$ sudo /bin/bash --login
root@server:~# piston -h
Usage: piston [options]
How to change your mysql root password using command line
So you wanna change your root password for mysql, huh?
Follow these instructions and know in your heart that you did it, the Agaric Way....
MySQL stores username and passwords in user table inside MySQL database.
You can directly update password using the following method to update or change password for user root:
1) Login to mysql server, type following command at shell prompt:
$ mysql -u root -p
2) Use mysql database (type command at mysql> prompt):
Get Linux running on your Linksys Router
Recently my router was giving me some problems, the worst type, dropped signal!
After hours of searching around in forums and such, I concluded that it must (hopefully) have something to do with Linksys's generally bad router software, you know, the page you goto to make all your settings and stuff... usually found at 192.168.1.1
On to the good stuff...
It's all actually quite simple, and I've taken the liberty to get all you need and make it available for you right here... so, feel free to send me some beer money, or better yet, BEER! (keep in mind, I only drink quality micro and craft brews...)
Setting up MAMP to work for the same scripts we use on the Debian server
I changed the mysql root password through phpMyAdmin... and promptly lost the connection– no! The password also has to be changed in MAMP's phpMyAdmin configuration file.
vi /Applications/MAMP/bin/phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['password'] = 'changedpass'; // MySQL password (only needed
