Skip to content

Instantly share code, notes, and snippets.

View jeremysu0131's full-sized avatar

Jeremy jeremysu0131

  • Taiwan
View GitHub Profile
@jeremysu0131
jeremysu0131 / db_backup.sh
Last active January 11, 2022 07:29 — forked from NARKOZ/db_backup.sh
MySQL backup shell script
#!/bin/bash
# Shell script to backup MySQL database
# Set these variables
MyUSER="" # DB_USERNAME
MyPASS="" # DB_PASSWORD
MyHOST="" # DB_HOSTNAME
# Backup Dest directory
DEST="" # /home/username/backups/DB
@jeremysu0131
jeremysu0131 / $steps.md
Last active January 11, 2022 07:33
Laravel 8 debug in docker for vscode / phpstorm

Prerequire:

Make sure you have the docker-compose.yml that generate by default

generate docker file

Execute the following script will generate a dockerfile under root directory

php artisan sail:publish
# Before using this file, install antigen first https://github.com/zsh-users/antigen
# Source antigen first
source /usr/local/share/antigen/antigen.zsh
# This set dircolors
# Remove the following setting if you want to use this in Linux
# export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
# export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
export TERM="xterm-256color"
# eval $(gdircolors $HOME/.dir_colors/dircolors.256dark)
@jeremysu0131
jeremysu0131 / mac_proxy_script.sh
Last active June 7, 2019 04:08
Put the following code in your .bashrc or .zshrc then use set_proxy and unset_proxy to set/unset your Mac's proxy
set_proxy(){
# This set web proxy (http)
# networksetup -setwebproxy <networkservice> <domain> <port number> <authenticated> <username> <password>
sudo networksetup -setwebproxy "Wi-Fi" 127.0.0.1 3000
# This set secure web proxy (https)
# networksetup -setsecurewebproxy <networkservice> <domain> <port number> <authenticated> <username> <password>
sudo networksetup -setsecurewebproxy "Wi-Fi" 127.0.0.1 3000
echo "Proxy enabled."
@jeremysu0131
jeremysu0131 / Binary-Search-Tree.js
Last active June 7, 2018 15:19
Binary Search Tree
function BinarySearchTree() {
function Node(key) {
this.key = key;
this.left = null;
this.right = null;
}
let root = null;
@jeremysu0131
jeremysu0131 / nginx.conf
Created May 4, 2018 01:33 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="AngularJS Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />