Skip to content

Instantly share code, notes, and snippets.

@Krylon360
Krylon360 / jenkins-home-git.sh
Created December 7, 2016 20:37 — forked from cenkalti/jenkins-home-git.sh
Backup Jenkins home periodicallly with git.
#!/bin/bash
# Setup
#
# - Create a new Jenkins Job
# - Mark "None" for Source Control Management
# - Select the "Build Periodically" build trigger
# - configure to run as frequently as you like
# - Add a new "Execute Shell" build step
# - Paste the contents of this file as the command
@Krylon360
Krylon360 / awsauth
Created July 21, 2016 23:07
A simple helper script to generate dynamic AWS credentials using vault, authenticating using LDAP
#!/bin/bash
#
# This script:
# - Authorises a user against vault using LDAP
# - Generates AWS Access keys
# - Sets AWS Access key environment variables in all known formats
# - Writes ~/.aws/credentials
#
export VAULT_ADDR="https://YOUR_VAULT_HOSTNAME:8200"
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'service-kubernetes'
tls_config:
insecure_skip_verify: true
bearer_token_file: /bearer_token
kubernetes_sd_configs:
- api_servers:
@Krylon360
Krylon360 / gist:c443e9cb584a9850007071d7c943501d
Created April 19, 2016 18:37
How to boot CoreOS on OpenStack when config-drive is enforced
In this post I will show you how to boot a CoreOS instance on OpenStack when the config-drive is enforced.
But first we need to understand why booting a CoreOS instance on OpenStack with the config-drive enforced is problematic.
Well, for some reason the IP address information needed by CoreOS to create the `/etc/environment` file is being omitted from the config-drive metadata. Without this file CoreOS is unable to start its core services etcd and fleetctl.
You can verify this by logging into a coreos instance and checking the content of the openstack meta_data.json at the config-drive mount:
```
core@coreos1 ~ $ cat /media/configdrive/openstack/latest/meta_data.json
@Krylon360
Krylon360 / coreos-cobbler-dynamic-cloudconfig
Created November 11, 2015 17:18
cobbler_coreos-cloud-config
import templar
import re
import os
def register():
return "/var/lib/cobbler/triggers/sync/post/*"
def run(api,args,logger):
input_template = open("/etc/cobbler/coreos-cloud-config.template")
@Krylon360
Krylon360 / DockerService
Created November 10, 2015 21:07
DockerService Monitoring
#!/usr/bin/env python
#
import sys
from docker import Client
from optparse import OptionParser
import json
from zabbix.sender import ZabbixMetric, ZabbixSender
@Krylon360
Krylon360 / docker_stats
Created November 10, 2015 21:04
docker-stats
from docker_service import DockerService
parser = DockerService.OptionParser()
parser.add_option('-u', '--url', default='unix://var/run/docker.sock',
help='URL for Docker service (Unix or TCP socket).')
parser.add_option('-l', action="store_true", dest="list", default=False)
(opts, args) = parser.parse_args()
# Docker access
docker_service = DockerService.DockerService(opts.url)

Dashing dashboard for zabbix trigger

zabbix trigger zabbix trigger

This will provide the total number of alerts on triggers status

  • flash when there's an alert/triggers (color based on the zabbix trigger color format)
  • trigger = Warning, Average, High & Disaster
  • unacknowledge triggers
@Krylon360
Krylon360 / media_codecs
Created October 25, 2012 02:17
codec file from hd build
<MediaCodecs>
<Decoders>
<MediaCodec name="OMX.TI.720P.Decoder" >
<Type name="video/avc" />
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Quirk name="input-buffer-sizes-are-bogus" />
</MediaCodec>
<MediaCodec name="OMX.TI.Video.Decoder" >
<Type name="video/mp4v-es" />
@Krylon360
Krylon360 / OMX
Created October 21, 2012 23:52
TI Changes
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index a75b29b..181b30b 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -1312,6 +1312,9 @@ void AwesomePlayer::initRenderer_l() {
if (USE_SURFACE_ALLOC
&& !strncmp(component, "OMX.", 4)
&& strncmp(component, "OMX.google.", 11)
+#ifdef OMAP_ENHANCEMENT
+ && strncmp(component, "OMX.TI.", 7)