Skip to content

Instantly share code, notes, and snippets.

View Filirom1's full-sized avatar

Romain Filirom1

View GitHub Profile
@Filirom1
Filirom1 / README.md
Last active August 29, 2015 13:56
Generate OpenShift Enterprise RPM from SRPM

Install mockchain and add the openshift dependency repo in /etc/mock/default.cfg

    [openshift-deps]
    name=openshift-deps
    enabled=1
    gpgcheck=0
    baseurl=https://mirror.openshift.com/pub/origin-server/release/4/rhel-6/dependencies/x86_64/
    priority=2
 failovermethod=priority
@Filirom1
Filirom1 / README.md
Last active August 29, 2015 14:04
What happens when you create an application on OpenShift.

What happens when you create an application on OpenShift.

             __________                __________
            |          |     mco      |          |__
rhc ----->  |  Broker  |  --------->  |   Node   |  |__
            |__________| \            |__________|  |  |
                  /\     \  --------->   |__________|  |
                  |       \ --------->      |__________|
             _____|____ 

| |

@Filirom1
Filirom1 / Gemfile
Last active August 29, 2015 14:06
Only list the latest SRPM files on an online repo
source 'https://rubygems.org'
gem 'nokogiri'
gem 'colorize'
@Filirom1
Filirom1 / gist:8f02365c31e4154d8e23
Created September 29, 2014 12:00
Mcollective list fact values
List facts from one server
$ mco inventory server1.example.com
Then list values for one fact for all servers
$ mco rpc rpcutil get_fact fact=memoryfree
@Filirom1
Filirom1 / debug-headers.sh
Created October 8, 2014 07:34
debug http headers with tcpdump
#!/bin/sh
PORT=$1
tcpdump -i lo -A -s 10240 "tcp port $PORT and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^........(GET |HTTP\/|POST |HEAD )/\n\1/g'
@Filirom1
Filirom1 / README.md
Created January 12, 2015 17:27
gem2rpm

Build RPM from rubygems

. It will fetch the gem file with the right version Ask for the license if missing Build the SRPM and the RPM using gem2rpm and a custom template

~/gem2rpm.sh simplecov '>=0.6.2'
...
Finish: build phase for rubygem-simplecov-0.9.1-1.el6.src.rpm
@Filirom1
Filirom1 / eye.py
Created January 15, 2015 21:46
re-tag mp3
import eyed3
import os
import glob;
for filename in glob.glob('/dir/to/mp3/**/**/*.mp3'):
try:
print(filename)
audiofile = eyed3.load(filename)
audiofile.tag.setTextFrame('TCOM', audiofile.tag.album_artist or audiofile.tag.artist)
@Filirom1
Filirom1 / setcomposer.py
Created January 17, 2015 10:31
MusicBrainz Picard Plugin that force Composer to be Album Artist
PLUGIN_NAME = 'Composer becomes Album Artist'
PLUGIN_AUTHOR = 'Romain Philibert'
PLUGIN_DESCRIPTION = '''Set composer value to album artist.'''
PLUGIN_VERSION = "0.1"
PLUGIN_API_VERSIONS = ["0.15"]
from picard.metadata import register_album_metadata_processor
import re
@Filirom1
Filirom1 / xml2json.rb
Created January 23, 2015 16:25
xml2json with base64 decoding
require "rubygems"
require "crack"
require "json"
require "base64"
myXML = Crack::XML.parse(File.read(ARGV[0]))
def decode_base64(parent, myHash)
myHash.each {|key, value|
if value.is_a?(Hash)
decode_base64(key, value)

$ openssl s_client -connect server:636 -showcerts

$ ldapsearch -x -H "ldaps://server:636" -D 'uid=$UUID,dc=example,dc=com' -W