Skip to content

Instantly share code, notes, and snippets.

View navidurrahman's full-sized avatar

Naveed navidurrahman

View GitHub Profile
@navidurrahman
navidurrahman / etcd_to_consul.sh
Created June 5, 2018 22:24
Migrate data etcd to consul
#!/bin/bash
# Migrate data from etcd to consul
for k in $(etcdctl --peers http://<etcd_url>:4001 ls --recursive -p | grep -v "/$") ;\
do v=$(etcdctl --peers http://<etcd_url>:4001 get $k);\
curl --header "X-Consul-Token: <consul_toker>" \
--request PUT \
--data "$v" http://<consul_url>:8500/v1/kv$k;\
echo "$k = [$v]";\
### Keybase proof
I hereby claim:
* I am navidurrahman on github.
* I am nvdo (https://keybase.io/nvdo) on keybase.
* I have a public key ASDCgW7EP7crJybnh0t3Wm7qHGJu4l4RK-UxSncDrK9OXwo
To claim this, I am signing this object:
@navidurrahman
navidurrahman / solution.md
Last active September 24, 2017 11:38
Solution

Solution

This repository is based on three parts

  • NodeJS UDP Server
  • Terraform Script
  • Ansible playbook to deploy docker

Usage

@navidurrahman
navidurrahman / bitbucket_project.groovy
Last active October 3, 2019 18:16
Jenkins Job DSL Example - Bitbucket project and branches
// URL components
String baseUrl = "https://bitbucket.org/rest/api"
String version = "1.0"
String project = "SYS"
// Put it all together
String reposUrl = [baseUrl, version, "projects", project, "repos"].join("/")
def send_request(url_string){
// Create URL
@navidurrahman
navidurrahman / docker_stats.py
Last active January 5, 2016 10:48
Docker stats with python server
import http.server
import socketserver
import requests_unixsocket
from contextlib import closing
PORT = 8082
class MyHandler(http.server.BaseHTTPRequestHandler):
def get_stats(self):