This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/sysctl.conf | |
net.core.somaxconn = 8192 | |
net.ipv4.tcp_max_syn_backlog = 8192 | |
// mysql | |
Connection failed: SQLSTATE[HY000] [1040] Too many connections | |
Connection failed: SQLSTATE[HY000] [2002] Resource temporarily unavailable | |
fix: | |
/etc/systemd/system/mysql.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mysql 8 / mariadb 10.11 | |
mysql -u root | |
CREATE DATABASE <database_name> CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; | |
CREATE DATABASE <database_name> CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; | |
CREATE USER '<username>'@'localhost' IDENTIFIED BY '<password>'; | |
GRANT ALL PRIVILEGES ON <database_name>.* TO '<username>'@'localhost'; | |
flush privileges; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wp_query; | |
$wp_query->set_404(); | |
status_header(404); | |
include '404.php'; | |
exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In Windows environment, the error is occured when executing "gem install compass" in cygwin. | |
$ gem install compass | |
ERROR: While executing gem ... (ArgumentError) | |
invalid byte sequence in UTF-8 | |
How to solve: | |
1) open C:\cygwin\usr\share\ruby\2.0.0\win32\registry.rb | |
(change to your version when necessary) | |
2) comment out line 172 and change "\r" to "\r\n" in line 173 (line numbers may vary) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// original code is from http://stackoverflow.com/questions/7489742/php-read-exif-data-and-adjust-orientation | |
function image_fix_orientation($path){ | |
$image = imagecreatefromjpeg($path); | |
$exif = exif_read_data($path); | |
if (!empty($exif['Orientation'])) { | |
switch ($exif['Orientation']) { | |
case 3: |
NewerOlder