Skip to content

Instantly share code, notes, and snippets.

@jakub-roman
jakub-roman / python-redis
Created October 15, 2018 14:12
python-redis
#!/usr/bin/env python
import redis
import time
import random, string
from os import getenv
r_host = getenv('HOST', 'localhost')
r_port = getenv('PORT', '6379')
r = redis.StrictRedis(host=r_host, port=r_port)
@jakub-roman
jakub-roman / perl-redis
Created October 15, 2018 14:13
perl-redis
#!/usr/bin/env perl
use strict;
use warnings;
use Redis;
use Data::Dumper;
use Time::HiRes qw/time/;
my $r = Redis->new();
my $num = 10000;
var express = require('express')
var app = express()
var pug = require('pug')
var fs = require('fs')
var bp = require('body-parser')
const config = './config.json'
const timeout = 300 // 5mins
app.use(bp.urlencoded({ extended: false }))
const format = require('pg-format')
var filter = [
{
c: "id",
o: "=",
v: "1"
},
{
c: "name",
#!/bin/bash -x
#
# 1. run as `$0 get-nodes a`
# 2. pick one node and `kubectl describe node ...`
# 3. pick a pod and run `$0 connection <namespace> <pod_name>`
case $1 in
get-nodes)
# second param is AV zone = a/b/c
kubectl get node -l failure-domain.beta.kubernetes.io/zone=ap-southeast-1${2},nodetype=interactive
#!/usr/bin/env python
import sys
import boto3
import random
from colorama import Fore, init
init()
s3 = boto3.client('s3')
#!/usr/bin/env python
import sys
import boto3
import time
import re
import json
backup_time = time.strftime('%Y%m%d%M%H%S')
backup_bucket = 'iflix-backup-acl'

with following config.yaml:

addons:
- helm/kube-system/iflix-namespaces-limits: ["all"]
  kustomize/kube-system/kubernetes-cluster-controller: ["ops"]
- helm/kube-system/kubernetes-github-authn: ["staging"]
  kustomize/kube-system/aws-secret-operator: ["green", "ops"]
  helm/kube-system/traefik: ["prod"]
  helm/kube-system/traefik-int: ["prod","staging","ops"]
#!/bin/bash
CESTA_K_CSV="/tmp/CSV" ## cesta, kde jsi rozbalil archiv (cesta až k souborům)
######################
USER="root" ## uživatel do DB
PASSWORD="" ## heslo do DB
DB="adresy" ## databáze
TABLE="adresni_mista" ## tabulka v DB, kam se budou importovat data
######################
CREATE TABLE `adresni_mista` (
`kod_adm` int(11) NOT NULL,
`kod_obce` int(11) NOT NULL,
`nazev_obce` text NOT NULL,
`kod_momc` int(11) NOT NULL,
`nazev_momc` text NOT NULL,
`kod_mop` int(11) NOT NULL,
`nazev_mop` text NOT NULL,
`kod_casti_obce` int(11) NOT NULL,
`nazev_casti_obce` text NOT NULL,