This file contains hidden or 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/systemd/system/pm2-undefined.service | |
| Change User=undefined | |
| To User=root | |
| > /www/server/panel/plugin/pm2/pm2_main.py | |
| change 'pm2 save && pm2 startup' | |
| to 'pm2 cleardump && pm2 save && pm2 startup -u root' |
This file contains hidden or 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
| # Set the base image for subsequent instructions | |
| FROM php:7.4 | |
| # Update packages | |
| RUN apt-get update | |
| # Install PHP and composer dependencies | |
| RUN apt-get install -qq git curl libmcrypt-dev libjpeg-dev libpng-dev libfreetype6-dev libbz2-dev libicu-dev zip | |
| # Clear out the local repository of retrieved package files |
This file contains hidden or 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
| CREATE TABLE IF NOT EXISTS `country` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `iso` char(2) NOT NULL, | |
| `name` varchar(80) NOT NULL, | |
| `nicename` varchar(80) NOT NULL, | |
| `iso3` char(3) DEFAULT NULL, | |
| `numcode` smallint(6) DEFAULT NULL, | |
| `phonecode` int(5) NOT NULL, | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
This file contains hidden or 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
| upload(files) { | |
| const config = { | |
| onUploadProgress: function(progressEvent) { | |
| var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total) | |
| console.log(percentCompleted) | |
| } | |
| } | |
| let data = new FormData() | |
| data.append('file', files[0]) |
This file contains hidden or 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
| # | |
| # This file provides an application definition that can be used with | |
| # PM2 ("Production Process Manager"). | |
| # | |
| # PM2 "allows you to keep applications alive forever, to reload them | |
| # without downtime and to facilitate common system admin tasks." | |
| # | |
| # Use this file by running it with PM2. For example: | |
| # $> pm2 start laravel-queue-worker.pm2.yml | |
| # |
This file contains hidden or 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
| required packages: | |
| networkmanager networkmanager-l2tp libreswan | |
| # IPsec Settings | |
| Enable IPsec tunnel to L2TP host => Pre-shared key | |
| enable Enforce UDP encapsulation | |
| (only if not working): | |
| #Phase 1 : 3des-sha1-modp1024 | |
| #Phase 2 : 3des-sha1 |
This file contains hidden or 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
| add_header X-Frame-Options "SAMEORIGIN"; | |
| add_header X-XSS-Protection "1; mode=block"; | |
| add_header X-Content-Type-Options "nosniff"; | |
| location / { | |
| try_files $uri $uri/ /index.php?$query_string; | |
| } | |
| location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ | |
| { |
This file contains hidden or 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
| # nginx.conf | |
| #user html; | |
| worker_processes 1; | |
| #error_log logs/error.log; | |
| #error_log logs/error.log notice; | |
| #error_log logs/error.log info; | |
| #pid logs/nginx.pid; |
This file contains hidden or 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
| https://laracasts.com/discuss/channels/laravel/query-builder-how-to-retrieve-records-for-every-date-in-range-even-if-data-is-not-there-for-some-dates | |
| // retrieve all dates even if they are empty. | |
| $dates = []; | |
| $period = new DatePeriod(new DateTime('2020-05-01'), new DateInterval('P1D'), new DateTime('2020-05-03 +1 day')); | |
| foreach ($period as $date) { | |
| $dates[] = $date->format("Y-m-d"); | |
| } | |
| var_dump($dates); | |
| // output : ["2020-05-01","2020-05-02","2020-05-03"] |