Skip to content

Instantly share code, notes, and snippets.

View goyuninfo's full-sized avatar

goyun.info goyuninfo

View GitHub Profile
# Use Oracle Linux base image https://hub.docker.com/_/oraclelinux/
FROM oraclelinux:8.2
# Enable Extra Packages for Enterprise Linux (EPEL)
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# Install Node.js and npm
RUN dnf install -y nodejs npm
dnf install -y dnf-utils zip unzip
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf install -y docker-ce --nobest
#!/bin/bash
# Set Security Group id. ID is better than name if not in default VPC
SG_ID="sg-goyun"
# Retrieve current IP address
IP=`curl -s http://checkip.amazonaws.com/`
# Authorize access on ports 22
aws ec2 authorize-security-group-ingress --group-id "$SG_ID" --protocol tcp --port 22 --cidr "$IP/32"
@goyuninfo
goyuninfo / setup.ps1
Last active September 29, 2020 19:05
Setup development environment on Windows 10
# Enable the Windows Subsystem for Linux
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# Enable Virtual Machine feature
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# Fix windows problem
dism /online /cleanup-image /restorehealth
sfc /scannow
-- Grant read-only permission to the MySQL user
-- Copy the following command and paste them into a MySQL shell.
GRANT SELECT, SHOW VIEW ON $database_name.* TO $user@'127.0.0.1' IDENTIFIED BY '$password';
FLUSH PRIVILEGES;
#---------------------------------------------------#
#-- Detect Ubuntu Version....
#---------------------------------------------------#
version=$(lsb_release -sd)
codename=$(lsb_release -sc)
echo
/bin/echo -e "\e[1;33m |-| Detecting Ubuntu version \e[0m"
if [[ "$version" = *"Ubuntu 16.04"* ]];
@goyuninfo
goyuninfo / proxy.pac
Last active December 10, 2020 00:49
proxy.pac
function FindProxyForURL(url, host) {
var useSocks1080 = ["jenkins"];
var useSocksAzure = ["canadacentral.cloudapp.azure.com:3389"];
for (var i= 0; i < useSocksAzure.length; i++) {
if (shExpMatch(host, useSocksAzure[i])) {
return "SOCKS useSocksAzure:51080";
}
}
static void bubbleSort(int[] lst) {
int n = lst.length;
boolean swapped;
do
{
swapped = false;
for (int i = 0; i < n-1; i++) {
if (lst[i] > lst[i+1]) {
int temp = lst[i];
lst[i] = lst[i+1];
static void selectionSort(int[] lst) {
// get the length
int n = lst.length;
for (int i = 0; i < n; i++) {
int index = 0;
int smallest = lst[i];
for (int j = i; j < n; j++) {
if (lst[j] < smallest) {
smallest = lst[j];
index = j;