Skip to content

Instantly share code, notes, and snippets.

View jitran's full-sized avatar
🏀

Ji Tran jitran

🏀
View GitHub Profile
@jitran
jitran / setup_python36_rhel6.sh
Created May 15, 2018 05:14
Run Python 3.6 in RHEL6
#!/bin/bash
if grep -q -i "release 6" /etc/redhat-release 2> /dev/null
then
sudo yum -y install scl-utils
sudo yum -y install --enablerepo=rhui-ap-southeast-2-rhel-server-rhscl rh-python36
PYTHON36=$(scl enable rh-python36 "bash -c 'which python'")
export PATH=$(dirname $PYTHON36):$PATH
fi
@jitran
jitran / fluentd_kubernetes_dynamic_config.yaml
Last active July 25, 2018 09:51
Dynamic FluentD Configuration for Kubernetes cluster logs using kubernetes_metadata, rewrite_tag_filter, and forest plugins
apiVersion: v1
data:
fluentd.conf: |
# Capture the kubernetes pod container logs
<source>
@type tail
format json
path /var/log/containers/*.log
pos_file /var/log/kubernetes.pos
time_format %Y-%m-%dT%H:%M:%S
@jitran
jitran / Puppet-Spec-Rakefile
Last active August 29, 2015 14:08
Rakefile for running spec tests for puppet modules
require 'rake'
require 'rspec/core/rake_task'
require 'yaml'
namespace :spec do
desc 'Run unit tests'
task :unit do
FileList["modules/*/Rakefile"].each do |project|
dir = project.pathmap("%d")
sh "cd #{dir}; rake spec:unit"