Skip to content

Instantly share code, notes, and snippets.

---
- hosts: localhost
tasks:
- name: Install Apache Web Server
yum: name=httpd state=latest
- name: Install PHP
yum: name=php state=latest
- name: Install PHP MySQL Connector
yum: name=php-mysql state=latest
#!/bin/sh
### BEGIN INIT INFO
# Provides: haproxy
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fast and reliable load balancing reverse proxy
# Description: This file should be used to start and stop haproxy.
### END INIT INFO
global
log 127.0.0.1 local0 notice
maxconn 2000
user haproxy
group haproxy
defaults
log global
mode http
option httplog
{
key: "SELECT username,full_name,last_name,userid FROM users WHERE id=1234",
value: [{
username: "user1",
full_name: "John Doe",
user_id: "1234"
}]
}
{
key: "ed7dd2e5a373f90ccfd2ccb08d843a63",
value: [{
username: "user1",
full_name: "John Doe",
user_id: "1234"
}]
}
@serainville
serainville / golang-cli.go
Created April 26, 2018 01:57
Golang JSON API CLI
package main
import (
"golang-cli/cmd"
)
func main() {
command.RootCmd.Execute()
}
@serainville
serainville / init.pp
Created June 13, 2018 18:21
Masterless Puppet Cron Job
class puppet-cron (
String $git_repo = "git@github.com/serainville/example.git"
){
// Let's make sure the Puppet daemon isn't running.
service { "puppet":
ensure => stopped,
enable => false,
} ->
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
rules:
- apiGroups:
- ""
resources:
- services
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: traefik-ingress-controller
namespace: kube-system
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
@serainville
serainville / docker-compose.yml
Created May 11, 2019 11:35
Example Wordpress docker-compose file
version: "3.7"
services:
wordpress:
image: wordpress
ports:
- "80:80"
environment:
- WORDPRESS_DB_HOST=127.0.0.1
- WORDPRESS_DB_USER=wpuser