Skip to content

Instantly share code, notes, and snippets.

Iyan Kushardiansah iyank4

View GitHub Profile
View Docker http access to minikube registry
On Mac
Enable the minikube registry
$ minikube addons enable registry
find the registry IP
$ kubectl get services -n kube-system
kube-dns ClusterIP <none> 53/UDP,53/TCP,9153/TCP 18h
kubernetes-dashboard ClusterIP <none> 80/TCP 18h
View gist:02c11742244733e25f12
renaming thumb1_ to thumb_ with single line, tested on cygwin
$ for i in thumb1_*; do mv ${i} ${i/#thumb1_/thumb_}; done
iyank4 / double-subquery
Created Jul 17, 2014
Simple SQL Select with Group and Order By Specific Column
View double-subquery
SELECT * the_table
ORDER BY created_at_field DESC
) t
GROUP BY t.id_field
-- On MySQL with InnoDB engine this query was returning the expected result, but i have no idea with another database and engine.
-- Hopefully this trick would work, tell me if it's not. And maybe you can use more complex query as explined on stackoverflow or others.
iyank4 / httpd-vhosts.conf
Created Mar 12, 2014
XAMPP multi php setup, place PHP folder to php52, php53, php54 and php55
View httpd-vhosts.conf
# here: Listen 80
<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "C:/webserver"
<VirtualHost php52.local:80>
ServerName php52.local
DocumentRoot "C:/webserver"
iyank4 / mysql-user-privileges
Last active Jan 3, 2016
Automate grant or revoking privileges of one MySQL user to multiple databases.
View mysql-user-privileges
# Script to automate adding and removing privileges from several databases to specific MySQL user
# Author: Iyan Kushardiansah <>
# Date: 2014-01-13
# MySQL user used for backup
iyank4 / js_autoresize_iframe.html
Created Sep 15, 2013
Javascript Autoresize iframe.
View js_autoresize_iframe.html
<iframe id="myID" src="THE_URL" width="100%" height="20" frameborder="0"></iframe>
function setIframe() {
$("#dsct").animate({height: $("#dsct").contents().height()+"px"}, 500)
$("#myID").load(function() {
setIframe(); // got false height, so we need to execute again after 1 second
setTimeout(function(){ setIframe() },1000);
iyank4 / Regex merapikan script PHP
Last active Dec 21, 2015
Search Replace Regex untuk merapikan kode PHP yang berantakan di Sublime Text
View Regex merapikan script PHP
Lakukan beberapa kali, hingga semuanya di replace.
Search | Replace
([a-z_]+);(\n[ ]*)echo => $1. | di search paling belakang kasih 1 spasi setelah echo
>(\n[ ]*)"; => >";
iyank4 / gist:5726882
Created Jun 7, 2013
Script to start MySQL workbench if WB cannot communicate with gnome-keyring-daemon
View gist:5726882
iyank4 /
Created Apr 25, 2013
Script for dump and compress some mysql database
WAKTU=$(date +%Y%m%d_%H%I%S_%Z)
if [ -f alldump.sql ];
rm alldump.sql
if [ -f alldump.sql.tar.gz ];
iyank4 / debian-virtual-host-replace-php-handler
Last active Dec 16, 2015
Replace default php handler, with another PHP-CGI version
View debian-virtual-host-replace-php-handler
<VirtualHost *:80>
ServerName php52
DocumentRoot /home/iyank4/www
ScriptAlias /cgi-bin/ /home/iyank4/www/cgi-bin/
<FilesMatch ".+\.ph(p[345]?|t|tml)$">
SetHandler None
You can’t perform that action at this time.