Skip to content

Instantly share code, notes, and snippets.

apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: backup
namespace: jenkins
spec:
schedule: 0 17 * * * # 00:00 GMT+7
successfulJobsHistoryLimit: 5
failedJobsHistoryLimit: 5
jobTemplate:
{
"workbench.colorCustomizations": {
"[Default Dark+]": {
"focusBorder": "#404552",
"foreground": "#D3DAE3",
"button.background": "#383C4A",
"button.foreground": "#FFF",
"input.border": "#F5F6F7",
"input.background": "#393f4c",
"input.foreground": "#FFF",
@abihf
abihf / list-subnet-by-name.sh
Created April 27, 2018 18:52
List Subnet by name
aws ec2 describe-subnets | jq '[ .Subnets[] | {name: (.Tags[] | select(.Key == "Name") | .Value), id: .SubnetId} ] | sort_by(.name) | .[] | (.id + " " + .name)'
@abihf
abihf / README.md
Created April 6, 2018 12:04
Terraform Provider Update

Why?

When you run terraform init terraform will download required providers from its server, unless you have cached providers in your directory.

How

create folder .terraform.d/plugins in your home directory, then create file update-providers.sh

@abihf
abihf / keybase.md
Last active February 1, 2018 19:15

Keybase proof

I hereby claim:

  • I am abihf on github.
  • I am abihf (https://keybase.io/abihf) on keybase.
  • I have a public key whose fingerprint is 89D0 2A4B 6596 6319 A0AA 9453 3F42 5C7C FFA0 85F8

To claim this, I am signing this object:

@abihf
abihf / Lircmap.xml
Created April 28, 2017 19:55
Kodi Remote configuration for chunshin GS-L1002
<?xml version="1.0" encoding="UTF-8"?>
<lircmap>
<remote device="devinput">
<power>KEY_POWER</power>
<obc161>KEY_F24</obc161><!-- TV/Radio (unused) -->
<contentsmenu>KEY_CONTEXT_MENU</contentsmenu>
<guide>KEY_EPG</guide>
<display>KEY_ZOOM</display>
<obc162>KEY_F23</obc162>
<one>KEY_1</one>
@abihf
abihf / nec-decode.py
Last active April 23, 2017 09:24
Script to decode remote tv code
#!/usr/bin/env python
# How to use:
# ensure lircd is stoped then run
# $ mode2 | python nec-decode.py
#
# Example output:
# -----------------
# 00100000 11011111 - 0xfb04
# 00100010 11011101 - 0xbb44
@abihf
abihf / fetch.py
Created April 18, 2017 18:45
Generate xmltv from Firstmedia EPG
#!/usr/bin/env python2
import sys
import httplib
import json
import xml.etree.ElementTree as ET
from datetime import datetime
channels = {
'net': 'NET.Digital',
@abihf
abihf / ansible-roles-tree.py
Last active July 28, 2022 00:05
Print ansible roles dependencies
#!/usr/bin/env python2
import yaml
from sets import Set
from os import path
import sys
roles_dirs = ['roles', '.']
loaded_roles = Set()
@abihf
abihf / hamidun.py
Created August 11, 2016 07:33
Stupid NginX site generator for load balancing Docker based services
#!/usr/bin/env python
from docker import Client
from os import listdir
from os.path import isfile, join
import re
def main():
docker_host = 'unix://var/run/docker.sock'
docker_network_name = 'load_balancer'