https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2
ssh-keygen ssh-copy-id user@11.22.33.44 //remote machine ssh user@11.22.33.44 //nopassword
http://linux.die.net/man/1/rsync
http://www.thegeekstuff.com/2010/09/rsync-command-examples/
sudo aptitude install rsync
rsync -av root@10.20.30.1:/home/* /mnt/home
-a option is a combination flag. It stands for "archive" and syncs recursively and preserves symbolic links, special and device files, modification times, group, owner, and permissions.
-z If you are transferring files that have not already been compressed, like text files, you can reduce the network transfer by adding compression with the -z option:
-P flag is very helpful. It combines the flags --progress and --partial. The first of these gives you a progress bar for the transfers and the second allows you to resume interrupted transfers
http://superuser.com/questions/446603/samba-domain-controller-remove-1-windows-client
pdbedit -L -w | grep '\[[WI]' //lista komputerów podłączonych do domeny pdbedit -L -w | grep '\[[WI]' | grep machine_name pdbedit -x -m machine_name //usuń komputer
http://www.tech-g.com/2012/07/15/inspecting-postfixs-email-queue/
postqueue -p //sprawdz kolejkę maili postcat -vq XXXXXXXXXX //pokaż wiadomość z kolejki wg ID postqueue -f //wykonaj bierzącą kolejkę - flush postsuper -d ALL //usuń całą kolejkę znajdź adresata SPAMu: regular_text: (Authenticated sender: user@domena.pl) i zmień mu hasło / zablokuj konto
http://stackoverflow.com/questions/23136947/javascript-regex-to-return-letters-only
var matches = sequence.match(/[a-zA-Z0-9]+/g); matches = matches.toString(); //musi być przekonwertowany na string inaczej replace() to nie obsłuży matches = matches.replace(/,/g,''); //2 zawiasy kwadratowe dają przecinek który trzeba usunąć matches = matches.toLowerCase();
Required packages
aptitude install build-essential ruby-dev libxslt1-dev libmariadb-dev libxml2-dev zlib1g-dev imagemagick libmagickwand-dev curl vim sudo apache2 libapache2-mod-passenger ufw subversion mariadb-server mariadb-client
aptitude install php php-mysql # jeśli potrzebujemy php do phpmyadmin lub adminer
Test
ruby -v
useradd -r -m -d /opt/redmine -s /usr/bin/bash redmine usermod -aG redmine www-data
Zobacz całość
grep --include=\*.{txt,sas} -rnw '/jakas/sciezka/' -e "fraza"
wyszuka slowa fraza w podanej sciezce ale tylko w plikach txt i sas
vim +X plik
http://manpages.courier-mta.org/htmlman8/lsblk.8.html
sudo update-alternatives --config editor
lub
vim .bashrc export EDITOR=vim
sudo vim /etc/apt/sources.list
deb http://download.opensuse.org/repositories/home:/jgeboski/xUbuntu_14.04/ ./
wget -O- https://dl.voidium.net/jgeboski/obs.key | sudo apt-key add - sudo aptitude update sudo apt-get install purple-facebook
instalacja wolumenu
lvcreate -n nazwa_wolumenu -L 100G nazwa_grupy
ściągamu iso płyty instalacyjnej i kopiujemy z niego kernel i ramdisc
wget -c http://cdimage.debian.org/debian-cd/8.3.0/amd64/iso-cd/debian-8.3.0-amd64-netinst.iso mount -t iso9660 iso-cd/debian-8.3.0-amd64-netinst.iso /mnt/iso/ cp /mnt/iso/install.amd/vmlinuz /xen/kernels/debian8.3/vmlinuz cp /mnt/iso/install.amd/initrd.gz /xen/kernels/debian8.3/initrd.gz
Zobacz całość
lvdisplay #wyświetl stan wolumenu vgdisplay #wyświetl grupy wolumenów lvcreate -n testDebian -L 30G xenvms #tworzy wolumen o rozmiarze 30GB w grupie xenvms umount /dev/myvg/homevol lvremove /dev/myvg/homevol #odmontuj i usuń wolumen
.htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301,NE]
.htaccess
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
http://stackoverflow.com/questions/26620670/apache-httpx-forwarded-proto-in-htaccess-is-causing-redirect-loop-in-dev-envir
http://php.net/manual/en/function.get-class-methods.php
$class_methods = get_class_methods($response);
print_r($class_methods);