Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Edi Septriyanto joglomedia

I may be slow to respond.
View GitHub Profile
joglomedia / Setup SSH Key for Remote Server Password-less Login
Last active Jan 31, 2020
How to generate an SSH key and add public key to the server for authentication
View Setup SSH Key for Remote Server Password-less Login
## Generate a new SSH key
Follow this command, ensure that you change your-identifier with your own, it could be an unique name or email address (recommended)
$ ssh-keygen -t rsa -b 4096 -C "your-identifier"
An output from those command look like below.
If asked, simply press enter to follow the suggested value (/home/yours/.ssh/id_rsa)
joglomedia / Dockerfile
Created Jan 31, 2020 — forked from avishayp/Dockerfile
Add non-root user for alpine linux
View Dockerfile
# non root user example for alpine
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
FROM alpine
ARG USER=default
joglomedia /
Created Dec 18, 2019 — forked from denji/
NGINX tuning for best performance

Moved to git repository:

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

cfg.parser () {
fixed_file=$(cat $1 | sed 's/ = /=/g') # fix ' = ' to be '='
IFS=$'\n' && ini=( $fixed_file ) # convert to line-array
ini=( ${ini[*]//;*/} ) # remove comments
ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix
ini=( ${ini[*]/%]/ \(} ) # convert text2function (1)
ini=( ${ini[*]/=/=\( } ) # convert item to array
ini=( ${ini[*]/%/ \)} ) # close array parenthesis
ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2)
ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis
joglomedia / gitio
Created Dec 9, 2019 — forked from defunkt/gitio
Turn a URL into a URL.
View gitio
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
# Turns a URL
# into a URL
# Copies the URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
joglomedia /
Created Sep 16, 2019 — forked from subfuzion/
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

joglomedia / my.cnf
Created Aug 31, 2019 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
View my.cnf
# Optimized my.cnf configuration for MySQL/MariaSQL
# by Fotis Evangelou, developer of Engintron (
# === Updated December 2018 ===
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
joglomedia /
Created Jun 23, 2019 — forked from skamithi/
Bash script to detect if SSH port is active on remote host. Used it orchestrating vm creation using ansible.
# Script for checking if SSH port is open
# Only checks that port is open. Not that actually SSH connection can occur
result="ssh disabled"
if [ -z "$1" ]
echo "hostname argument required. Example"
# bash generate random alphanumeric string
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
joglomedia / jquery.iframe_to_div.js
Created May 30, 2019 — forked from aklump/jquery.iframe_to_div.js
A jQuery plugin to replace iframes with divs containing their source by loading via ajax. Benefits use parent page's css and have an auto height to your iframe.
View jquery.iframe_to_div.js
* Convert iframes to divs via ajax iframe_to_div jQuery Plugin
* Uses javascript to replace iframes with divs containing their source content
* by loading via ajax. If you use this to load vanilla html snippets, this has the
* effect of applying the page's css to your vanilla html snippet.
* This will not work if the iframe src is not a relative link due to ajax restrictions across domains.
* As an example: