Misc scripts
From Wikitech
(Difference between revisions)
m (mailqcount) |
(what still works? probably none of it) |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| + | {{old}} | ||
| + | |||
Various misc useful scripts: | Various misc useful scripts: | ||
| Line 17: | Line 19: | ||
# of rcpt-to : 1790 | # of rcpt-to : 1790 | ||
$ | $ | ||
| + | |||
| + | * Get list of mysql servers according to db.php : | ||
| + | $ /home/wikipedia/bin/mysql-list | ||
| + | adler | ||
| + | samuel | ||
| + | ariel | ||
| + | ixia | ||
| + | thistle | ||
| + | lomaria | ||
| + | $ | ||
| + | |||
| + | * Get replication data for servers : | ||
| + | |||
| + | $ /home/wikipedia/bin/replication | ||
| + | SERVER adler | ||
| + | Position: 220761719 | ||
| + | SERVER samuel | ||
| + | Read_Master_Log_Pos: 220761719 | ||
| + | Exec_master_log_pos: 220761719 | ||
| + | SERVER ariel | ||
| + | Read_Master_Log_Pos: 220761719 | ||
| + | Exec_master_log_pos: 220761719 | ||
| + | SERVER ixia | ||
| + | Read_Master_Log_Pos: 220761719 | ||
| + | Exec_master_log_pos: 220761719 | ||
| + | SERVER thistle | ||
| + | Read_Master_Log_Pos: 220761719 | ||
| + | Exec_master_log_pos: 220761719 | ||
| + | SERVER lomaria | ||
| + | Read_Master_Log_Pos: 220763426 | ||
| + | Exec_master_log_pos: 220763426 | ||
| + | $ | ||
| + | |||
| + | [[Category:Help]] | ||
Latest revision as of 06:21, 19 August 2008
Various misc useful scripts:
- upload a local file to the wiki as an edit:
/home/wikipedia/bin/upload en wikipedia /etc/passwd Wikipedia:Sandbox
- count the number of contributions from a user:
/home/wikipedia/bin/editcount en wikipedia Kate
- make a function for each hostname, so that e.g.: browne ps will connect to browne and perform ps:
ALLNG=/usr/local/dsh/node_groups/ALL
if [ -r $ALLNG ]; then for host in $(<$ALLNG); $host() { ssh $0 $* }; fi
- count stuff in mailq :
$ /home/wikipedia/bin/mailqcount # of messages: 1584 # of errors : 1770 # of rcpt-to : 1790 $
- Get list of mysql servers according to db.php :
$ /home/wikipedia/bin/mysql-list adler samuel ariel ixia thistle lomaria $
- Get replication data for servers :
$ /home/wikipedia/bin/replication
SERVER adler
Position: 220761719
SERVER samuel
Read_Master_Log_Pos: 220761719
Exec_master_log_pos: 220761719
SERVER ariel
Read_Master_Log_Pos: 220761719
Exec_master_log_pos: 220761719
SERVER ixia
Read_Master_Log_Pos: 220761719
Exec_master_log_pos: 220761719
SERVER thistle
Read_Master_Log_Pos: 220761719
Exec_master_log_pos: 220761719
SERVER lomaria
Read_Master_Log_Pos: 220763426
Exec_master_log_pos: 220763426
$