Categories
Unix

Couldn’t execute ‘SHOW TRIGGERS LIKE XXX”: Got error 28 from storage engine (1030)

That means space/memory issue on your server

Free space !

du -skh .
df
Categories
Unix

How to start a httpd service when rebooting linux ?

How to make sure your service starts when you server reboot? It is practical so you do not have to ssh into your machine everytime you want to start your web server. Find below the command used for that effect

sudo chkconfig --levels 0123456 httpd on

Here explanation of levels

0   Halt
1   Single-User mode
2   Multi-user mode console logins only (without networking)
3   Multi-User mode, console logins only
4   Not used/User-definable
5   Multi-User mode, with display manager as well as console logins (X11)
6   Reboot

Make it happen – Automate things become a senior software engineer

Categories
Unix

How to find executable command in unix ?

Type the following :

whereis 
Categories
AWS REDIS Unix

How to install redis on AWS unix ec2 instance ?

 $ vi /etc/yum.repos.d/epel.repo

 [epel]
 name=Extra Packages for Enterprise Linux 6 - $basearch
 baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
 failovermethod=priority
 enabled=1
 gpgcheck=0
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Step 2: Clean all yum repo and update repolist:

$ yum clean all
$ yum repolist

Step 3: Install Redis on the server by running command

$ yum install redis 

Step 4: Check redis status

service redis status

service redis start
service redis stop
service redis restart

Categories
Unix

How to find out Unix release version ?

cat /etc/*elease
Categories
Unix

How to fix CURL error setting certificate verify locations ?

error setting certificate verify locations:
CAfile: /usr/local/etc/openssl/cert.pem
CApath: /usr/local/etc/[email protected]/certs

To fix this issue find my solution below

ln -s  /usr/local/etc/openssl\@1.1 /usr/local/etc/openssl

Create a symbolic link toward the folder researched

Categories
Hacker Unix Web Server

How to harden files permission wordpress ?

Files

find . -type f -print0 | xargs -0 chmod 0400

Directory

find . -type d -print0 | xargs -0 chmod 0500
Categories
Hacker Security Unix Web Server

Files Permission – Unix Server

  • Folders – 755
  • Files – 644
  • wp-config.php – 600
  • .htaccess – 644, or 600

Unix command for directories 755

find . -type d -print0 | xargs -0 chmod 0755
sudo find . -type d -print0 | sudo xargs -0 chmod 0755

Unix command for files 644

find . -type f -print0 | xargs -0 chmod 0644
sudo find . -type f -print0 | sudo xargs -0 chmod 0644

Find hacked files

grep -r --include=*.php -e '[[:alnum:]\/\+]\{137,\}'

Categories
MySql SQL Unix

Import CSV data to mysql

Fastest way to import data over time found to be csv format data

mysql> load data local infile 'Desktop/data.csv'
-> INTO TABLE cars
-> FIELDS TERMINATED BY ','
-> ENCLOSED BY '"'
-> LINES TERMINATED BY '\n'
-> IGNORE 1 ROWS;
Query OK, 232880 rows affected, 65535 warnings (27.87 sec)
Records: 232880 Deleted: 0 Skipped: 0 Warnings: 232880

Categories
Unix

“continue” targeting switch is equivalent to “break”.

  PROBLEM

[ErrorException]                                                                         
  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

SOLUTION

composer self-update
composer update