Skip to content

Instantly share code, notes, and snippets.

View hariadi's full-sized avatar
😱
Pemuda yang serius

Hariadi Hinta hariadi

😱
Pemuda yang serius
View GitHub Profile
@hariadi
hariadi / Preference.sublime-settings
Created June 5, 2015 07:50
Preference.sublime-settings
{
"auto_complete_selector": "source, text",
"color_scheme": "Packages/Colorsublime-Themes/themes/Facebook.tmTheme",
"font_size": 11,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"line_ending": "unix",
@hariadi
hariadi / adb
Created April 1, 2015 06:56
ADB push multiple file [Windows]
FORFILES [/p Path] [/m SrchMask] [/s] [/c Command] [/d [+ | -] {date | dd}]
Example 1:
forfiles /m "*.mp3" /c "cmd /c adb push @file /sdcard/mp3/"
Example 2:
forfiles /m "02*. *.mp4" /c "cmd /c adb push @file /sdcard/mp4/"
@hariadi
hariadi / reminder.php
Created March 11, 2015 11:55
HESK Reminder Snippet
<?php
/*******************************************************************************
* Title: HESK Reminderd
* Description: Send and email reminder to staff/operator when there are out standing ticket after 2 days
* Version: 2.5.2 from 14th June 2014
* Author: Hariadi Hinta
* Website: http://hariadi.org
*******************************************************************************/
define('IN_SCRIPT',1);
define('HESK_PATH', __DIR__ . '/');
@hariadi
hariadi / mysql_backup.sh
Created December 19, 2014 02:46
MySQL Backup
#!/bin/sh
# List of databases to be backed up separated by space
dblist="database1 database2 database3"
# Directory for backups
backupdir=/DIR/mysql_dumps
# Number of versions to keep
numversions=4
@hariadi
hariadi / syllabus.md
Last active August 29, 2015 14:08
Git
  1. Understanding version control

    • Local
    • centralized
    • distributed version control systems
  2. Understanding Git

    • diff with other version control
    • the three states
  3. Setup Git - Windows / Linux

@hariadi
hariadi / ssl.conf
Created June 11, 2014 00:48
My Perfect Apache SSL Config
SSLHonorCipherOrder On
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"
SSLProtocol all -SSLv2 -SSLv3
@hariadi
hariadi / openssl-ccs.pl
Last active August 29, 2015 14:02
Test for OpenSSL CVE-2014-0224
#!/usr/bin/perl -w
#
# Test for OpenSSL CVE-2014-0224
#
# This sends Change Cipher Spec record too early and observes server reply to
# see if it responds with alert (i.e. if it's patched)
#
#flow for a full handshake
#
# Client->Server: ClientHello
@hariadi
hariadi / AssetMaker.php
Created June 5, 2014 07:36
OctoberCMS: support external URL assets like Google CDN, Bootstrap CDN
<?php namespace System\Traits;
use HTML;
use File;
use Request;
use System\Models\Parameters;
use System\Models\PluginVersion;
use System\Classes\SystemException;
/**
@hariadi
hariadi / isogram.js
Created February 6, 2014 07:34
isogram
(function(arg1,arg2,arg3,arg4,arg5,arg6,arg7){arg1['GoogleAnalyticsObject']=arg5;arg1[arg5]=arg1[arg5]||function(){
(arg1[arg5].q=arg1[arg5].q||[]).push(arguments)},arg1[arg5].l=1*new Date();arg6=arg2.createElement(arg3),
arg7=arg2.getElementsByTagName(arg3)[0];arg6.async=1;arg6.src=arg4;arg7.parentNode.insertBefore(arg6,arg7)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXX-X', 'example.com');
ga('send', 'pageview');
@hariadi
hariadi / re-sync-mysql-replication.md
Last active August 29, 2015 13:56
Re-sync MySQL Replication

Re-sync MySQL Replication

Do this command in all server. In this example I'm use 2 server master-master replication

MASTER

RESET MASTER;
SHOW MASTER STATUS\G;