Linux MEMO

Usefull Linux command...

Webservices

WGET based SOAP webservice call :
wget --post-file=/path/to/test.soap --http-user=user --http-passwd=password --append-output=/path/to/file.log -v 'http://host:port/path/to/ws?a=1&b=2'

MySQL

Create a gzipped MySQL dump with custom SESSION variable values at the beginning
(echo 'SET SESSION SQL_LOG_BIN = 0 ;'; mysqldump -hlocalhost -u root --skip-lock-tables --skip-add-lock mybdd) | gzip > /path/to/dump.sql.gz
Import gzipped MySQL dump and add custom SESSION variable values at the beginning :
(echo 'SET SESSION SQL_LOG_BIN = 0 ;'; zcat /path/to/dump.sql.gz) | mysql

CSV

Remove column in CSV via ksh (remove column 3 of 5) :
for a in $(ls /path/to/folder/*.csv)
do
  cat $a | awk -F ';' '{ print $1 ";" $2 ";" $4 ";" $5 }' > $a.$$
  mv $a.$$ $a
done

Perf tools

Aucun commentaire:

Enregistrer un commentaire

Fork me on GitHub