Skip to content

Instantly share code, notes, and snippets.

Noval Agung Prayogo novalagung

Block or report user

Report or block novalagung

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
novalagung /
Last active Jul 10, 2019
iptables example to allow ssh, and block every incoming http and https requests except certain ips
# allow incoming ssh access from anywhere
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# allow incoming http & https requests from local
sudo iptables -A INPUT -p tcp --dport 80 -s -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -s -j ACCEPT
# allow incoming http & https requests from specific ips
sudo iptables -A INPUT -p tcp --dport 80 -s -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -s -j ACCEPT

#MongoDB 3.2.x SSL with Letsencrypt Letsencrypt is an initative which aims to increase the use of encryption for websites. It basically allows people to apply for free certificates provided that they prove the they control the requested domain. We will look at the what is needed to secure your MongoDB installation. For more details on setting up a MongoDB server see MongoDB 3.2.x.

##Set the hostname We sould to set the hostname to match the name of the certificate we are going to optain.

sudo hostname

Then update the hostname file to set the server name permanently.

novalagung / gist:a0fddc1d0161599572ee9871146d2992
Created May 14, 2019 — forked from sanatgersappa/gist:4030649
Querying Sharepoint on Office365 with Go
View gist:a0fddc1d0161599572ee9871146d2992
package main
import (
View blocking-akal2an.js
var vm = {}
vm.dataUser = []
vm.isDataUserReady = false
vm.doGetData = function() {
url: ""
}).then(function(res) {
setTimeout(() => {
vm.dataUser =
View get-kurs.go
package main
import (
novalagung / using-callback.js
Last active Nov 15, 2018
a simple comparison on handling asynchronous processes sequentially, using callback vs promise, in javascript
View using-callback.js
function doA(callback) {
// ...
success: function (res) {
if (callback) callback(res, true)
error: function (res) {
if (callback) callback(res, false)
novalagung / go-soap-wsdl-using-http.go
Last active Sep 4, 2019
Example implementation of making SOAP call on WSDL web service using go with only net/http package. The full tutorial avaiable on
View go-soap-wsdl-using-http.go
package main
import (
View mgo-delete-all.js
// Get session
info := new(mgo.DialInfo)
info.Username = "username"
info.Password = "password"
info.Source = "admin"
info.Addrs = []string{"host"}
info.Database = "dbname"
session, err := mgo.DialWithInfo(info)
novalagung /
Created Jul 19, 2018 — forked from soarez/
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

novalagung / app.js
Created Jan 23, 2018 — forked from acdlite/app.js
Quick and dirty code splitting with React Router v4
View app.js
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
You can’t perform that action at this time.