After installing Scalr and adding a client I've tried to add an application to test out my setup. But at the second step I've got an alert saying:
-----------------------------
Error Type: LoadXML
Description: Incorrect XML
-----------------------------
A quick look at the apache log revealed the problem:
-----------------------------
File does not exist: /var/scalr/app/www/farm_amis.xml
-----------------------------
I thought that maybe I've missed a file so I did a svn checkout of scalr repository and tried to find the specified file:
#apt-get install subversion
#svn checkout http://scalr.googlecode.com/svn/trunk/ scalr-read-only
#find scalr-read-only -name farm_amis.xml -type f
Nothing came up. Weird. After a bit of looking around I've found a file called farm_amis_xml.php. So in fact farm_amis.xml was only a mod_rewrite directive.
Time to fix it, enable mod_rewrite and .htaccess files for apache2:
Edit /etc/apache2/sites-available/000-default and change the lines containing AllowOverride None to AllowOverride All
Go to /etc/apache2/mods-enabled and execute the following command:
# ln -s ../mods-available/rewrite.load
Restart apache2 server and everything should be ok:
#/etc/init.d/apache2 restart
Friday, July 17, 2009
Text manipulation 'sed'
1. #sed 's/string1/string2/g'
(Replace string1 with string2)
2. #sed 's/\(.*\)1/\12/g'
(Modify anystring1 to anystring2)
3. #sed '/ *#/d; /^ *$/d'
(Remove comments and blank lines)
4. #sed ':a; /\\$/N; s/\\\n//; ta'
(Concatenate lines with trailing \)
5. #sed 's/[ \t]*$//'
(Remove trailing spaces from lines)
6.# sed 's/\([`"$\]\)/\\\1/g'
(Escape shell metacharacters active within double quotes)
7.#seq 10 | sed "s/^/ /; s/ *\(.\{7,\}\)/\1/"
(Right align numbers)
8.#sed -n '1000p;1000q'
(Print 1000th line)
9.#sed -n '10,20p;20q'
(Print lines 10 to 20)
10. #sed -n 's/.*\(.*\)<\/title>.*/\1/ip;T;q'
(Extract title from HTML web page)
11. #sed -i 42d ~/.ssh/known_hosts
(Delete a particular line)
(Replace string1 with string2)
2. #sed 's/\(.*\)1/\12/g'
(Modify anystring1 to anystring2)
3. #sed '/ *#/d; /^ *$/d'
(Remove comments and blank lines)
4. #sed ':a; /\\$/N; s/\\\n//; ta'
(Concatenate lines with trailing \)
5. #sed 's/[ \t]*$//'
(Remove trailing spaces from lines)
6.# sed 's/\([`"$\]\)/\\\1/g'
(Escape shell metacharacters active within double quotes)
7.#seq 10 | sed "s/^/ /; s/ *\(.\{7,\}\)/\1/"
(Right align numbers)
8.#sed -n '1000p;1000q'
(Print 1000th line)
9.#sed -n '10,20p;20q'
(Print lines 10 to 20)
10. #sed -n 's/.*
(Extract title from HTML web page)
11. #sed -i 42d ~/.ssh/known_hosts
(Delete a particular line)
SSH
1. #ssh $USER@$HOST
(Run command on $HOST as $USER (default command=shell))
2. #ssh -f -Y $USER@$HOSTNAME xeyes
(Run GUI command on $HOSTNAME as $USER)
3. #scp -p -r $USER@$HOST: file dir/
(Copy with permissions to $USER's home directory on $HOST)
4. #ssh -g -L 8080:localhost:80 root@$HOST
(Forward connections to $HOSTNAME:8080 out to $HOST:80)
5. #ssh -R 1434:imap:143 root@$HOST
Forward connections from $HOST:1434 in to imap:143)
(Run command on $HOST as $USER (default command=shell))
2. #ssh -f -Y $USER@$HOSTNAME xeyes
(Run GUI command on $HOSTNAME as $USER)
3. #scp -p -r $USER@$HOST: file dir/
(Copy with permissions to $USER's home directory on $HOST)
4. #ssh -g -L 8080:localhost:80 root@$HOST
(Forward connections to $HOSTNAME:8080 out to $HOST:80)
5. #ssh -R 1434:imap:143 root@$HOST
Forward connections from $HOST:1434 in to imap:143)
Subscribe to:
Posts (Atom)