buy tb500

Archive for the ‘Linux’ Category

Create database in cPanel using linux command line

Saturday, December 3rd, 2022

1-
uapi --user=alsalamaco Mysql create_user name=alsalamaco_aabbcc password=1qa2ws3ed

2-

uapi --user=alsalamaco Mysql create_user name=alsalamaco_aabbcc password=1qa2ws3password=1qa2ws3eded

3-
uapi --user=alsalamaco Mysql set_privileges_on_database user=alsalamaco_aabbcc database=alsalamaco_aabbcc privileges=ALL%20PRIVILEGES

note: alsalamaco is cpanel domain username

sed to find and replace in file (in linux)

Wednesday, November 30th, 2022

sed -i” -e ‘s/alayan\.co/al\-ayan\.com/g’ alayan_wp.sql

journalctl commands to check the logs

Thursday, November 17th, 2022

Time Ranges

To see messages logged within a specific time window, we can use the --since and --until options. The following command shows journal messages logged within the last hour.

$ journalctl --since "1 hour ago"

To see messages logged in the last two days, the following command can be used.

$ journalctl --since "2 days ago"

The command below will show messages between two dates and times. All messages logged on or after the since parameter and logged on or before the until parameter will be shown.

$ journalctl --since "2015-06-26 23:15:00" --until "2015-06-26 23:20:00"

For greater accuracy, format the date and time as “YYYY-MM-DD HH:MM:SS”. You can also use any format that follows the systemd.time specification.

prevent any one access wordpress admin

Sunday, October 9th, 2022
#AuthName "Admins Only"

# ALLOW USER BY IP
<Limit GET POST>
 order deny,allow
 deny from all
 allow from 1.2.3.4
 allow from 5.6.7.8
</Limit>

# PREVENT VIEWING OF .HTACCESS
<Files .htaccess>
 order allow,deny
 deny from all
</Files>

httpd status code using curl

Monday, May 30th, 2022
curl -o /dev/null -s -w "%{http_code}\n" http://localhost

show ip in linux

Sunday, May 29th, 2022

ip a |grep “inet 10” |awk ‘NR==1{print $2}’ |sed -r ‘s/\/24/ /g’

package account without emails and public_html contents – cPanel

Tuesday, May 9th, 2017


/scripts/pkgacct –skiphomedir USER

 

You must enable the PECL memcached or memcache extension to use memcache.inc. cpanel

Friday, May 5th, 2017


Solutions

 

yum install ea4-experimental
yum install ea-php56-php-memcache
yum install ea-php56-php-memcached
yum install ea-memcached

That should fix the issue. i have tried it and fixed my issue. 
Reference

https://forums.cpanel.net/threads/installing-memcache-and-memcached-with-easyapache4.566261/

queueprocd isn’t running? at /usr/local/cpanel/Cpanel/TaskQueue/Manager.pm line 150

Thursday, May 4th, 2017


The issue can be fix by run the following command

 

/scripts/restartsrv_queueprocd

 

 

#1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’

Thursday, May 4th, 2017


1) Click the “Export” tab for the database

2) Click the “Custom” radio button

3) Go the section titled “Format-specific options” and change the dropdown for “Database system or older MySQL server to maximize output compatibility with:” from NONE to MYSQL40.

4) Scroll to the bottom and click “GO”.

I’m not certain if doing this causes any data loss, however in the one time I’ve tried it I did not notice any. Neither did anyone who responded in the forums linked to above.

 

Reference

http://stackoverflow.com/questions/29916610/1273-unknown-collation-utf8mb4-unicode-ci-cpanel/29939906#29939906