Skip to content

Instantly share code, notes, and snippets.

@chilicat
chilicat / gitlab-push.sh
Last active November 16, 2021 22:08
Gitlab: Helper script to push changes as part of a Gitlab-CI pipeline
#!/bin/bash -e
# Helper script to push changes as part of a Gitlab-CI pipeline
# The script requires a user name (GITLAB_PUSH_USER) and token (GITLAB_PUSH_TOKEN)
# Example Usage:
# gitlab-push.sh "My commit message 1" gen-doc/*.html
# gitlab-push.sh "My commit message 2" my/file1 and/another/file2
COMMENT=$1
# remove comment from arguments
@chilicat
chilicat / slack-stormstack-simple-workflow
Created August 25, 2015 20:08
Simple Slack/Stackstorm Workflow
---
name: "workflow_test"
description: "Simple Action Chain workflow"
runner_type: "action-chain"
entry_point: "workflows/workflow_test.yaml"
enabled: true
parameters:
vm_name:
description: "VM Name"
type: string
@chilicat
chilicat / registry-run.sh
Last active January 3, 2016 16:18
Docker registry for openstack-swift mode
docker run -i -t -p 5042:5000 \
-e SETTINGS_FLAVOR=openstack-swift \
-e OS_USERNAME=${OS_USERNAME} \
-e OS_PASSWORD=${OS_PASSWORD} \
-e OS_TENANT_NAME=${OS_TENANT_NAME} \
-e OS_GLANCE_URL=${OS_GLANCE_URL} \
-e OS_AUTH_URL=${OS_AUTH_URL} \
-e OS_REGION_NAME=${OS_REGION_NAME} \
-e SWIFT_CONTAINER=${SWIFT_CONTAINER} \
docker-registry
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.provider :virtualbox do |vb, override|
vb.customize ["modifyvm", :id, "--memory", "2048"]
vb.customize ["modifyvm", :id, "--cpus", "4"]
end
@chilicat
chilicat / openstack-docker-registry-start.sh
Created November 12, 2013 13:06
Simple script to start the openstack docker registry
#!/bin/sh
source ./keystone_adminrc
echo ${OS_USERNAME}
echo ${OS_PASSWORD}
docker run -d -p 5042:5000 \
-e SETTINGS_FLAVOR=openstack \
-e OS_USERNAME=${OS_USERNAME} \
-e OS_PASSWORD=${OS_PASSWORD} \
-e OS_TENANT_NAME=${OS_TENANT_NAME} \
-e OS_GLANCE_URL="http://10.129.184.9:9292" \
@chilicat
chilicat / cinder-setup-volume.sh
Created November 2, 2013 11:56
Simple script to setup a cinder volume in a file.
#!/bin/sh
if [ "$1" == "" ]; then
echo "[ERROR] Please specify volume size. Usage: $0 3G"
exit 1
fi
# Create a file
dd if=/dev/zero of=cinder-volumes bs=1 count=0 seek=$1
# Create a loop device
@chilicat
chilicat / vagrant-docker
Created November 1, 2013 11:08
Docker service init for vagrant box
#!/bin/bash
### BEGIN INIT INFO
# INIT INFO
# Provides: docker
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: docker
@chilicat
chilicat / start-docker-registry.sh
Created October 28, 2013 15:48
Create docker registry for openstack
docker run -d -p 5042:5000 -e SETTINGS_FLAVOR=openstack -e OS_USERNAME=${OS_USERNAME} -e OS_PASSWORD=${OS_PASSWORD} -e OS_TENANT_NAME=${OS_TENANT_NAME} -e OS_GLANCE_URL="http://10.129.184.9:9292" -e OS_AUTH_URL=${OS_AUTH_URL} docker-registry ./docker-registry/run.sh
@chilicat
chilicat / openstack-docker
Created October 28, 2013 11:14
A service init script for docker on openstack
#!/bin/bash
### BEGIN INIT INFO
# INIT INFO
# Provides: docker
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: docker
@chilicat
chilicat / docker
Last active December 26, 2015 08:19
Docker centos/rhel service init script
!/bin/bash
### BEGIN INIT INFO
# INIT INFO
# Provides: docker
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: docker