Skip to content

Instantly share code, notes, and snippets.

View babadofar's full-sized avatar
💭
Infinity

Christoffer Vig babadofar

💭
Infinity
View GitHub Profile
@babadofar
babadofar / stdin-stdout
Created April 10, 2015 08:06
Logstash configurations
input {
stdin { codec => json }
}
filter {
if ![clicked] {
mutate {
add_field => ["clicked", false]
}
}
input {
file {
path => "C:/inetpub/logs/LogFiles/W3SVC2/u_ex150428.log"
type => "IIS"
start_position => "beginning"
}
}
filter {
@babadofar
babadofar / analyzer.json
Last active September 30, 2015 11:03
hyphenation decompounder
{
"settings": {
"analysis": {
"analyzer": {
"hyph_decoumpound_list": {
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
"hyph_decompound_list"
@babadofar
babadofar / elastic_cluster_remove_read_only.py
Last active May 6, 2019 15:57
Update elasticsearch cluster settings, remove read only flag on all indexes
# This script updates read only indexes and sets them to be writable agin
# Useful if your disk suddenly has run full - elasticsearch sets ALL your indexes to read only
# You should increase disk size, either by adding disks, or by deleting large indexes, before you run this script
# authored by @babadofar
# running in python 2.7, elasticsearch 6.7, probaby not in other versions of either.
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch(['https://elasticsearch.no'],
http_auth=('kong', 'king'))
apiVersion: jenkins.io/v1
kind: SourceRepository
metadata:
annotations:
jenkins.io/chart: env
jenkins.io/last-build-number-for-master: "16"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"jenkins.io/v1","kind":"SourceRepository","metadata":{"annotations":{"jenkins.io/chart":"env"},"labels":{"jenkins.io/chart-release":"jenkins-x","jenkins.io/gitSync":"false","jenkins.io/namespace":"jx","jenkins.io/version":"1"},"name":"mentor-medier-environment-mentordigital-dev-staging","namespace":"jx"},"spec":{"description":"the git repository for the Staging environment","httpCloneURL":"https://github.com/mentor-medier/environment-mentordigital-dev-staging.git","org":"mentor-medier","provider":"https://github.com","providerKind":"github","providerName":"github","repo":"environment-mentordigital-dev-staging","scheduler":{"kind":"Scheduler","name":"env-scheduler"},"url":"https://github.com/mentor-medier/environment-mentordigital-dev-staging.git"}}
creationTimestamp: "2019-11-07T21:55:
apiVersion: jenkins.io/v1
kind: SourceRepository
metadata:
annotations:
jenkins.io/chart: env
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"jenkins.io/v1","kind":"SourceRepository","metadata":{"annotations":{"jenkins.io/chart":"env"},"labels":{"jenkins.io/chart-release":"jenkins-x","jenkins.io/gitSync":"false","jenkins.io/namespace":"jx","jenkins.io/version":"1"},"name":"mentor-medier-environment-mentordigital-dev-production","namespace":"jx"},"spec":{"description":"the git repository for the Production environment","httpCloneURL":"https://github.com/mentor-medier/environment-mentordigital-dev-production.git","org":"mentor-medier","provider":"https://github.com","providerKind":"github","providerName":"github","repo":"environment-mentordigital-dev-production","scheduler":{"kind":"Scheduler","name":"env-scheduler"},"url":"https://github.com/mentor-medier/environment-mentordigital-dev-production.git"}}
creationTimestamp: "2019-11-07T21:55:41Z"
generation: 1
labels:
@babadofar
babadofar / kubernetes cpu metricbeat
Last active March 12, 2020 20:48
kubernetes cpu metricbeat
GET /metricbeat-*/_search
{
"size": 0,
"query": {
"range": {
"@timestamp": {
"gte": "now-15m"
}
}
},
@babadofar
babadofar / secret-schema.yaml
Created August 13, 2021 09:13
using github packages for maven repository
apiVersion: secret.jenkins-x.io/v1alpha1
kind: Schema
spec:
objects:
- name: jx-basic-auth-user-password
mandatory: true
properties:
- name: username
question: the username for basic auth ingresses
help: The username to login to basic authenticated URLs