Skip to content

Instantly share code, notes, and snippets.

View goffinet's full-sized avatar

goffinet

View GitHub Profile
# http://superuser.openstack.org/articles/new-tripleo-quick-start-cheatsheet/
# 01 - Create the toor user.
sudo useradd toor
echo "toor:toor" | chpasswd
echo "toor ALL=(root) NOPASSWD:ALL" \
| sudo tee -a /etc/sudoers.d/toor
sudo chmod 0440 /etc/sudoers.d/toor
su - toor
# 02 - Prepare the hypervisor node.
@goffinet
goffinet / deploy_to_s3.py
Created December 21, 2018 09:56 — forked from robert-b-clarke/deploy_to_s3.py
A simple python script for copying static web resources to an S3 bucket and advance gzipping JS and CSS. Let me know if it's useful (and not already implemented by something else), I may make it into a proper repo
"""
===========
Description
===========
Simple script to copy and gzip static web files to an AWS S3 bucket. S3 is great for cheap hosting of static web content, but by default it does not gzip CSS and JavaScript, which results in much larger data transfer and longer load times for many applications
When using this script CSS and JavaScript files are gzipped in transition, and appropriate headers set as per the technique described here: http://www.jamiebegin.com/serving-compressed-gzipped-static-files-from-amazon-s3-or-cloudfront/
* Files overwrite old versions
@goffinet
goffinet / UploadDirS3.py
Created December 21, 2018 09:39 — forked from feelinc/UploadDirS3.py
Upload folder contents to AWS S3
#!/usr/bin/python
import os
import sys
import boto3
# get an access token, local (from) directory, and S3 (to) directory
# from the command-line
local_directory, bucket, destination = sys.argv[1:4]
@goffinet
goffinet / starter-template.html
Created May 7, 2018 12:20 — forked from jonschlinkert/starter-template.html
bootstrap starter template with cdn assets
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Starter Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- styles -->
#!/bin/bash
# script to send test mail with netcat
# http://nmap.org/dist/ncat-portable-5.59BETA1.zip
# for nmap Windows binary
base="mail.internetmail.be"
belgacom="relay.skynet.be"
billi="relay.billi.be"
dommel="relay.dommel.be"
edpNet="relay.edpnet.be"
@goffinet
goffinet / ghost-ansible.md
Last active September 14, 2017 17:08 — forked from ErisDS/README.md
Ansible tips for Ghost-Cli TODO: make this a proper repo

This assumes that you have already installed:

  • mariadb/mysql (no example provided)
  • node v6 (see node-install.yml)
  • ghost-cli latest (see ghost-cli-install.yml)
  • nginx (see nginx-install-config.yml)

After that, running install-ghost.yml will:

  • create you a db user (ghost cli may take this over in future)
#!/bin/bash
cd
cd devstack
#. openrc user project
#OS_PASSWORD=
image=xenial-ubuntu
instance_name=$1
sec-group=
openstack server create \
@goffinet
goffinet / project_init.sh
Last active June 9, 2017 20:08
OS project init
proj_name=$1
net_id1="$(shuf -i 0-255 -n 1)" net_id2="$(shuf -i 0-255 -n 1)" # random /24 in 10.0.0.0/8 range
ip_range="10.${net_id1}.${net_id2}.0/24"
proj_user=${proj_name}-user
password=${proj_name}123
proj_desc="${proj_name} project"
openstack project create --description "$proj_desc" $proj_name
openstack user create --password $password $proj_user
openstack role add --project $proj_name --user $proj_user Member
@goffinet
goffinet / uscw.rc
Created May 9, 2017 21:08
ubuntu on scw virt-scripts adaptation
#!/bin/bash
download_install_virt-scripts () {
cd
apt-get -y install git
git clone https://github.com/goffinet/virt-scripts
cd virt-scripts
./autoprep.sh
}
@goffinet
goffinet / install_https_ghost_blog.sh
Last active July 22, 2017 09:21
install https ghost blog in ubuntu 16.04 xenial with nginx proxy, letsencrypt and cloudflare api
#!/bin/bash
## 1. Set variables
SITE="blog1"
ZONE="example.com"
MAIL="[email protected]"
CF_TOKEN="your_api"
## Do not touch any others
CF_EMAIL=$MAIL
CF_ZONE=$ZONE