Do this command in all server. In this example I'm use 2 server master-master replication
RESET MASTER;
SHOW MASTER STATUS\G;
Handlebars.registerHelper('toK', function(number) { | |
number = number+''; | |
if (number < 1000) { | |
return number; | |
} else if (number < 10000) { | |
return number.charAt(0) + ',' + number.substring(1); | |
} else { | |
return (number/1000).toFixed(number % 1000 != 0)+'k'; | |
} | |
}); |
#!/bin/bash | |
#sync.sh - Push site updates from master server to front end web servers via rsync | |
# USAGE: | |
# ./sync.sh (rsync all node) | |
# ./sync.sh portal2 portal4 (rsync for node portal2 and portal4) | |
# | |
# Original script: http://www.stephenlang.net/2012/09/keeping-multiple-web-servers-in-sync-with-rsync/ | |
WEBSERVERS=(${@-portal1 portal2 portal3 portal4 portal5}) | |
STATUS="/srv/www/htdocs/sync.status" |
fs = require('fs'); | |
function getDirectoryFiles(directory, callback) { | |
fs.readdir(directory, function(err, files) { | |
files.forEach(function(file){ | |
fs.stat(directory + '/' + file, function(err, stats) { | |
if(stats.isFile()) { | |
callback(directory + '/' + file); | |
} | |
if(stats.isDirectory()) { |
<%@ LANGUAGE="VBSCRIPT" %> | |
<% Option Explicit %> | |
<% | |
'Test online: http://www.interactive.jpa.gov.my/smp/hrmis.asp | |
Dim counter, myArray, parameter, important, notimportant, weneed, userandpass, user, pass, username, password | |
Private Function Encrypt(ByVal string) | |
Dim x, i, tmp | |
For i = 1 To Len( string ) | |
x = Mid( string, i, 1 ) |
<VirtualHost *:80> | |
# Configure hostname | |
ServerAdmin postmaster@jpa.gov.my | |
ServerName git.jpa.gov.my | |
# Repository location | |
DocumentRoot /data/www/jpa.gov.my/git | |
# Deny to access | |
<Files ~ "(^\.htaccess|^.*\.conf)"> |
/bin/echo "Attempting to rsync" >> /path/rsync.log | |
30 4 * * * rsync -avz /var/log/syslog.2.gz root@<remote-ip>:/path/vendor/ |
var fs = require('fs'); | |
var parseString = require('xml2js').parseString; | |
var util = require('util'); | |
var async = require('async'); | |
var file = './hariadiorg.wordpress.2013-10-25.xml'; | |
var file = './simple.xml'; | |
var savedResult = true; |
RedirectMatch permanent ^/docs/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+).(pdf|xls|xlsx|ppt|doc|docx)$ /docs/$1/$2/$4.$5 |
(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'); |