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 / README.md
Last active July 27, 2020 14:40
Generate self signed certificates

Execute the following command to create a self signed certificate

openssl genrsa -out private.key 2048
openssl req -nodes -x509 -days 3650 -config ssl.cnf -new -key private.key -out example.com
@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 / 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 / README.md
Last active March 22, 2019 17:21
Extend Ambari
@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 / 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 / big-rpm.sh
Created January 20, 2017 13:51
List rpm by size
rpm -qa --queryformat '%{size} %{name}\n' | sort -rn | more
@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 / README.md
Last active February 2, 2018 16:01
Hoxy Proxy

http://greim.github.io/hoxy/

$ scl enable nodejs010 'npm i  hoxy'
$ scl enable nodejs010 'node proxy.js' &
$ rhc apps --header 'X-Remote-User:demo' --server http://localhost:1337/

request made to:  { 'x-remote-user': 'demo',
  accept: 'application/json',
 'user-agent': 'rhc/1.30.2 (ruby 1.8.7; x86_64-linux) (API 1.11.21.31.41.51.61.7) (2.4.0, ruby 1.8.7 (2011-06-30))',