Skip to content

Instantly share code, notes, and snippets.

View raphink's full-sized avatar
🐝
eBPF everything!

Raphaël Pinson raphink

🐝
eBPF everything!
View GitHub Profile
=== RUN TestAccRancherCertificateDataSource_foo
--- FAIL: TestAccRancherCertificateDataSource_foo (2.45s)
testing.go:569: Step 0 error: errors during apply:
Error: Bad response statusCode [422]. Status [422 Unprocessable Entity]. Body: [fieldName=name, baseType=error, code=NotUnique] from [http://localhost:8080/v2-beta/projects/1a5/certificates]
on /tmp/tf-test019194136/main.tf line 2:
(source code not available)
package main
import (
"crypto/tls"
"fmt"
"log"
"net/http"
"github.com/tehwalris/go-freeipa/freeipa"
)
@raphink
raphink / git_since
Last active September 2, 2019 07:37
#!/bin/bash
SINCE=${1:-midnight}
DIRS="$HOME/dev $HOME/go/src"
AUTHOR=${2:-Raphaël Pinson}
find $DIRS \
-type d -name .git -exec git --git-dir {} --no-pager \
log --all --since "$SINCE" --author="$AUTHOR" \
--pretty=format:'{} %h %ad %s%n' \;
__lang_ps1() {
if test -f Gemfile || ls *.rb >/dev/null 2>&1; then
printf " \[\e[31m\]\\ue791"
fi
if test -f metadata.json || test -f Puppetfile || ls *.pp >/dev/null 2>&1; then
printf " \[\e[1;33m\]\u203a\[\e[97m\]p"
fi
require 'augeas'
Facter.add(:web_stack) do
aug = Augeas.open()
setcode do
ps = Facter::Util::Resolution.exec('ps axuww')
listen = []
servernames = []
if ps =~ /apache2/
define user_group (
String $group,
Enum['present', 'absent'] $ensure = 'present',
) {
$changes = $ensure ? {
'present' => "defnode ${group}/user[.='${name}'] '${name}'",
'absent' => "rm ${group}/user[.='${name}']",
}
augeas { "Manage ${title} in group ${group}":
INFO[0000] {3 0.11.11 3 c5996133-36da-2356-5ba9-b4131cd2423d <nil> <nil> [local_file.foo:
ID = 57c3e7a0d127bd6b983539f80fb44fd50d9d732c
provider = provider.local
content = foo!!
filename = /home/raphink/go/src/github.com/camptocamp/terradb/bas/foo.bar
] {0 0}}
INFO[0000] serial=3
INFO[0000] foo!!
---
version: '3'
services:
mongo:
image: mongo
environment:
MONGODB_USER: 'terradb'
MONGODB_PASSWORD: 'terradb'
MONGODB_DATABASE: 'terradb'
MONGODB_ADMIN_PASSWORD: 'terradb'
(*
Module: Semanage
Parses /etc/selinux/semanage.conf
Author:
Pino Toscano <ptoscano@redhat.com>
About: License
This file is licenced under the LGPL v2+, like the rest of Augeas.
version: "3.1"
services:
puppet:
build: .
image: camptocamp/puppetserver:arbitrary_user
hostname: puppet.camptocamp.com
user: "12345678"
volumes:
- ./code:/etc/puppetlabs/code:ro
- puppetca:/etc/puppetlabs/puppet/ssl/ca:rw