Skip to content

Instantly share code, notes, and snippets.

View neilpalima's full-sized avatar

Neil Palima neilpalima

  • Mamburao, Occidental Mindoro, Philippines
View GitHub Profile
@neilpalima
neilpalima / PrivateRoute
Created April 11, 2021 02:55
Sample authenticated router using react-router-dom
import React from 'react';
import {
Route,
Redirect,
RouteProps,
} from "react-router-dom";
import { useAppSelector } from 'app/hooks';
import { selectAuth } from 'features/authentication/authSlice';
@neilpalima
neilpalima / gist:d439273d8d86eaf1a2cbc21009fe0fbd
Created March 28, 2021 00:34
How to renew letsencrypt certificate
1. certbot --nginx certonly -n -d domain1.com
2. update the certificate on nginx config of the domain in /etc/nginx/conf.d
3. sudo service nginx restart
source: https://certbot.eff.org/docs/using.html#renewing-certificates
@neilpalima
neilpalima / gist:596ccd4fba7a18d48494a4438c050508
Last active April 27, 2020 08:54
Mount S3 bucket as filesystem on AWS ECS container
sudo yum install -y gcc libstdc+-devel gcc-c+ fuse fuse-devel curl-devel libxml2-devel mailcap automake openssl-devel git gcc-c++
git clone https://github.com/s3fs-fuse/s3fs-fuse
cd s3fs-fuse/
./autogen.sh
./configure --prefix=/usr --with-openssl
make
sudo make install
docker plugin install rexray/s3fs:latest S3FS_REGION=us-east-1 S3FS_OPTIONS="allow_other,iam_role=auto,umask=000" LIBSTORAGE_INTEGRATION_VOLUME_OPERATIONS_MOUNT_ROOTPATH=/ --grant-all-permissions
Setup nginx: https://www.nginx.com/blog/setting-up-nginx/
Setup letscrypt: https://medium.com/@victorleungtw/enable-https-on-aws-ec2-instance-with-node-js-and-nginx-on-ubuntu-server-15dad4864e11
// Item 1
var foo = 'hello';
(function() {
var foo = foo || 'world';
console.log(foo);
})();
// Question: What is the value of foo?