Site Overlay

Unix Cheat Sheet

Zasady

  • ak neves na co by ti toto bolo – prosim odid
  • pisem bez diakritiky (rychlo)
  • mozu tu byt chyby !!! pocitaj s tym
  • musis vediet co sa spusta pod root-om (sudo)

GIT

git clone https://github.com/elastic/ansible-elasticsearch-example.git
git clone https://github.com/elastic/ansible-elasticsearch.git roles/elasticsearch
git pull
git status
git submodule add https://github.com/elastic/ansible-elasticsearch.git roles/contrib/elasticsearch
git status
git commit
git push
git pull
git status
<sprav zmeny>
git diff
git status
git add <zmeneny subor/adresar>
git commit -m "popis zmeny"
git push
git status

RPM

rpm -qa --queryformat '%10{size} - %-25{name} \t %{version}\n' | sort -n # show all installed package with size and sort it
rpm -ivh <name> # install
rpm -e <name> # uninstall

GRUB

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg # reconfigure gub

CUE 2 MP3 convert

mp3diags # gui na opravu mp3
avconv -i cd.ape cd.mp3 # (there are other options, like bitrate, but this is just the bare bones)
mp3 split -a -c cd.cue cd.mp3 # split the MP3 file using the CUE file, this will produce an mp3 file for each track in the same directory

FTP / WGET / CURL

curl --ntlm -u 'user:password' 'http://www/dir/'
lftp -e "put -c -O GroupWrite/ Stuzkova.mp4; bye" user:pass@ftp.drivehq.com
wput -l 100K Stuzkova.mp4 ftp://user:pass@ftp.drivehq.com/GroupWrite/

TEXT UTF8 ISO8859

iconv -f 8859-1 -t UTF-8 my-file.txt
iconv -f IBM870 -t ISO_8859-2 ITEM_870 >ITEM_870.l2

HW USB

lspci -v | grep USB
lsusb -t

MQ SERVER

sudo -u mqm /opt/mqm/bin/strmqm SUN_QM1
/opt/mqm/bin/runmqlsr -r -m SUN_QM1 -t TCP -p 1414
netstat -an | grep 1414
cd /var/mqm/qmgrs/<MANAGER> #logy
### authority
setmqaut -m SUN_QM1 -t qmgr -g mqm +all
setmqaut -m SUN_QM1 -t qmgr -p user +all
setmqaut -m SUN_QM1 -n BENO_Q -p user +all
setmqaut -m SUN_QM1 -n BENO_Q -t queue -p user +all
setmqaut -m SUN_QM1 -n BENO_Q -t queue -g grupa +all
  • troubleshooting
mqrc 2005 # vypise typ chyby
runmqsc
more /var/mqm/qmgrs/AIX.MQM/qm.ini
more /var/mqm/qmgrs/AIX.MQM/errors/*
port 1414
netstat -an | grep 1414 | wc -l

MQ CLIENT

export MQSERVER=<kanal>/TCP/<ipadresa>(port)
export MQSERVER=SYSTEM.DEF.SVRCONN/TCP/10.10.10.10(1414)
./amqsputc BENO_Q SUN_QM1
Sample AMQSPUT0 start
target queue is BENO_Q
hocico
Sample AMQSPUT0 end
./amqsgetc BENO_Q SUN_QM1
Sample AMQSGET0 start
message <hocico>
no more messages
Sample AMQSGET0 end

TIVOLI TSM

/opt/tivoli/tsm/client/ba/bin//dsmc inc /etc/motd #= incrementalny backup
/opt/tivoli/tsm/client/ba/bin//dsmc que backup /etc/motd #= status backupu
/opt/tivoli/tsm/client/ba/bin//dsmc arch /etc/motd -archmc=DATA_10Y #= archivacia
/opt/tivoli/tsm/client/ba/bin//dsmc que archiv /etc/motd #= status archivacie

EMERGE gentoo

emerge -vuNDp world
equery files vim
equery belongs /usr/bin/view
equery list --installed
equery list --duplicates
glsa-check all
revdep-rebuild -p
EXTRA_ECONF="--enable-scp-compat" emerge scponly
Scroll Up