To fix
"Unable to open env file: /etc/default/locale: No such file or directory"
in /var/log/auth.log, run:
update-locale
Monday, April 18, 2011
Friday, April 15, 2011
mysql group by and having
mysql> select CASNumber, count(CASNumber) as ccas from compounds group by CASNumber having ccas=1 order by ccas ;
Thursday, April 14, 2011
sed: -e expression #1, char 24: unknown option to `s'
When you call sed in ruby, you may get this error message
here is the ruby code
def update_server (conf_file_path, config )
puts "update #{conf_file_path}"
%x[sed "s/drs_db.*\/drs_db/drs_db mmmmmmmm \/drs_db/g" #{conf_file_path}]
end
correct:
def update_server (conf_file_path, config )
puts "update #{conf_file_path}"
%x[sed "s/drs_db.*\\/drs_db/drs_db mmmmmmmm \\/drs_db/g" #{conf_file_path}]
end
here is the ruby code
def update_server (conf_file_path, config )
puts "update #{conf_file_path}"
%x[sed "s/drs_db.*\/drs_db/drs_db mmmmmmmm \/drs_db/g" #{conf_file_path}]
end
correct:
def update_server (conf_file_path, config )
puts "update #{conf_file_path}"
%x[sed "s/drs_db.*\\/drs_db/drs_db mmmmmmmm \\/drs_db/g" #{conf_file_path}]
end
Monday, April 11, 2011
add a line in a file
add a line after line: [mysqld]
sed -i '/\[mysqld\]/ a\bind-address = 6.31.83.19' test.cnf
sed -i '/\[mysqld\]/ a\bind-address = 6.31.83.19' test.cnf
Sunday, April 3, 2011
how to check mysql version
mysql> SELECT version();
+--------------------+
| version() |
+--------------------+
| 5.0.51a-3ubuntu5.7 |
+--------------------+
1 row in set (0.00 sec)
mysql> status
--------------
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.0.51a-3ubuntu5.7 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 153 days 19 hours 36 min 16 sec
+--------------------+
| version() |
+--------------------+
| 5.0.51a-3ubuntu5.7 |
+--------------------+
1 row in set (0.00 sec)
mysql> status
--------------
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.0.51a-3ubuntu5.7 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 153 days 19 hours 36 min 16 sec
Friday, April 1, 2011
enable Telnet client in Windows Vista
1. Open the Programs and Features Control Panel
2. Select "Turn Windows features on or off."
3. Select the Telnet Client option and click OK.
2. Select "Turn Windows features on or off."
3. Select the Telnet Client option and click OK.
Subscribe to:
Posts (Atom)
-
Step 1, New a project rails new demo Step 2, Update Gemfile add paperclip, mysql2 gem, enable JavaScript runtime gem 'mysql2' ...
-
I used 7z to zip this file under Windows, try to unzip it under linux [ang@walker temp]$ gunzip 2011.sdf.zip gunzip: 2011.sdf.zip: unkno...
-
When trying to access transmission from web-browswer i got the message : 403: Forbidden Unauthorized IP Address. Either disable the IP ad...