Skip to content

Instantly share code, notes, and snippets.

View billyriantono's full-sized avatar
:octocat:
git commit -m "Welcome"

Billy R billyriantono

:octocat:
git commit -m "Welcome"
  • Around the world
View GitHub Profile
@billyriantono
billyriantono / add_vhost.sh
Created August 19, 2014 17:38
Create / Add Vhost script for Ubuntu
#!/usr/bin/env bash
#
# Nginx - new server block
# http://rosehosting.com
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
die() { echo -e '\e[1;31m'$1'\e[m'; exit 1; }
# Variables
/***** Draggable Library *****/
angular.module('itsADrag',['ngSanitize'])
/**
Possible element attributes:
1. template
2. id
3. options - json of jquery ui draggable options
4. group
@billyriantono
billyriantono / install_node.sh
Last active August 29, 2015 14:05
Automatic Installing NodeJS in your Linux Machine
#!/usr/bin/env bash
#
# Install Automatically Node JS v 0.10
# by Billy Riantono - billy[ at ]riantono.com
# Variables
NODE_INSTALL_DIR='/opt/nodejs/'
NODE_DOWNLOAD_URL='http://nodejs.org/dist/v0.10.31/node-v0.10.31-linux-x64.tar.gz'
#function
@billyriantono
billyriantono / dnsmasq.conf
Last active March 19, 2018 13:55
/etc/init.d/vpnserver file for softether using Local Bridge
interface=tap_soft
dhcp-range=tap_soft,192.168.100.50,192.168.100.60,24h
dhcp-option=tap_soft,3,192.168.100.1
dhcp-option=tap_soft,option:dns-server,165.21.83.88,165.21.100.88
@billyriantono
billyriantono / hello_angular.html
Created August 27, 2014 10:14
My First on Learning AngularJS
<html ng-app='app'>
<head>
<title>Hello World Angular</title>
<script src="yourjavascriptfolder/angular.min.js" type="text/javascript"></script>
</head>
<body>
<h1>{{hello}}</h1>
</body>
</html>
@billyriantono
billyriantono / angular-stringFormat.js
Created August 29, 2014 08:51
angular Factory for String Format , so you can use .Net String Format Mode in your Angular javascript file. based on : https://github.com/ST-Software/Scripts/blob/master/Angular%20Modules/src/stringFormatterModule.js
angular.module('myApp.stringFormat',[])
.factory('stringFormat', function () {
var stringFormat = {};
stringFormat.formatString = function(format,values){
var result = '';
for (var i = 0; ; ) {
// Find the next opening or closing brace
var open = format.indexOf('{', i);
@billyriantono
billyriantono / squid
Last active January 31, 2019 08:46
/etc/init.d/squid file
#!/bin/bash
# squid This shell script takes care of starting and stopping
# Squid Internet Object Cache
#
# chkconfig: - 90 25
# description: Squid - Internet Object Cache. Internet object caching is \
# a way to store requested Internet objects (i.e., data available \
# via the HTTP, FTP, and gopher protocols) on a system closer to the \
# requesting site than to the source. Web browsers can then use the \
# local Squid cache as a proxy HTTP server, reducing access time as \
@billyriantono
billyriantono / squid.conf
Last active March 30, 2016 10:33
Squid Lusca Auto Installer for CentOS
###########################################################
# Squid_LUSCA configuration Starts from Here ... #
# Thanks to some Indoensian friends for sharing Configs #
# Syed.Jahanzaib / 22nd April, 2014 #
# https://aacable.wordpress.com / aacable@hotmail.com #
###########################################################
# HTTP Port for SQUID Service
http_port 143 transparent
server_http11 on
@billyriantono
billyriantono / apply-optimize.sh
Created September 26, 2014 14:17
Optimize Server for Node.JS
#!/bin/bash
#
# Apply Optimize for Sysctl v 0.10
# by Billy Riantono - billy[ at ]riantono.com
#get optimalization config for sysctl
wget https://gist.githubusercontent.com/kotekalabs/657dad656248d774259d/raw/5619fbbcbde469e8645564629966ea223e3722b4/optimize-sysctl.conf
#applied the config to sysctl.conf
cat optimize-sysctl.conf >> /etc/sysctl.conf
@billyriantono
billyriantono / simpler_siege.sh
Last active August 29, 2015 14:06
Simpler Siege
#!/bin/bash
# Simpler Script to running Siege
# by Billy Riantono - billy[ at ]riantono.com
#function
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
#Download Siege
ok "Checking Siege ...."
if [ ! -f /usr/bin/siege ]; then