Skip to content

Instantly share code, notes, and snippets.

@abihf
abihf / git-hooks-post-receive.sh
Last active August 29, 2015 14:03
Git auto deploy on push
#!/bin/sh
read oldrev newrev refname
branch=`echo "$refname" | cut -d/ -f3`
if [ "master" = "$branch" ]
then
deploy_target=`git config --get deploy.target`
if [ -z "$deploy_target" ]; then
@abihf
abihf / VirtualJCard.java
Last active August 29, 2015 14:07
Virtual Java Card
/**
* Virtual Java Card
* Copyright 2014-2015 Abi Hafshin < abi [at] hafs [dot] in >
*
* 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
*
@abihf
abihf / boot-splash.c
Last active August 29, 2015 14:24
Boot Splash Animation for 1366x768 computer
// do what dafuq you want to this fuckin shit
// but some code taken from psplash
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <stdint.h>
#include <string.h>
@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'
@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 / 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 / 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 / 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 / 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 / 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