Skip to content

Instantly share code, notes, and snippets.

View nowk's full-sized avatar

Yung Hwa Kwon nowk

  • damncarousel
  • New York, NY
View GitHub Profile
@maxivak
maxivak / _0__ssl_certbot_letsencrypt.md
Last active July 12, 2024 22:22
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \
@jamieparfet
jamieparfet / macOS-mojave-iso.sh
Last active February 11, 2023 19:16
Create an ISO from the mojave installer app
#!/bin/bash
# This assumes that the ~6GB mojave installer is in the /Applications folder.
# If it's not, just open the App Store, search Mojave, and you can download the installer file from there.
hdiutil create -o /tmp/mojave.cdr -size 6g -layout SPUD -fs HFS+J
hdiutil attach /tmp/mojave.cdr.dmg -noverify -mountpoint /Volumes/install_mojave
sudo /Applications/Install\ macOS\ mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_mojave
mv /tmp/mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ mojave
@andywer
andywer / router-1.ts
Last active August 6, 2020 14:57
Koa: Passing data from middleware to route handler
/*
* Description:
*
* There are times when we want to re-use some data created/derived in a middleware later in a route handler.
*
* The default Koa way of doing so would be using `context.state`. Unfortunately `context.state` is hard to type and
* quite implicit, since it's an object shared and potentially mutated by all middlewares and the route handler.
*/
/*
@themanifold
themanifold / node-prune.sh
Last active October 1, 2022 02:47
Pruning useless node_modules with bash userland tools (find etc)
#!/usr/bin/env bash
find node_modules \( -name '__tests__' -o \
-name 'test' -o \
-name 'tests' -o \
-name 'powered-test' -o \
-name 'docs' -o \
-name 'doc' -o \
-name '.idea' -o \
-name '.vscode' -o \
-name 'website' -o \
@primaryobjects
primaryobjects / index.html
Last active July 10, 2023 16:24
Calling a React component's methods from outside of React. Demo https://plnkr.co/edit/E6lPrL331KGxoikGinFm?p=preview
<!DOCTYPE html>
<html>
<head>
<script data-require="jquery@3.1.1" data-semver="3.1.1" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script data-require="tether@*" data-semver="1.4.0" src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script>
<link data-require="bootstrap@4.0.5" data-semver="4.0.5" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" />
<script data-require="bootstrap@4.0.5" data-semver="4.0.5" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js"></script>
<script data-require="react@*" data-semver="15.5.0" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.0/react.min.js"></script>
<script data-require="react@*" data-semver="15.5.0" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.0/react-dom.min.js"></script>
@nowk
nowk / pomodor.js
Created April 6, 2017 02:29
Pomodor Inject Script for Everhour + E.ggtimer
// Testined using https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld
var runningTimer = false;
var longBreakCount = 4;
var pomodoroTime = "25minutes";
var shortBreakTime = "5minutes";
var longBreakTime = "15minutes";
var countPomodoro = function() {
@nrollr
nrollr / nginx.conf
Last active June 9, 2024 23:39
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
var username = '';
var password = '';
var encoded_credentials = new Buffer(username + ':' + password).toString('base64');
fetch('https://example.com', { method: 'POST', headers: {'Authorization': 'Basic ' + encoded_credentials} })
.then(function(res) {
return res.json();
})
.then(function(body) {
@minazou67
minazou67 / howto-upgrade-debian-jessie-kernel.md
Last active August 13, 2019 18:13
How to upgrade the Linux Kernel of debian 8 jessie

How to upgrade the Linux Kernel of debian 8 jessie

Debian 8 のカーネルをアップグレードする方法です。

Environment

  • Microsoft Windows Server 2012 R2
  • Hyper-V
  • Debian 8.2 jessie