Skip to content

Instantly share code, notes, and snippets.

@chilicat
chilicat / gitlab-push.sh
Last active Nov 16, 2021
Gitlab: Helper script to push changes as part of a Gitlab-CI pipeline
View gitlab-push.sh
#!/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 Aug 25, 2015
Simple Slack/Stackstorm Workflow
View slack-stormstack-simple-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 Jan 3, 2016
Docker registry for openstack-swift mode
View registry-run.sh
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
View vagrant_cpu_and_mem_increase
# -*- 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 Nov 12, 2013
Simple script to start the openstack docker registry
View openstack-docker-registry-start.sh
#!/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 Nov 2, 2013
Simple script to setup a cinder volume in a file.
View cinder-setup-volume.sh
#!/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 Nov 1, 2013
Docker service init for vagrant box
View vagrant-docker
#!/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 Oct 28, 2013
Create docker registry for openstack
View start-docker-registry.sh
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 Oct 28, 2013
A service init script for docker on openstack
View openstack-docker
#!/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 Dec 26, 2015
Docker centos/rhel service init script
View docker
!/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