Skip to content

Instantly share code, notes, and snippets.

View mathieuancelin's full-sized avatar

Mathieu ANCELIN mathieuancelin

View GitHub Profile
#!/bin/bash
set -e
outfile=
passfile=
pin=
encKey=01
action=encrypt
xrandr --output DP-1 --set underscan on
xrandr --output DP-1 --set "underscan hborder" 31 --set "underscan vborder" 42
@mathieuancelin
mathieuancelin / index.js
Created April 26, 2018 09:36
Copy Otoroshi apikeys from one group to another
const fetch = require('node-fetch');
const base64 = require('base-64');
const argv = require('minimist')(process.argv.slice(2));
const OTOROSHI_URL = argv['otoroshi-url'] || 'http://otoroshi-api.foo.bar'
const APIKEY_ID = argv['otoroshi-apikey-id'] || 'admin-api-apikey-id'
const APIKEY_SECRET = argv['otoroshi-apikey-secret'] || 'admin-api-apikey-secret'
const SERVICE_FROM = argv['service-from'] || '--';
const SERVICE_TO = argv['service-to'] || '--';
const http = require('http');
const url = require('url');
const faker = require('faker');
const bytes = require('bytes');
const _ = require('lodash');
const port = process.env.PORT || process.argv[2] || 8080;
const cache = {};
package app
import cats.Applicative
import cats.effect._
import cats.implicits._
import fs2.StreamApp.ExitCode
import fs2.{Stream, StreamApp}
import io.circe._
import io.circe.generic.semiauto._
import org.http4s.circe._
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.headers._
import akka.http.scaladsl.model._
import akka.http.scaladsl.util.FastFuture
import akka.stream.ActorMaterializer
import akka.util.ByteString
import scala.concurrent._
import kaleidoscope._
#!/bin/bash
LOCATION=`pwd`
SESSION_NAME="otoroshi-dev"
tmux start-server;
cd $LOCATION
tmux new-session -d -s $SESSION_NAME
package com.example.demo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
# sozu proxy test config file
command_socket = "./command_folder/sock"
saved_state = "./state.json"
log_level = "error"
log_target = "stdout"
command_buffer_size = 16384
worker_count = 2
handle_process_affinity = false
max_connections = 500
import java.util.concurrent.atomic.AtomicInteger
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{BroadcastHub, Keep, RunnableGraph, Source}
import scala.concurrent.duration._
implicit val actorSystem = ActorSystem("Pouet")