Skip to content

Instantly share code, notes, and snippets.

View achmadns's full-sized avatar

Achmad Nasirudin Sandi achmadns

View GitHub Profile
@achmadns
achmadns / show-retention-policies.sh
Created October 9, 2017 03:43
Show retention policies on InfluxDB through CLI
#!/bin/bash
for x in `influx -execute 'show databases' | grep -v -e ^name -e --- -e ^_internal`;do printf "RETENTION POLICIES ON $x \n"; influx -execute "SHOW RETENTION POLICIES ON $x";done
@achmadns
achmadns / print-param.sh
Created May 12, 2017 09:24
Print and Iterate Shell Script Parameters
#!/bin/bash
: '
Example
$ ./print-param.sh 4 2 3 4 5 6
4 2 3 4 5 6
4
2
3
4
5
@achmadns
achmadns / graph-for-identity-access-management.adoc
Created January 19, 2017 10:51 — forked from kbastani/gist:4471127413fd724ed0a3
GraphGist of Neo4j Access Control

Entitlements and Access Control Management

This interactive Neo4j graph tutorial covers entitlements and access control scenarios.


# assuming we want forward message published to exchange ams.* from broker A to broker B
# there is no any configuration update on broker A except credential needed by B to connect the upstream
# see https://www.rabbitmq.com/federation.html for details
# do these on broker B
# enable rabbitmq federation plugin
rabbitmq-plugins enable rabbitmq_federation
@achmadns
achmadns / activate-rabbitmqadmin.sh
Created March 7, 2016 07:26
Activate rabbitmqadmin
#/bin/bash
# these action should be run with sudo level
# activate management plugin first
rabbitmq-plugins enable rabbitmq_management
# restart the rabbitmq-server
service rabbitmq-server restart
# download the rabbitmqadmin script locally
@achmadns
achmadns / history.sh
Created December 1, 2015 07:54
Linux snippet
sudo apt-get install -y leafpad vim-gnome scribes gedit cream scite geany bluefish kwrite nedit tea
sudo apt-get install -y lyx
@achmadns
achmadns / jvm-setting.txt
Created November 19, 2015 05:44
Common jvm setting
Proxy setting through jvm opts
-Dhttp.proxyHost=10.10.10.10 -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts=localhost|127.0.0.1
@achmadns
achmadns / git.sh
Last active November 17, 2015 04:13
Git related command
# push current branch into origin
git push origin `git status | grep branch | awk '{print $3}'`
# add all modified files
git status | grep modified | sed -re 's:^(.+\:)(.+):\2:' | xargs git add && git status
# list all project under specific group and grep the ssh url
curl --insecure -s "https://gitlab.com/api/v3/groups/oss?private_token=$GIT_TOKEN" | jq '.projects[].ssh_url_to_repo'
@achmadns
achmadns / sinopia-private-bower.json
Created October 10, 2015 15:05
PM2 config example for Sinopia and Private Bower.
{
"apps" : [{
"name" : "sinopia",
"script" : "/home/achmad/.nvm/versions/node/v0.12.0/bin/sinopia",
"args" : [],
"watch" : false,
"node_args" : "",
"merge_logs" : true,
"env": {
}
@achmadns
achmadns / run-jenkin.sh
Created September 28, 2015 09:49
Run Jenkins
# simple example
java -Dcom.sun.akuma.Daemon=daemonized -jar /app/softwares/jenkins-1.613.war --daemon
# tuned jvm settings
nohup /app/.jenv/candidates/java/1.8.0_60/bin/java -Xms3G -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:-OmitStackTraceInFastThrow -Dcom.sun.akuma.Daemon=daemonized -jar /app/softwares/jenkins-1.613.war --daemon &> /dev/null &