Skip to content

Instantly share code, notes, and snippets.

View todiadiyatmo's full-sized avatar

Todi Adiyatmo Wijoyo todiadiyatmo

View GitHub Profile
ifconfig-push 10.8.0.254 255.255.255.0
# Biar bisa lewat belakang router
# tambahkan juga route ke 2 network dibawah untuk routing via 10.8.0.1
iroute 10.9.0.0 255.255.255.0
iroute 10.10.0.0 255.255.255.0
@todiadiyatmo
todiadiyatmo / my.cnf
Last active December 1, 2015 03:03
my.cnf
[mysqld]
max_allowed_packet=268435456
open_files_limit=10000
local-infile=0
innodb_file_per_table=1
max_connections =256
query_cache_type = 1
query_cache_size = 256M
#!/bin/sh
# If you customize the contents of this wrapper script, place
# a copy at /var/cpanel/conf/apache/wrappers/php5
# so that it will be reinstalled when Apache is updated or the
# PHP handler configuration is changed
user=$(whoami)
if [ $user = "cobatong" ] || [ $user = "wifiidhu" ] ;
@todiadiyatmo
todiadiyatmo / gitlab.md
Last active October 5, 2015 02:37
gitlab
\DB::listen(function($sql, $bindings, $time) {
				    var_dump($sql);
				    var_dump($bindings);
				    var_dump($time);
				});
die();

SSH

cd /to_vagrant_dir/
vagrant ssh
@todiadiyatmo
todiadiyatmo / docker.md
Last active October 5, 2015 09:51
Docker

Pull

docker pull [OPTIONS] NAME[:TAG]

Run

 docker run --name your_name -d -p 9200:9200 -p 9300:9300 -v "$PWD/config":/usr/share/elasticsearch/config -v "$PWD/esdata":/usr/share/elasticsearch/data elasticsearch

Basic

  1. Index -> Database
  2. Type -> Table
  3. Field -> Column
localhost:9200/[index]/[type]
@todiadiyatmo
todiadiyatmo / speedbench.sh
Created October 25, 2015 00:49
speedbench
#!/bin/bash
#
# speedbench.sh v2.0 - extended VPS benchmark script
# based on freevps.us benchmark script (http://freevps.us/bench.sh)
# and speedtest-cli (https://github.com/sivel/speedtest-cli)
# credits goes to bench.sh and speedtest-cli respective author
#
depschk=1
if ! which python &>/dev/null;
@todiadiyatmo
todiadiyatmo / convert.sh
Last active November 5, 2015 02:24
ffmpeg gif converter
#!/bin/sh
# ./convert.sh video.mp4 video
palette="/tmp/palette.png"
filters="fps=4,scale=480:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen=stats_mode=diff" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse=dither=none" -y "$2.gif"
ffmpeg -i $1 "$2.webm"