Skip to content

Instantly share code, notes, and snippets.

View yohangdev's full-sized avatar
🏠
Working from home

Yoga Hanggara yohangdev

🏠
Working from home
View GitHub Profile
@yohangdev
yohangdev / create_self_signed_ssl_certificate.sh
Last active October 28, 2016 02:13
Create Self Signed SSL Certificate in one line command
openssl req -x509 -newkey rsa:4096 -keyout ssl_key.pem -out ssl_cert.pem -days 1024 -nodes
@yohangdev
yohangdev / case_study01.md
Last active April 7, 2017 06:46
Workshop Array Operations

Input:

$users = ['Asep Dadang Supriadi', 'Akmal Fuady', 'Yandi Fitriyanto'];

$users_new = ['Ricky Andika Putra', 'Ramadani'];

Result:

$results = ['Asep Dadang Supriadi', 'Akmal Fuady', 'Yandi Fitriyanto', 'Ricky Andika Putra', 'Ramadani'];
@yohangdev
yohangdev / jekyll_collections_pagination.html
Created April 18, 2017 17:06
Jekyll Collections Pagination
{% for c in site.tripcollection %}
{% if c.title == page.title %}
{% assign thisPost = c %}
{% if forloop.index == 1 %}
{% assign prevflag = 0 %}
{% assign nextflag = 1 %}
{% elsif forloop.index == forloop.length %}
{% assign prevflag = 1 %}
{% assign nextflag = 0 %}
{% else %}
@yohangdev
yohangdev / etc-network-interfaces
Last active May 27, 2024 07:15
Proxmox single IP public with bridge/local network (NAT)
# source: https://raymii.org/s/tutorials/Proxmox_VE_One_Public_IP.html
iface eth0 inet manual
iface eth1 inet manual
auto vmbr0
iface vmbr0 inet static
address 163.172.103.199
netmask 255.255.255.0
@yohangdev
yohangdev / lvm.sh
Last active May 15, 2017 02:57
Setup Proxmox with LVM
# https://pve.proxmox.com/wiki/Extending_Local_Container_Storage
fdisk -l
fdisk /dev/sdb
write new partition dos (default value)
create new partition
change partition as LVM (8e)
# http://www.thegeekstuff.com/2010/08/how-to-create-lvm/
apt-get install lvm2
pvcreate /dev/sdb1 /dev/sdc1
@yohangdev
yohangdev / mysql_create_database.sql
Created May 4, 2017 13:30
Let MySQL users create databases, but allow access to only their own databases
GRANT ALL PRIVILEGES ON `testuser\_%` . * TO 'testuser'@'%';
@yohangdev
yohangdev / server.conf
Created May 5, 2017 00:20
OpenVPN Config, Port 443, UDP, LDAP, Routing, No Redirect Gateway
port 443
proto udp
#port-share 10.1.14.55 4443
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
@yohangdev
yohangdev / ssh-config
Created May 13, 2017 17:02
SSH Config Disable Strict Host Key Checking
Host *
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
{
"color_scheme": "Packages/User/SublimeLinter/One Dark (SL).tmTheme",
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"highlight_line": true,
"hot_exit": false,
"ignored_packages":
[
"Vintage"
@yohangdev
yohangdev / debian_clean_mysql.sh
Last active November 17, 2019 13:09
Debian Clean Remove MySQL
apt-get remove --purge mysql\*
dpkg -l | grep -i mysql
apt-get clean
updatedb
UPDATE mysql.user SET plugin = 'mysql_native_password' where host='localhost' and user='root';