Skip to content

Instantly share code, notes, and snippets.

View sroze's full-sized avatar

Samuel ROZE sroze

View GitHub Profile
@sroze
sroze / terraform-outputs-as-variables.js
Created January 2, 2019 09:35
Terraform & Serverless: our perfect "functions-as-a-service" CI.
const execSync = require('child_process').execSync;
module.exports = () => {
const configuration = {};
const terraformFolder = process.env.SERVERLESS_ENVIRONMENT == 'production' ? 'production' : 'staging';
const cwd = __dirname + '/' + terraformFolder;
const output = execSync('terraform output -json', {
cwd,
encoding: 'utf-8',
<?php
// Expected output:
// Got exception do nothing
// Got message test2
// Got message test3
// Actual output:
// Got exception do nothing
// Got message test3
#define _GNU_SOURCE
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/mman.h>
#include <err.h>
#include <stdbool.h>
#include <ctype.h>
@sroze
sroze / poc_test.c
Created January 11, 2018 17:33
Spectre's PoC
#define _GNU_SOURCE
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/mman.h>
#include <err.h>
#include <stdbool.h>
#include <ctype.h>
@sroze
sroze / download-file.sh
Last active December 15, 2017 17:16
Share files with transfer.sh (encrypted)
curl https://transfer.sh/<unique-string>/database.sql | gpg -o- > database.sql

Keybase proof

I hereby claim:

  • I am sroze on github.
  • I am sroze (https://keybase.io/sroze) on keybase.
  • I have a public key whose fingerprint is D12F 83A6 F476 C26A 0563 3F12 8354 26F5 5A19 FB84

To claim this, I am signing this object:

@sroze
sroze / "configuration" on CP ui
Last active June 14, 2016 14:04
Docker & CP example 1
environment_variables:
- name: GITHUB_TOKEN
value: thevalue
- name: SOME_SECRET
value: blahblha
#!/bin/bash
# git-branch-status
# * originally by http://github.com/jehiah
# * "s'all good!" message by http://github.com/kd35a
# * ANSI colors by http://github.com/knovoselic
# * column formatting, filters, and usage by http://github.com/bill-auger
# this script prints out pretty git branch sync status reports
@sroze
sroze / MyCommand.php
Last active June 6, 2021 13:58
Symfony Command that read file from file name or STDIN
<?php
namespace AmceBundle\Command;
class MyCommand
{
// ...
protected function execute(InputInterface $input, OutputInterface $output)
{
@sroze
sroze / etc-init-docker-bootstrap
Created May 25, 2015 13:46
Docker bootstrap upstart
description "Docker bootstrap"
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker-bootstrap)
DOCKER=/usr/bin/docker
DOCKER_OPTIONS="-d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap"
if [ -f /etc/default/$UPSTART_JOB ]; then
. /etc/default/$UPSTART_JOB
fi
exec "$DOCKER" $DOCKER_OPTIONS