Skip to content

Instantly share code, notes, and snippets.

View lukehinds's full-sized avatar
🏃‍♂️
Either running or coding.

Luke Hinds lukehinds

🏃‍♂️
Either running or coding.
View GitHub Profile
@lukehinds
lukehinds / gist:57c8004342a86454981d
Created July 13, 2015 18:57
CADF Keystone setup
Very Basic Inspector Environment Set Up for Keystone CADF events (Complete WIP, Do not trust this yet!)
Install / Vagrant up Ubuntu 14.04 or later
clone devstack
git clone https://git.openstack.org/openstack-dev/devstack
My localrc
class Pizza(object):
def __init__(self):
self.toppings = []
def __call__(self, topping):
# when using '@instance_of_pizza' before a function def
# the function gets passed onto 'topping'
self.toppings.append(topping())
def __repr__(self):
return str(self.toppings)
wget http://download.virtualbox.org/virtualbox/5.0.2/VBoxGuestAdditions_5.0.2.iso
sudo mkdir /media/iso
sudo mount -o loop ./VBoxGuestAdditions_5.0.2.iso /media/iso
sudo bash /media/iso/VBoxLinuxAdditions.run --nox11
sudo umount /media/iso
on guest:
sudo mount -t vboxsf <shared_folder_name> ~/<local_shared_folder>/
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
return 301 https://nfv.space$request_uri;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://avatars.githubusercont$nt.com; img-src *; style-src https: 'unsafe-inline'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com; object-src 'none'";
}
#!/usr/bin/python
#
# Copyright (c) 2016 Red Hat
# Luke Hinds (lhinds@redhat.com)
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/usr/bin/python
#
# Copyright (c) 2016 Red Hat
# Luke Hinds (lhinds@redhat.com)
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
[undercloud]
port = 22
user = stack
remotekey = /home/stack/.ssh/id_rsa
localkey = /home/opnfv/.ssh/overCloudKey
[controller]
port = 22
user = heat-admin
scantype = xccdf
lambda is just a fancy way of saying function. Other than its name, there is nothing obscure, intimidating or cryptic about it. When you read the following line, replace lambda by function in your mind:
>>> f = lambda x: x + 1
>>> f(3)
4
It just defines a function of x. Some other languages, like R, say it explicitly:
diff -rupN original/Makefile new/Makefile
--- original/Makefile 2006-06-11 10:52:50.000000000 -0500
+++ new/Makefile 2016-06-14 14:12:05.000000000 -0500
@@ -1,5 +1,5 @@
CC = gcc
-CFLAGS = -O2
+CFLAGS = -O2 -DHAVE_openpty
VERSION = 1.0.8
TARGET = ttyrec ttyplay ttytime
#!/bin/sh
SITE="site"
SITEDB="site_db"
SITEUSER="sitedbuser"
SITEDBPW="sitedbpass"
TRACKDB="jiradbuser"
TRACKUSER="jiradbuser"
TRACKDBPW="jiradbpass"
THEDATE=`date +%d%m%y%H%M`