Skip to content

Instantly share code, notes, and snippets.

View enqtran's full-sized avatar

enqtran enqtran

View GitHub Profile
1. requirements
Apache >= 2.2
PHP >= 5.5
MySQL/MariaDB >= 5.5
Step 1 – Enable Remi Repository
### CentOS/RHEL 7 ###
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
### CentOS/RHEL 6 ###
vim /etc/httpd/conf.d/expire.conf
<IfModule mod_expires.c>
# Turn on the module.
ExpiresActive on
# Set the default expiry times.
ExpiresDefault "access plus 2 days"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
sync; echo 1 > /proc/sys/vm/drop_caches
sync; echo 2 > /proc/sys/vm/drop_caches
sync; echo 3 > /proc/sys/vm/drop_caches
crontab -l
0 * * * * sync; echo 3 > /proc/sys/vm/drop_caches
free -m
<VirtualHost *:80>
ServerName www.domain.org
DocumentRoot /var/www/html/domain
ServerAlias domain.org
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} = www.domain.org.org [OR]
- The default will restrict you to a max 2 MB upload file size.
- upload_max_filesize – The maximum size of an uploaded file.
- memory_limit – This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written - scripts for eating up all available memory on a server. Note that to have no memory limit, set this directive to -1.
post_max_size – Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.
---------------------------------------
- There are two methods two fix this problem.
* 1: Edit php.ini
Edit your php.ini file (usually stored in /etc/php.ini or /etc/php.d/cgi/php.ini or /usr/local/etc/php.ini):
iptables -I INPUT -p tcp -m tcp --dport 3000 -j ACCEPT
service iptables save
service iptables restart
iptables -L -n
sudo yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_11.x | sudo -E bash -
sudo yum install -y nodejs
node -v
npm -v
import axios from "axios";
const open_download_file = async (url, file_name) => {
return await axios({
url: url,
method: 'GET',
responseType: 'blob', // important
onDownloadProgress: (progressEvent) => {
const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
console.log(`download ${percentCompleted}%`);
When a Node.js process is launched, it runs:
One process
One thread
One event loop
One JS Engine Instance
One Node.js Instance
One process: a process is a global object that can be accessed anywhere and has information about what’s being executed at a time.
One thread: being single-threaded means that only one set of instructions is executed at a time in a given process.
Every Layout will teach you how to better harness the built-in algorithms that power browsers and CSS.
The Stack
The Box
The Center
The Cluster
The Sidebar
The Switcher
The Cover
The Grid