Skip to content

Instantly share code, notes, and snippets.

View chmouel's full-sized avatar
🤨
Kuberneting

Chmouel Boudjnah chmouel

🤨
Kuberneting
View GitHub Profile
#!/bin/bash
SERVICE=${1:-init-tenant}
F8NS=${2:-fabric8}
while true;do
COUNT=$(kubectl get pod -l service=${SERVICE} -n ${F8NS} --no-headers=true|gwc -l)
if [[ ${COUNT} == 1 ]];then
RUN=$(kubectl get pod --no-headers=true -n ${F8NS} -l service=${SERVICE}|grep '1/1.*Running')
[[ -n ${RUN} ]] && break
elif [[ ${COUNT} == 0 ]];then
#!/bin/bash
set -e
# Set those!!
APIKEY=""
DOMAIN=""
RECORD=""
URL=https://dns.api.gandi.net/api/v5/domains/${DOMAIN}/records/${RECORD}/A
DNSIP=$(curl -s -H "X-Api-Key: $APIKEY" ${URL}| jq --raw-output '.rrset_values[0]')
# -*- coding: utf-8 -*-
# Author: Chmouel Boudjnah <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<global>
<remote>
<red>contextmenu</red>
<green>ActivateWindow(favourites)</green>
<yellow>ActivateWindow(MyVideos,TvShowTitles)</yellow>
<blue>ActivateWindow(Home)</blue>
</remote>
;; Get the current chrome tab and insert the title and the issue number link in
;; org format, gets the labels of the issue too via the github json api
;; Leverage on https://github.com/rejeep/chrome-cli.el for getting current tab
(defun my-get-labels-info-gh(issuenumber)
(let* ((url
(format "https://api.github.com/repos/openshiftio/openshift.io/issues/%s" issuenumber))
(myt (my-github-parse-response (url-retrieve-synchronously url))))
(string-join
(mapcar
@chmouel
chmouel / tz.sh
Last active April 12, 2018 10:32
Moved to https://github.com/chmouel/tzconverter
#!/bin/bash
set -e
#set -x
set -f
remotebranch=chmouel
repo=$1
if [[ $1 == https://github.com* ]];then
repo=${repo/https:\/\/github.com\/}
@chmouel
chmouel / ghprefix.bash
Created April 11, 2018 12:46
Get from chrome Github prefix and issue for GIT branch
#!/bin/bash
# Get current tab in Github and issue number and add a prefix the issue number to use in github branch
# i.e: git checkout -b $(ghprefix)
url=$(chrome-cli info|grep Url|sed 's/Url: //')
if [[ ${url} != *github.com*issues/[0-9]* ]];then
echo $url
echo "This don't seem to be a proper github tab"
exit
fi
@chmouel
chmouel / os-template-filter-type.py
Last active July 10, 2018 09:53
Filter processed openshift templates by types
#!/usr/bin/env python3
# Use python3
# Usage example :
# oc process openshift//cakephp-mysql-persistent -o json \
# |python ~/os-template-filter-type.py BuildConfig dc
# will get the BuildConfig and the DeploymentConfig (alias dc)
# You can specify a specific name for example is=stream will get only the
# ImageStream named stream
import json
import sys
#!/bin/bash
set -e
# Your user name on OSIO
USER=${T-"SET YOUR USERNAME"}
# Get this from your Jenkins setting
API_TOKEN=${JENKINS_API_TOKEN:-"SET THIS"}
# You need to be login with oc or set this manually (but that may change on recration)