Skip to content

Instantly share code, notes, and snippets.

@kamal2222ahmed
kamal2222ahmed / Install_VNC_AWS_Centos
Created February 11, 2018 15:09 — forked from mikaelMortensenADI/Install_VNC_AWS_Centos
How to Install VNC on an Amazon EC2 Centos 7.2 AMI
How to Install VNC on an AWS EC2 Centos 7.2 AMI
Reference: http://devopscube.com/how-to-setup-gui-for-amazon-ec2-rhel-7-instance/
1. Update the server using the following command.
sudo yum -y update
2. Install the gnome GUI components using the following command.
sudo yum groupinstall -y "Server with GUI"
export CLUSTER_DNS=[...]
export CLUSTER_IP=[...]
ssh -i workshop.pem docker@$CLUSTER_IP
docker container run -d --name jenkins -p 8080:8080 jenkins:alpine
docker container ls # Wait until it is up and running
1. How to see if a Docker container is running or not ?
docker inspect -f {{.State.Running}} <container-id>
2. What is a Docker Typical Workflow ( build image --> Run container ) etc
3. How do i transfer docker container from one host to another
4. How do i use docker-compose ?
5. Can i run multiple containers which are located on local disk via docker-compose ?
@kamal2222ahmed
kamal2222ahmed / NexusArtifactCleanup.groovy
Created November 4, 2017 10:33 — forked from oliverdaff/NexusArtifactCleanup.groovy
Clean up nexus artifacts with API
import groovyx.net.http.*;
import static groovyx.net.http.ContentType.*;
import static groovyx.net.http.Method.*;
class NexusArtifactCleanup {
/**
* Settings in which to run script.
*/
@kamal2222ahmed
kamal2222ahmed / cleanreg.py
Created November 4, 2017 10:31 — forked from dpedu/cleanreg.py
docker registry v2 cleanup script
#!/usr/bin/env python3
from requests import get
import sys
from json import dumps
from os import listdir,remove,rmdir
from shutil import rmtree
REGISTRY_URL = "http://127.0.0.1:5000/v2/"
REGISTRY_DATA_PATH = "/data/registry/"
@kamal2222ahmed
kamal2222ahmed / clean_docker_nexus.sh
Created November 4, 2017 04:15 — forked from matzegebbe/clean_docker_nexus.sh
Nexus Repository Manager keep the last X docker images delete all other
#!/bin/bash
REPO_URL="https://repository.xxx.net/repository/"
USER="admin"
PASSWORD="datpassword"
BUCKET="portal-docker"
KEEP_IMAGES=10
IMAGES=$(curl --silent -X GET -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -u ${USER}:${PASSWORD} "${REPO_URL}${BUCKET}/v2/_catalog" | jq .repositories | jq -r '.[]' )
@kamal2222ahmed
kamal2222ahmed / .bashrc
Created September 29, 2017 12:32 — forked from justintv/.bashrc
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"
@kamal2222ahmed
kamal2222ahmed / web-servers.md
Created August 3, 2017 05:06 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
### print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure.
$npm ls promzard
$npm -g list
test.js:
function npmls(cb) {
require('child_process').exec('npm ls --json', function(err, stdout, stderr) {
if (err) return cb(err)
@kamal2222ahmed
kamal2222ahmed / putty-gce.md
Created June 14, 2016 06:34 — forked from feczo/putty-gce.md
How to use Compute Engine - GCE with putty