Skip to content

Instantly share code, notes, and snippets.

@kamal2222ahmed
kamal2222ahmed / git_ctl.md
Last active February 23, 2016 09:58 — forked from zhanzhenchao/git_ctl.md
git

What is Git?

Explanation:

  • Workspace: local workspace
  • Index:local staging area
  • Repository:Local Warehouse
  • Remote:a remote repository
@kamal2222ahmed
kamal2222ahmed / xrdp_rhel_centos_6.md
Created April 28, 2016 16:56 — forked from dduvnjak/xrdp_rhel_centos_6.md
Setting up xrdp on RHEL 6

1 - Install the prerequisites for building and installation

yum groupinstall Desktop -y
yum install finger cmake patch gcc make autoconf libtool automake pkgconfig openssl-devel gettext file pam-devel libX11-devel libXfixes-devel libjpeg-devel
yum install flex bison gcc-c++ libxslt perl-libxml-perl xorg-x11-font-utils tigervnc-server git -y
reboot

2 - Get the latest source from the xrdp git repo, build and install

git clone git://github.com/FreeRDP/xrdp.git
@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
### 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 / 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
@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 / 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 / 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 / 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.
*/
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 ?