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)
Make the lights of your NIC blink
If you work on a large network and you get sent to the server room to check out a certain network card, you might get lost in the multitude of network hardware. To find your certain NIC, SSH to the machine in question and do a
#sudo ethtool -o eth0
The lights of the network card should start blinking repeatedly
#sudo ethtool -o eth0
The lights of the network card should start blinking repeatedly
Flush DNS cache in Linux
If you happened to register a new domain name and you can’t access it, it may be your DNS cache that holds the problem. Here’s how to flush DNS cache in Linux:
#/etc/rc.d/init.d/nscd restart
#/etc/rc.d/init.d/nscd restart
Find out what RAM type you have in Linux
To check what RAM memory type yo have installed (and also see other useful information about your system), do a
#sudo dmidecode
Depending on the version of dmidecode you have installed and the hardware configuration you have, each hardware device will have a certain type number assigned t it. On my machine, the RAM has type 6. So to see what RAM type and speed you have, do a
#sudo dmidecode –type 6
and the output will be something like
dmidecode 2.9
SMBIOS 2.3 present.
Handle 0×0008, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: ROW-0
Bank Connections: 1 0
Current Speed: 800
Type: DIMM SDRAM
Installed Size: 256 MB (Double-bank Connection)
Enabled Size: 256 MB (Double-bank Connection)
Error Status: OK
#sudo dmidecode
Depending on the version of dmidecode you have installed and the hardware configuration you have, each hardware device will have a certain type number assigned t it. On my machine, the RAM has type 6. So to see what RAM type and speed you have, do a
#sudo dmidecode –type 6
and the output will be something like
dmidecode 2.9
SMBIOS 2.3 present.
Handle 0×0008, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: ROW-0
Bank Connections: 1 0
Current Speed: 800
Type: DIMM SDRAM
Installed Size: 256 MB (Double-bank Connection)
Enabled Size: 256 MB (Double-bank Connection)
Error Status: OK
Subscribe to:
Posts (Atom)