Skip to content

Instantly share code, notes, and snippets.

@smuthali
smuthali / lslock.py
Created August 6, 2015 05:11
Detect lock files in a given directory path (support for subdirectories included)
#!/usr/bin/env python
import os
import sys
import fcntl
import argparse
import logging
import psutil
@smuthali
smuthali / lslock-test.py
Created August 6, 2015 05:13
test script to validate lslock implementation
#!/usr/bin/env python
import time
import sys
import os.path
import fcntl
import argparse
import logging
# Set logging options
logging.basicConfig(level=logging.INFO)
@smuthali
smuthali / docker_gist
Created August 17, 2015 17:37
docker-engine 1.8.1 on CentOS 7.1
OS: CentOS Linux release 7.1.1503 (Core)
docker info:
Containers: 0
Images: 5
Storage Driver: devicemapper
Pool Name: docker-253:5-136018-pool
Pool Blocksize: 65.54 kB
Backing Filesystem: extfs
[root@ip-10-180-34-196 new_certs]# docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5
Built: Fri Nov 20 13:25:01 UTC 2015
OS/Arch: linux/amd64
Server:
@smuthali
smuthali / gist:dc5d5bdfb2fb330d4005
Created December 4, 2015 22:10
docker build netty
docker build -t "bmcgeneva:netty-1.0.0-SNAPSHOT-151204215529" -f Dockerfile .
Sending build context to Docker daemon 416.5 MB
Sending build context to Docker daemon
Step 0 : FROM bmcgeneva:jdk18-jdk-1.0.0-SNAPSHOT-latest
---> 2cf8d95119ff
Step 1 : RUN mkdir -p /logs/netty; mkdir -p /apps/netty; mkdir -p /apps/netty/ingestor;
---> Using cache
---> e8e23ec0f5d9
Step 2 : COPY pip-pkgs.sh netty-configure.py netty-1.0.0-SNAPSHOT-bundle.tar.gz main.properties /apps/netty/
---> b7614d2e8f3a
# Zookeeper
job "zookeeper" {
# Specify Region
region = "uswest-fremont"
# Specify Datacenter
datacenters = [ "fremont-dc1"]
# Specify job type
@smuthali
smuthali / zoo.tpl
Last active November 9, 2016 01:35
Zookeeper Consul Template
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
@smuthali
smuthali / myid.tpl
Created November 4, 2016 18:32
Zookeeper myid
{{range $i, $services := service "zookeeper"}}
{{ $i | add 1 }}
{{ end }}
@smuthali
smuthali / zookeeper.hcl
Created November 4, 2016 19:06
Zookeeper
# Zookeeper
job "zookeeper" {
# Specify Region
region = "uswest-fremont"
# Specify Datacenter
datacenters = [ "fremont-dc1"]
# Specify job type
@smuthali
smuthali / myid.tpl
Last active November 9, 2016 01:31
Zookeeper myid template
{{- $myid_counter := key "zk/zkcounter" | parseInt -}}
{{- range $i, $services := service "zookeeper" -}}
{{- with node -}}
{{- if eq $services.Node .Node.Node -}}
{{- $myid_counter | add $i -}}
{{- end -}}
{{- end -}}
{{ end }}