Skip to content

Instantly share code, notes, and snippets.

View ashguptablr's full-sized avatar

Ashish Gupta ashguptablr

  • Juniper Networks
  • Sunnyvale
View GitHub Profile
@zimmcl
zimmcl / setup_NS.sh
Last active June 24, 2020 10:00
IPv4 NETWORK TOPOLOGY IN LINUX NAMESPACES
#!/usr/bin/env bash
EXIT_OK=0
ARG=$1
autor()
{
echo -e "\n\e[1m\e[34m === IPv4 NETWORK TOPOLOGY IN LINUX NAMESPACES ===\e[22m\e[24m\e[39m\n"
echo -e " Original Author: \e[1mTOMATTIS Natasha\e[22m\e[24m."
echo -e " https://gist.github.com/natitomattis/be26889063203c0b33b33fa25c75a5b6"
@unakatsuo
unakatsuo / README.md
Created January 6, 2019 09:54
Running strongswan in Linux net namespace.

Version:

  • strongswan-5.7.1-1.el7.x86_64
@jstangroome
jstangroome / docker-readme
Last active June 30, 2020 08:51
Container memory limits as visible to container process
# docker 17.12.1-ce
=> docker run
==> /sys/fs/cgroup/memory/memory.kmem.limit_in_bytes <==
18446744073709551615
==> /sys/fs/cgroup/memory/memory.kmem.tcp.limit_in_bytes <==
18446744073709551615
==> /sys/fs/cgroup/memory/memory.limit_in_bytes <==
18446744073709551615
@afolarin
afolarin / resource_alloc_docker.md
Last active March 18, 2024 17:01
Resource Allocation in Docker

#Container Resource Allocation Options in docker-run

now see: https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources

You have various options for controlling resources (cpu, memory, disk) in docker. These are principally via the docker-run command options.

##Dynamic CPU Allocation -c, --cpu-shares=0
CPU shares (relative weight, specify some numeric value which is used to allocate relative cpu share)

@kgaughan
kgaughan / gist:2491663
Created April 25, 2012 17:54
Parsing a comma-separated list of numbers and range specifications in Python
from itertools import chain
def parse_range(rng):
parts = rng.split('-')
if 1 > len(parts) > 2:
raise ValueError("Bad range: '%s'" % (rng,))
parts = [int(i) for i in parts]
start = parts[0]
end = start if len(parts) == 1 else parts[1]
if start > end: