append file with wget

To append a file with one fetched from a URL, use wget and output to STDOUT then redirect and append where needed.

# wget -q 'http://10.11.178.141/all_pub_keys' -O - >>/root/.ssh/authorized_keys

In this case I wanted to add some public keys to an existing authorized_keys file.

share:

time mysql select without output

To see how long a query will take without actually outputting anything, change the pager in mysql client to /dev/null instead of STDOUT

mysql> pager;
Default pager wasn't set, using stdout.

mysql> pager >/dev/null
PAGER set to '>/dev/null'

mysql> select md5sum from table1;
5245618 rows in set (1 min 21.50 sec)

mysql> select md5sum from table1 where md5sum is not NULL and md5sum!='not calculated';
4832676 rows in set (1 min 11.52 sec)

mysql> select md5sum from table1 where md5sum not in ('NULL', '', 'not calculated');
4832078 rows in set (1 min 21.91 sec)
share: