Samba on Ubuntu/Debian
Updating software and installing Samba:
apt update; apt upgrade -y; apt install samba -y
Time to add the Samba user. It should be a real user in your system.
smbpasswd -a user_name
Create a directory to be shared
mkdir -pv /home/user_name/folder_name
Make a backup copy of the smb.conf file
cp -pv /etc/samba/smb.conf /etc/samba/smb.conf.bak
Update the /etc/samba/smb.conf file
nano /etc/samba/smb.conf
[folder_name]
path = /home/user_name/folder_name
valid users = user_name
read only = no
Restart the samba:
service smbd restart
Enable touch screen on Ubuntu/Debian
Get information about xserver-xorg-input. The result there should not be evdev configuration file.
dpkg -l | grep xserver-xorg-input
Now install evdev driver, xinput-calibrator and libs
apt-get install -y xserver-xorg-input-evdev build-essential xinput-calibrator libts-bin libts0
Check if configuration files are in /usr/share/X11/xorg.conf.d directory.
ls -alh /usr/share/X11/xorg.conf.d/
Result:
10-amdgpu.conf 10-evdev.conf 10-quirks.conf 40-libinput.conf 70-wacom.conf
We can remove libinput driver:
apt-get remove --auto-remove xserver-xorg-input-libinput
Run calibrator to get correct x,y positions.
xinput_calibrator --output-type xinput
Script to update a passwords for the all cPanel users:
Cool things on CSF config:
How to install Imagick application on Centos 6 or Centos 7
yum install -y ImageMagick ImageMagick-devel
In case when we need to install the latest ImageMagick from the vendor site:
yum install -н openjpeg2 openjpeg-libs fftw-libs-double
Then download the latest ImageMagick from here: https://imagemagick.org/download/linux/CentOS/x86_64/
And move to the install:
rpm -Uvh ImageMagick-libs-7.0.8-53.x86_64.rpm; rpm -Uvh ImageMagick-7.0.8-53.x86_64.rpm; rpm -Uvh ImageMagick-perl-7.0.8-53.x86_64.rpm
In the case with the perl module, now we can “test” it:
perldoc Image::Magick
How to add admin user via MySQL to WP
Username: admin_username
Password: some_password_for_user
Change these credentials in the code to your own selection.
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`,
`user_status`)
VALUES ('admin_username', MD5('some_password_for_user'), 'firstname lastname', 'email@example.com', '0');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users),
'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');
check the Strict mode in MySql
to check it execute the query in MySQL:
SHOW VARIABLES LIKE 'sql_mode';
if enabled it will be something like this:
MariaDB [(none)]> SHOW VARIABLES LIKE 'sql_mode';
+-------------------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------+
| IGNORE_SPACE,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------+
if the Strict mode is disabled you will see an empty response.
if you want to disable it, just add the following like to file /etc/my.cnf inside [mysqld] section the following sql_mode=''
open domain from IP address in cPanel (disable default cPanel page)
copy the file:
cp -pv /var/cpanel/templates/apache2_4/ea4_main.default /var/cpanel/templates/apache2_4/ea4_main.local
then update the skeleton in order to show the site over IP, something like this:
<virtualhost put_main_server_ip_here:80>
ServerName put_main_server_ip_here
DocumentRoot /home/username/public_html
ServerAdmin some@email
<directory "/">
AllowOverride All
</directory>
<ifmodule suphp_module>
suPHP_UserGroup username username
</ifmodule>
</virtualhost>
on file:
nano /var/cpanel/templates/apache2_4/ea4_main.local
rebuild the config and restart Apache:
/scripts/rebuildhttpdconf
service httpd restart