6/19/2010

Infinite Redirect Loop when selecting group in Google Groups

I recently encountered the infinite redirect loop when I accessed my Google Groups website. I didn't know why. I tried with another PC and it was good. Also tried with Google Chrome. Then it was good. Just one PC with Firefox is not good. Upgrading Firefox to version 3.6.3 didn't resolve the problem.Finally I deleted all cookies and could connect to my Google groups website. 
 I referred the following website.
http://support.mozilla.com/no/forum/1/700930

5/19/2010

How to grant select privileges to all tables in database in PostgreSQL

After a couple of research, I figured out the command that grants select privileges to all tables of the database in PostgreSQL.

 select 'grant select on '||schemaname||'.'||tablename||' to username;' from pg_tables where schemana
me in ('public');

Also in the case of views it would be the following.

 select 'grant select on '||schemaname||'.'||viewname||' to username;' from pg_views where schemaname
 in ('public');

You'll get the list of SQL statements to grant all tables the privileges you want like following.

                          ?column?
------------------------------------------------------------
 grant select on public.table_a to username;
 grant select on public.table_s to username;
 grant select on public.table_d to username;
 grant select on public.table_f to username;
 grant select on public.table_g to username;
........

(xx rows)

Then, excute those SQL statements.
That's it.:)

I referred the following post.
http://bensbrain.blogspot.com/2004/08/postgres-grant-on-all-tables-in.html 

3/26/2010

MySQL Commands.

This is for my notes.

Update Syntax.

 mysql> UPDATE table_name SET field1 = value1, field2 = value2 WHERE Clause;
 mysql>  use mysql;
 mysql> UPDATE user SET Host='192.168.1.%' WHERE User = 'user1';


Delete user.
Drop command is better than delete command.
 mysql> drop user 'user'@'%';

 mysql> delete from user where User = '' and Host = 'localhost';

Set password.
 mysql> set password for root@localhost = password('abcde');

Create DB and grant/create new user with password.
 create database someDB;
 GRANT ALL PRIVILEGES ON someDB.* TO username@"%" IDENTIFIED BY 'password';

Select: Display results one by one.
select * from some_table \G;

Pager option
Shell>mysql --pager='less -S' -uroot -p

Output as CSV
select * from some_table into outfile "./output.csv" fields terminated by ',' enclosed by '"' lines terminated by '\r\n';

Purge binary logs
On slave machine, check the current log position
 mysql> show slave status\G;
*************************** 1. row *************************** 
Slave_IO_State: Waiting for master to send event 
 Master_Host: masterdb 
 Master_User: user 
 Master_Port: 3306 
 Connect_Retry: 60 
 Master_Log_File: mysqld-bin.000037

 Read_Master_Log_Pos: 170665205
 Relay_Log_File: mysqld-relay-bin.000063
 Relay_Log_Pos: 170665343
 Relay_Master_Log_File: mysqld-bin.000037

On master machine, check the current status.

 mysql> show master status\G;
*************************** 1. row *************************** 
File: mysqld-bin.000037
Position: 170680957
Binlog_Do_DB: 
Binlog_Ignore_DB: 
1 row in set (0.00 sec)

mysql> show master logs;
+-------------------+------------+
| Log_name          | File_size  |
+-------------------+------------+
| mysqld-bin.000035 | 1073743657 | 
| mysqld-bin.000036 | 1073745063 | 
| mysqld-bin.000037 |  171424254 | 
+-------------------+------------+
3 rows in set (0.00 sec)


On master, to delete old binary logs which is prior to mysqld-bin.000037
mysql> purge master logs to mysqld-bin.000037



















1/06/2010

Dell OpenManage installation by yum

Just two commands are all you need to install DellOpenManage by yum.

wget -q -O - http://linux.dell.com/repo/hardware/OMSA_6.2/bootstrap.cgi | bash

yum install srvadmin-all

It's pretty handy.:)

Reference:
http://linux.dell.com/wiki/index.php/Repository/hardware

OpenManage Commands
omconfig
http://support.dell.com/support/edocs/software/svradmin/1.9/en/stormgmt/cli.html#1093328