Skip to content

Instantly share code, notes, and snippets.

View akadan47's full-sized avatar

Denis Popov akadan47

View GitHub Profile
## Useful Commands
Get kubectl version
kubectl version
Get cluster info:
@akadan47
akadan47 / django.sh
Last active September 26, 2018 06:15
Django bash completion
# #########################################################################
# This bash script adds tab-completion feature to django-admin.py and
# manage.py.
#
# Testing it out without installing
# =================================
#
# To test out the completion without "installing" this, just run this file
# directly, like so:
#
# Generate Private Key
$ openssl genrsa -out server.key 2048
# Generate CSR
$ openssl req -new -out server.csr -key server.key -config openssl.cnf
# => Fill in info
# Check CSR
$ openssl req -text -noout -in server.csr
# Sign Cert
$ openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile openssl.cnf
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@akadan47
akadan47 / bootlocal.sh
Last active August 29, 2015 14:19 — forked from irgeek/bootlocal.sh
#!/bin/sh
BOOT2DOCKER_CERTS_DIR=/var/lib/boot2docker/certs
CERTS_DIR=/etc/ssl/certs
CAFILE=${CERTS_DIR}/ca-certificates.crt
for cert in $(/bin/ls -1 ${BOOT2DOCKER_CERTS_DIR}); do
SRC_CERT_FILE=${BOOT2DOCKER_CERTS_DIR}/${cert}
CERT_FILE=${CERTS_DIR}/${cert}
HASH_FILE=${CERTS_DIR}/$(/usr/local/bin/openssl x509 -noout -hash -in ${SRC_CERT_FILE} 2>/dev/null)
#!/bin/bash
sudo apt-get update
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install lxc-docker
from lamson import server, routing, utils
import sys, os
import logging
settings = utils.make_fake_settings('127.0.0.1', 8825)
settings.receiver.start()
@akadan47
akadan47 / gist:4363590234cdbd937e7c
Created July 26, 2014 15:45
One line SMTP python server
# Start simple SMTP server on localhost:25 and print to standard output all email headers and the email body.
# Useful for debugging outgoing mail without configuring SMTP daemon in development enviroment.
python -m smtpd -n -c DebuggingServer localhost:25