Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Archives for create

November 29, 2020

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.

  1. Login to MySQL or MariaDB.
  2. Choose mysql database.
  3. Create a new user called ‘wpro’ for WordPress read only.
  4. Grant select permissions to all tables in ‘wordpress’ database.
  5. 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;

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.

Now edit your WordPress wp-config.php file. vim /var/www/wordpress/wp-config.php.

/** MySQL database username */
define('DB_USER', 'wpro');
 
/** MySQL database password */
define('DB_PASSWORD', 'yourpassword');

/** MySQL database username */ define('DB_USER', 'wpro'); /** MySQL database password */ define('DB_PASSWORD', 'yourpassword');

After saving the wp-config.php file, everything should work just like before, except that you will not be able to save, publish or delete posts, pages, or add or delete media files to your WordPress site. It’s working as intended.

November 27, 2020

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/

cp -P /directory1/* /directory2/

How to create a symbolic link.

ln -s sourcefile myfile
ln -s /path/to/file myfile

ln -s sourcefile myfile ln -s /path/to/file myfile

Here are the man pages for ln and for cp.

November 8, 2020

Tar List of Files

Here’s another way of creating a tar ball from a list of files.

tar -cvf backup.tar.gz a.txt b.txt c.txt d.txt e.txt

tar -cvf backup.tar.gz a.txt b.txt c.txt d.txt e.txt

Here’s how to view files in a tarball.

tar -tvf backup.tar.gz

tar -tvf backup.tar.gz

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 11
  • Next Page »
  • Cloud
  • Linux
  • Git

Copyright © 2012–2021