Skip to content

Instantly share code, notes, and snippets.

View mgmgpyaesonewin's full-sized avatar
🐒
coding

Pyae Sone Win mgmgpyaesonewin

🐒
coding
View GitHub Profile
@mgmgpyaesonewin
mgmgpyaesonewin / gist:30d9f825bcb73b060a6d243ec80b8a2b
Created March 12, 2024 17:35
sudo chown -R $USER /var/www/crawler/
ubuntu@ip-172-31-32-251:/var/www/crawler$ npm install
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /var/www/crawler/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/var/www/crawler/node_modules'
npm ERR! [Error: EACCES: permission denied, mkdir '/var/www/crawler/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
@mgmgpyaesonewin
mgmgpyaesonewin / gist:f5c5db76b6e3a455e0679abbdca8e6b8
Created July 25, 2023 05:22
npm install Error: EACCES: permission denied, access '/var/www/html' laravel
my full solution was:
sudo chown -R $USER /var/www/html
sudo chown -R www-data:www-data /var/www/html/storage/framework
@mgmgpyaesonewin
mgmgpyaesonewin / gist:e8e18c3eca6af2f06ec39aeabea04678
Created April 20, 2023 03:04
The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
# Run the following to solve the The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
sudo chown -R $USER:www-data storage
sudo chown -R $USER:www-data bootstrap/cache
chmod -R 775 storage
chmod -R 775 bootstrap/cache
@mgmgpyaesonewin
mgmgpyaesonewin / nginx.conf
Created August 4, 2022 07:16
reverse proxy for multiple server nginx
upstream preprod-apim-am.wavemoney.io {
server localhost:3000;
}
upstream preprod-apim-gw.wavemoney.io {
server localhost:4000;
}
server {
listen 80;
server_name preprod-apim-am.wavemoney.io;
@mgmgpyaesonewin
mgmgpyaesonewin / sample.java
Created June 27, 2022 10:48
Reading config in spring boot
@Value("${oracle-db.datasource.dbSchema}")
private String dbSchema;
@mgmgpyaesonewin
mgmgpyaesonewin / application.properties
Created June 27, 2022 10:36
Spring Application Config Sample
integrated-client:
agentIdMap:
AGENT: X112312
@mgmgpyaesonewin
mgmgpyaesonewin / Config.java
Created June 27, 2022 10:32
Reading Config Map in spring boot
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "integrated-client")
public class AgentIdMapConfig {
private Map<String, Long> agentIdMap;
@mgmgpyaesonewin
mgmgpyaesonewin / nginx.conf
Created June 8, 2022 03:35
Configuring Nginx to Proxy Requests your rest api
// Replace the port number with the port you used.The server_name should also be replaced with you domain name.
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com www.example.com ;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@mgmgpyaesonewin
mgmgpyaesonewin / nginx.conf
Created February 23, 2022 03:28
Enable Gzip compression in Laravel assets #laravel #php #nginx
In order to enable Gzip compression on your NGINX web server,
first open your NGINX's default configuration file: sudo vim /etc/nginx/nginx.conf,
and replace the existing Gzip settings with the following:
nginx.conf (you can modify the settings below according to your needs)
# Enable Gzip
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
https://marc.vos.net/howto/oracle-oci8/