This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create Group and User | |
groupadd your-groupname | |
adduser your-username --shell /sbin/nologin | |
# add your-username to your-groupname | |
usermod -aG your-groupname your-username | |
# Modify SSH Configuration File in /etc/ssh/sshd_config | |
Subsystem sftp internal-sftp | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virt-install --name=test\ | |
--ram=2048 --os-type=linux\ | |
--cdrom=/var/lib/libvirt/images/debian-9.4.0-amd64-xfce-CD-1.iso\ | |
--disk path=/dev/mapper/vg_kvm-db21_root\ | |
--disk path=/dev/mapper/vg_kvm-db21_tmp\ | |
--disk path=/dev/mapper/vg_kvm-db21_swap\ | |
--network bridge=br0\ | |
--vnc --noautoconsole |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### create user name with specific password | |
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; | |
### create database | |
CREATE DADTABASE database-namee; | |
### grant all privileges to user for all databases | |
GRANT ALL PRIVILEGES ON * . * TO 'username'@'localhost'; | |
### grant all privileges to user for specific database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# go to here path and add follow lines to this file /etc/tor/torrc | |
# previous install "obfs4proxy" package | |
#### | |
UseBridges 1 | |
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy | |
Sandbox 0 # don't work with ClientTransportPlugin | |
Bridge obfs4 51.195.117.252:666 3275695F343201E2243B0E55E6C2F6476BDC91A7 cert=KybiRTmKQZiQmLk/Iuq9BHjWgIgHsbZ0pzrZCTZDeA6N7KWInqTxZc9TPpSfs88t25+MPA iat-mode=0 | |
Bridge obfs4 87.106.157.198:55405 3C3893086B27E879778E4A6275E5230AA49132E9 cert=uZorJsxG11sfGmt2tsJRX6jCDQF043crM0vfsY+BJUdciPsszVN1eAem2zNteZ2WVjFqLg iat-mode=0 | |
Bridge obfs4 51.79.51.112:51804 228199E09F51A406D0A3585463A47B82A9AF11AB cert=jgFDOR4fAkVvdCLHjCYv9+WKu4oilFhSWQGSlm8nlhfQ8gYLz24p5bTsF6jYL4ZxiYMlcw iat-mode=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for reduce lv in lvm on linux | |
# first enter follow command | |
umount /dev/mapper/vg_name/lv_name | |
# | |
e2fsck -f /dev/mapper/vg_name/lv_name | |
# | |
resize2fs /dev/mapper/vg_name/lv_name [fav_space]G | |
# | |
lvreduce -L [fav_space]G /dev/mapper/vg_name/lv_name | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 'history'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We can stop outputting the version of nginx and os by adding below command in nginx config in /etc/ngingx/nginx.conf to a http, server, or location context. | |
server_tokens off; | |
# Or if we want to remove the Server header completely, We need to compile Nginx with the Headers More module in, as the header is hard coded in the Nginx source, and this module allows changing any http headers. | |
more_clear_headers Server; | |
# for use top module we should install "apt install nginx-extras" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT host, user, password, plugin FROM mysql.user; | |
which should return something like this (with unix_socket enabled): | |
+-----------+------+--------------------------+-------------+ | |
| host | user | password | plugin | | |
+-----------+------+--------------------------+-------------+ | |
| localhost | root | <redacted_password_hash> | unix_socket | | |
+-----------+------+--------------------------+-------------+ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When i was faced with this warning in lvm when i run lvm command it works but it took | |
# WARNING: Device /dev/dm-20 not initialized in udev database even after waiting 10000000 microseconds. | |
# It look my problem is solved by reloading udev rules without reboot with this command: | |
udevadm control --reload-rules && udevadm trigger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swapoff -a #### Turn off the existing swap space | |
#### create partition with enter n character, after enter this character enter partition number and start sector and space - write changes with enter w | |
partprobe #### reread partition table | |
#### add this line `/dev/specific-device none swap sw 0 0` ### modify /etc/fstab file for mount startup | |
mkswap /dev/specific-partition | |
swapon -a #### activate created swap particion |
NewerOlder