powerof
how copy files: check note>>>
date
cd (path)
passwd
kill %1
jobs
ls ../
ls -l
In vim >> i
In vim >> :x
In vim >> escape button
iptables -L -v
vi ~/.vimrc (new file)>>>(append) set number
CTRL + d
* To find a word in VI / Vim, just type "/" or "?", followed by the word yo
Position the cursor at the beginning of the text you want to cut/copy.
Press v to begin character-based visual selection (or upper case V to s
Move the cursor to the end of the text to be cut/copied. (While selectin
feature that sets vim apart from most other editors.)
Press d (as in "delete") to cut, or y (as in "yank", which I imagine mean
Move the cursor to the desired paste location.
Press p to paste after the cursor, or P to paste before.
In gvim, visual marking (steps 1-3) can be replaced by selecting text u
navigate using the keyboard.
Bonus tip: To replace the selected text with new text (to be entered by
leaves you in insert mode. Then, instead of (or prior to) steps 5-6, type
sudo service nginx "argumnet"
nginx -t
what I used to change user name with keeping his groups and
1) usermod -dm heisenberg -Ga heisenberg,sudo -l heisenberg do
2) usermod -d heisenberg -m -G heisenberg,sudo -a -l heisenberg do
3) result was ok with all options and groups appended and password b
usermod -m -d /path/to/new/home/dir userNameHere
rm or unlink <link name>
usermod -g <NewPrimaryGroupName> <CurrentUserName>
dpkg --get-selections|grep <app name> >> then use apt-get purge <
sudo iptables -F
ps -A
mv [option:-v] <file1> <file2> <file2> <distination>
rmdir <folder_name>
unzip <ziped_file_name>
cat /dev/null > file.txt
beaware that (*) arsetic deosn't equal "recurrsive'' it only goes one level deep in "rsync"
# sudo rm -rvI *
# sudo rm -rvI public/* << the uppercase (i) asks only once to aviod m
* Import sql dumb file into new db out the mysql console:
mysql -p -u username(of the db) database_name < /path/file.sql
* New safe and flexible way for deleting files or folders and mo
find . -path ./<folder_name> -prune -o ! -path . -ls
or with same result and easier >>
or with same result and easier >> find . mindepth 1 -type d \( -path
for action u can use : -exec <command> {} +
(to aviod k
dd if=/dev/zero of=iotest bs=64k count=16k conv=fdatasync && rm time sh -c "dd if=/dev/zero of=ddfile bs=8k \
plus count=250000
* Activate dropbox:
/usr/bin/python dropbox.py
Monitor packets that reach the server:
vnstat -l -i venet0
How to flood server:
hping3 -q -n -a 10.0.0.1 --id 0 --icmp -d 56 --floodtarget_ip_address
Syn flood attack
hping3 -i u1 -S -p <victim port> <victim ip> --flood --rand-source
With a program suspended will allow it to run in the background (the program's output will still go to t
In the above example this command would list each of the files in the
to start inserting from clipboard
to save and exit
to exit a insert mode or any mode
list the active rules with -L, and -v for information on packets afected
display line numbering in vim
logs out or get back to your user level (after su) (or a diferent user)
* or # to to look it up.
Lists all packeges installed with a application and then you could delete them all
set the rules back to the default by flushing and deleting all of them
Lists all running services
moves file(s) to distination
delete folder in same directory
un-zip file in the same directory
clears the file contents to zero size file (great for flushing logs)
verbose + copy directories inside directory and files recursively.. Don't forget / so linux knows it's deal
.. Copies to the current folder but if used 2 dot means the previous folder on the tree.
.. Copies all files and folders inside source but now source folder.. Don't forget -r for subdirectories
prints each line that has the word.. And for more options check man page.
The best command for copy & fast with exclude option no need for cp anymore
delete contents of the folder only but not the folder that why we put asterisk. -r >> recurrsive v >>
Backup command
secure copy to server
Restore command
then enter password to import the new and do all this outside the mysql console
execute action on all current directory (.) content but excluding one folder and it's whole content. The
mindepth 1 = ! -path . >> (is to exclude the current directory itself but not the content al
! -path . (is to exclude the current directory itself but not the content always use it to prot
mindepth 1 = ! -path . >> (is to exclude the current directory itself but not the content al
Creating soft sym- links and if u don't specify the shortcut name it will take the target folder or file nam
terminates session
, s/1024 }'
with -delete action since it includes -depth option and cancels =prune.. ! -path . (is to exclude the current
h . (is to exclude the current directory itself but not the content always use it to protect current di
* Exim4 cheatsheet:
exim -v mail@address.com
exim -bp | exiqgrep -i | xargs exim -Mrm
exim -Mrm {message-id}
and user:
Discover default character set and collation for the MySQL ser
SHOW VARIABLES LIKE 'character_set%'
and
ollation%';