Skip to content

Instantly share code, notes, and snippets.

View gnh1201's full-sized avatar
🍉
Your Watermelon OPEN UP!

Namhyeon, Go gnh1201

🍉
Your Watermelon OPEN UP!
View GitHub Profile
@gnh1201
gnh1201 / 0_reuse_code.js
Created August 30, 2016 11:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gnh1201
gnh1201 / boot_rails.sh
Last active November 17, 2016 18:04
Quickstart script for rails environment
# fork on https://github.com/rails/rails-dev-box/blob/master/bootstrap.sh
# The output of all these installation steps is noisy. With this utility
# the progress report is nice and concise.
function install {
echo installing $1
shift
apt-get -y install "$@" >/dev/null 2>&1
}
#echo adding swap file
utilhome@debian:~/opt/eclipse$ ./eclimd
/usr/bin/java -version
java version "9"
Java(TM) SE Runtime Environment (build 9+179)
Java HotSpot(TM) 64-Bit Server VM (build 9+179, mixed mode)
JAVA_VERSION=java version "9"
/usr/bin/java -d64 -Dosgi.requiredJavaVersion=1.8 [email protected]/eclipse-workspace -XX:+UseG1GC -XX:+UseStringDeduplication -Xms256m -Xmx1024m -jar /home/utilhome/opt/eclipse/plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar --launcher.suppressErrors -debug -clean -refresh -application org.eclim.application
Install location:
file:/home/utilhome/opt/eclipse/
#!/usr/bin/env bash
#
# Copyright 2017 Gustavo Arjones (@arjones)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/usr/bin/env bash
#
# Copyright 2017 Gustavo Arjones (@arjones)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/usr/bin/env bash
#
# Copyright 2017 Gustavo Arjones (@arjones)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/usr/bin/env bash
#
# Copyright 2017 Gustavo Arjones (@arjones)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/bin/bash
#
# Install script for Kafka 0.11.0.0 (Released June 28, 2017)
# writer: 2017 Go Namhyeon <[email protected]>
#
help()
{
echo "This script installs Kafka 0.11.0.0 (Released June 28, 2017)"
@gnh1201
gnh1201 / alwayshttps.js
Last active September 6, 2018 02:06
ALWAYS HTTPS
/**
* @file alwayshttps.js
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @author Go Namhyeon <[email protected]>
* @date: 2018-02-17
*/
function alwayshttps_replace_from(uri) {
return uri.replace("http://", "https://", uri);
}
@gnh1201
gnh1201 / create-mysql.bash
Last active March 9, 2018 04:39 — forked from omeinusch/create-mysql.bash
Simple bash script to create mysql db, user with generated password
#!/bin/bash
PASS=`pwgen -s 40 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $1 default character set utf8 COLLATE utf8_general_ci;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT