Skip to content

Instantly share code, notes, and snippets.

View srics's full-sized avatar

Sridhar Ramaswamy srics

View GitHub Profile
@srics
srics / vncserver
Last active August 29, 2015 14:07
vncserver init.d
#!/bin/bash
unset VNCSERVERARGS
VNCSERVERS=""
[ -f /etc/vncserver/vncservers.conf ] && . /etc/vncserver/vncservers.conf
prog=$"VNC server"
start() {
. /lib/lsb/init-functions
REQ_USER=$2
echo -n $"Starting $prog: "
#!/bin/sh
# Filename: /etc/dhcp/dhclient-exit-hooks.d/sethostname
# Purpose: Used by dhclient-script to set the hostname of the system
# to match the DNS information for the host as provided by
# DHCP.
# logs in /var/log/syslog
#
echo dhclient-exit-hooks.d/sethostname: reason = $reason, interface = $interface
@srics
srics / create-vm-from-iso.sh
Created December 23, 2014 21:31
Create KVM Virtual Machine using Ubuntu Trusty ISO image
#!/bin/bash -x
VM_NAME=_base_trusty64_openstack
VM_MEM=8192
VM_VCPUS=4
VM_DISK_ISO=/var/lib/libvirt/images/ubuntu-14.04.1-server-amd64.iso
VM_NETWORK="bridge=br-ext"
VM_PATH=/opt/vms/${VM_NAME}
VM_DISK=${VM_PATH}/${VM_NAME}_disk.qcow2
@srics
srics / create-ubuntu-vm-template.sh
Created December 23, 2014 21:33
Create KVM Ubuntu VM using backing qcow2 disk
#!/bin/bash -x
# CHANGE-ME: replace VM_NAME as appropriate
VM_NAME="ubuntu-dhcp-template"
VM_MEM=2048
VM_VCPUS=2
VM_DISK_ISO=/var/lib/libvirt/images/ubuntu-14.04.1-server-amd64.iso
VM_NETWORK="bridge=br-int"
VM_PATH=/opt/vms/${VM_NAME}
@srics
srics / apparmor-libvirt-qemu.diff
Created December 23, 2014 21:36
Edit apparmor policy to allow chained backing file for qcow2 disks (list all backing files in chain-level > 2)
$ diff -c /etc/apparmor.d/abstractions/libvirt-qemu.orig /etc/apparmor.d/abstractions/libvirt-qemu
*** /etc/apparmor.d/abstractions/libvirt-qemu.orig 2014-12-22 19:04:30.970000983 -0800
--- /etc/apparmor.d/abstractions/libvirt-qemu 2014-12-22 19:06:44.262003742 -0800
***************
*** 146,148 ****
--- 146,152 ----
# for ppc device-tree access
@{PROC}/device-tree/ r,
@{PROC}/device-tree/** r,
+
@srics
srics / devstack-multinode
Last active August 29, 2015 14:12
devstack single node
multinode devstack local.conf
@srics
srics / devstack_floating_local.conf
Created January 21, 2015 00:39
devstack local.conf with floating range, ip pool
[[local|localrc]]
HOST_IP=192.168.110.203
ADMIN_PASSWORD=devstack
MYSQL_PASSWORD=devstack
RABBIT_PASSWORD=devstack
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=devstack
# Neutron ML2 with OpenVSwitch
devstack vpnaas local.conf files
#!/bin/bash
# Add all VNFD samples in tacker/samples/tosca-templates dir
TACKER_DIR=/opt/stack/tacker
if [ -d $TACKER_DIR ]; then
for samplevnfd in $TACKER_DIR
echo "Adding $samplevnfd to Tacker NFV Catalog"
fi
@srics
srics / golang-tls.md
Created April 3, 2018 18:12 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)