Skip to content

Instantly share code, notes, and snippets.

View Filirom1's full-sized avatar

Romain Filirom1

View GitHub Profile
@Filirom1
Filirom1 / log-insight.sh
Last active December 9, 2020 09:56
aws
aws logs get-query-results --output text --query 'results[]|[?field==`@message`][value]' --query-id $(aws logs start-query --log-group-name "XXXX" --start-time `date -d '12 hour ago' "+%s"` --end-time `date "+%s"` --output text --query-string 'fields @message |filter (@logStream like /YYY/) | sort @timestamp desc | limit 20')
@Filirom1
Filirom1 / divert.go
Last active December 2, 2018 17:51
divert windows in go
package main
import (
"encoding/binary"
"fmt"
"io"
"log"
"net"
"os"
"strconv"
@Filirom1
Filirom1 / auto-codequality.sh
Last active April 27, 2020 17:42
Build anything
#!/usr/bin/env
docker run --interactive --tty --rm --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate engines:install
docker run --interactive --tty --rm --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze -f text
@Filirom1
Filirom1 / Test.class
Created February 20, 2018 08:35 — forked from nogweii/Test.java
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed. If you don't, in Java 6 you'll see 128. If you do, you'll see 2147483647. Thanks to http://stackoverflow.com/questions/11538746/check-for-jce-unlimited-strength-jurisdiction-policy-files
@Filirom1
Filirom1 / cri.md
Created December 5, 2017 13:31
CRI-O and CRI-Containerd

Install Golang

On a fresh CentOS 7.4, as root:

yum install -y golang git wget
@Filirom1
Filirom1 / portainer.sh
Created February 4, 2017 13:34
How to develop on portainer on centos 7
vagrant init centos/7
vagrant up && vagrant ssh
sudo yum install -y epel-release && sudo yum install -y docker npm git
git clone https://github.com/portainer/portainer.git && cd portainer
sudo ln -s /usr/bin/sha1sum /usr/bin/shasum
npm install && sudo npm i -g grunt
sudo systemctl start docker && sudo chmod o+rw /var/run/docker.sock && sudo setenforce 0
grunt build
grunt run-dev
@Filirom1
Filirom1 / big-rpm.sh
Created January 20, 2017 13:51
List rpm by size
rpm -qa --queryformat '%{size} %{name}\n' | sort -rn | more
@Filirom1
Filirom1 / custom-logger.rb
Created January 12, 2017 14:41
How to customize a logger in ruby
require 'logger'
module Dim
class Logger < ::Logger
def initialize(*)
super
@formatter = NoTimestampFormatter.new
end
end
@Filirom1
Filirom1 / unpackWAR
Created November 9, 2016 17:47
Script that unpack a WAR
#!/bin/bash
if [ "$#" -eq 0 ]; then
echo "Usage: unpackWAR war_file destination"
echo "Usage: curl -L war_url | unpackWAR destination"
elif [ "$#" -eq 1 ]; then
DEST=$1
mkdir -p $DEST
cat /dev/stdin | bsdtar -xvf - -C $DEST
elif [ "$#" -eq 2 ]; then