Skip to content

Instantly share code, notes, and snippets.


Hemanth B hemanth22

  • Societe Generale Global Solution Centre.
  • Banglore
Block or report user

Report or block hemanth22

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
hemanth22 / fib.js
Created Sep 21, 2019 — forked from ry/fib.js
a proper fibonacci server in node. it will light up all your cores.
View fib.js
var http = require('http')
var fork = require('child_process').fork;
function fib(n) {
if (n < 2) {
return 1;
} else {
return fib(n - 2) + fib(n - 1);
hemanth22 /
Created Sep 11, 2019 — forked from 64lines/
[DOCKER] Docker Useful Commands

Useful Docker commands

docker build -t friendlyname .                                       # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname                                   # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname                                # Same thing, but in detached mode
docker run -d -p 4000:80 -n containername friendlyname               # With the container name
docker run -dit --name apache2 apache2                               # Run in the background
docker ps                                                            # See a list of all running containers
docker stop <hash>                                                   # Gracefully stop the specified container
hemanth22 / Dockerfile
Created Sep 11, 2019 — forked from arehmandev/Dockerfile
Quick docker in docker
View Dockerfile
FROM debian:stretch-slim
RUN apt-get update -y && apt install -y curl && \
curl -LO && apt install -f -y ./containerd.io_1.2.6-3_amd64.deb && \
curl -LO && apt install -f -y ./docker-ce-cli_18.09.7~3-0~debian-stretch_amd64.deb && \
curl -LO && apt install -f -y ./docker-ce_18.09.7~3-0~debian-stretch_amd64.deb && \
rm -rf *.deb
hemanth22 /
Created Sep 11, 2019 — forked from murarisumit/
docker cheatsheet #docker #cheatsheet

Docker cheatsheet, usually has one-lines to delete containers.

  • Create a image from docker file: docker build -t image-name .
  • Run a container: docker run -it --name container-name image-name:latest
  • Run docker in backgroud: docker run --name container-name --hostname container-hostname -t -d container-name:latest
  • Connect to container: docker exec -it container_name bash
  • Remove all Exited containers: sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
  • Remove all dangling images: docker rmi $(docker images -f 'dangling=true' -q)
hemanth22 /
Created Sep 11, 2019 — forked from Mukei/
[Docker Cookbook] #docker #cookbook
hemanth22 /
Created Sep 11, 2019 — forked from afloesch/
Jenkins in Docker (docker-in-docker)

Jenkins in Docker (docker-in-docker)

Testing Jenkins flows on your local machine, or running Jenkins in production in a docker container can be a little tricky with a docker-in-docker scenario. You could install Jenkins to avoid any docker-in-docker issues, but then you have Jenkins on your machine, and the local environment is likely going to be a fairly different from the actual production build servers, which can lead to annoying and time-consuming issues to debug.

Build environment differences are precisely why there is a strong argument to be made to run build processes strictly in docker containers. If we follow the philosophy that every build step or action should run in a docker container, even the Jenkins server itself, then we get massive benefits from things like, total control over the build environment, easily modify the build environment without the possibility of adversely effecting other jobs, explicit and strongly controlled tool versions,

  • 도커는 컨테이너 기반의 오픈소스 가상화 플랫폼
## List Docker CLI commands
docker container --help

## Display Docker version and info
docker --version
docker version
hemanth22 /
Created Sep 11, 2019 — forked from elsauto/
Docker Commands #Docker #Docker-Compose

Docker Command Cheatsheet

Build our own image:

docker build -t my-image .

Delete All Exited Containers (Linux):

docker rm $(docker ps -q -f status=exited)
hemanth22 /
Created Sep 11, 2019 — forked from cig0/
Docker #docker

Docker cheatsheet

Command Description
Ctrl-p + Ctrl-q Disconnects from current interactive container
docker ps Lists the current running containers
docker images Lists available containers
docker stop Stops the specified container
docker port Lists the ports exposed on the specified container
docker network inspect Displays the net information for the specified container
You can’t perform that action at this time.