efs encryption

If you have an existing EFS that’s unencrypted, you can encrypt it be creating a snapshot using AWS Backup, and then restoring the file system to a new EFS with encryption. If you choose to restore in a directory in the same file system, it will not be encrypted. It has to be a new EFS. In addition, you’ll be asked to select which encryption key to use. The default key will work, unless you have your own. ...

December 3, 2020 · 1 min · ulysses

mysql read only

If you need to perform backup or replicate a database, you can lock up the database by doing a global read block to make it read-only. The process is: Make the server read-only, so that it processes only retrievals and blocks updates. You can then perform the backup. Change the server back to its normal read/write state. Read only. FLUSH TABLES WITH READ LOCK; SET GLOBAL read_only = ON; Back to normal mode. ...

November 30, 2020 · 1 min · ulysses

change mysql user password

This is a very simple command to run. Login to MySQL first and run the following the command line. ALTER USER username IDENTIFIED BY 'password'; Flush privileges for changes to take effect. flush privileges;

November 29, 2020 · 1 min · ulysses

running mysql commands from the terminal

You can run MySQL commands from the terminal by using -e switch. Here are a few examples. mysql -u username -p -e "create database mydb" mysql -u username -p -e "use mydb" mysql -u username -p database -e "select * from mytable" If you have .mycnf configured, you can omit the username and password. mysql -e "create database mydb" mysql -e "use mydb" mysql -e "select * from mytable" To run multiple commands from a single line, separate the commands using a semicolon. ...

November 29, 2020 · 1 min · ulysses

wordpress read only

Here’s how to create a WordPress site that’s read only. You will not be able to create, update and delete posts. Login to MySQL or MariaDB. Choose mysql database. Create a new user called ‘wpro’ for WordPress read only. Grant select permissions to all tables in ‘wordpress’ database. Flush privileges to commit your changes. mariadb -u root -p use mysql; create user 'wpro'@'localhost' identified by 'yourpassword'; grant select on wordpress.* to 'wpro'@'localhost'; flush privileges; In MySQL or MariaDB, you have to terminate all commands with a semicolon. ...

November 29, 2020 · 1 min · ulysses

copy a symbolic link

Here’s how to copy a symbolic link which is also known as a soft link from one directory to another. A regular copy command will not work. You will need to use the -P option to copy the symbolic link from one directory to another. If omitted, the symbolic links will not be copied. cp -P /directory1/* /directory2/ How to create a symbolic link. ln -s sourcefile myfile ln -s /path/to/file myfile Here are the man pages for ln and for cp.

November 27, 2020 · 1 min · ulysses

check network promiscuous mode

Promiscuous mode is a mode for a network interface where the controller to passes all traffic it receives to the CPU instead of passing the frames to the controller. This is helpful if you want to capture all traffic as part of troubleshooting. The question is, how can you tell if your network interface is in a promiscuous mode? Here’s a couple of commands. Here’s the default mode. sudo ip link show eth0 2: eth0: <broadcast> mtu 1460 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff </broadcast> Here’s promiscuous mode. Look for PROMISC. ...

November 23, 2020 · 1 min · ulysses

iotop

iotop is a Linux command similar to top but instead of CPU and memory it will display and monitor your disk IO usage. To install, run the following command based on your Linux ditro. yum install iotop apt install iotop dnf install iotop To use. iotop iotop -o Output:

November 22, 2020 · 1 min · ulysses

mysql read only

Here’s how to make a MySQL database read only. mysql> FLUSH TABLES WITH READ LOCK; mysql> SET GLOBAL read_only = ON; It’s very useful if creating a replica database.

November 22, 2020 · 1 min · ulysses

filter output of lsblk

Here’s one way to display block devices, mountpoints and size using lsblk. lsblk -a -p -n -d -e 230 -o NAME,MOUNTPOINT,SIZE Here are the options. -a = list all empty devices -p = print full device paths -d = do not print holder devices or slaves -e = exclude devices as by a comma-separate list -o = specify which columns to print, e.g. NAME,MOUNTPOINT,SIZE The output. /dev/sda 30G /dev/sdb /data 50G Here’s the man page.

November 20, 2020 · 1 min · ulysses