Skip to content

Instantly share code, notes, and snippets.

Iyan Kushardiansah iyank4

Block or report user

Report or block iyank4

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 18h
kubernetes-dashboard ClusterIP 10.104.90.254 <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
iyank4 / double-subquery
Created Jul 17, 2014
Simple SQL Select with Group and Order By Specific Column
View double-subquery
SELECT * FROM
(
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
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>
<VirtualHost php52.local:80>
ServerName php52.local
DocumentRoot "C:/webserver"
@iyank4
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
#!/bin/bash
#
# Script to automate adding and removing privileges from several databases to specific MySQL user
# Author: Iyan Kushardiansah <iyank4@gmail.com>
# Date: 2014-01-13
#
# MySQL user used for backup
MYSQL_USER="backup4"
@iyank4
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>
<script>
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
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
iyank4 / gist:5726882
Created Jun 7, 2013
Script to start MySQL workbench if WB cannot communicate with gnome-keyring-daemon
View gist:5726882
#!/bin/bash
export WB_NO_GNOME_KEYRING=1
mysql-workbench
@iyank4
iyank4 / mysqldump-with-time.sh
Created Apr 25, 2013
Script for dump and compress some mysql database
View mysqldump-with-time.sh
#!/bin/sh
WAKTU=$(date +%Y%m%d_%H%I%S_%Z)
if [ -f alldump.sql ];
then
rm alldump.sql
fi
if [ -f alldump.sql.tar.gz ];
@iyank4
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
</FilesMatch>
You can’t perform that action at this time.