Skip to content

Instantly share code, notes, and snippets.

View epcim's full-sized avatar

Petr Michalec epcim

View GitHub Profile
import getopt
import pycassa
import subprocess
import sys
from pycassa.pool import ConnectionPool
from pycassa.columnfamily import ColumnFamily
def query_typename(column, typename):
data = column.get(typename.replace('-', '_'))
@epcim
epcim / byobu-salt.sh
Last active August 10, 2017 12:29
byobu auto create windows from salt-master accepted keys
#!/bin/bash
# wget https://gist.githubusercontent.com/epcim/b44b548cadc566fcabc9f6195a19b1dc/raw/byobu-salt.sh -O byobu-salt.sh; chmod +x *.sh
# set -x
# TODO
# on remote host source ~/.${SHELL}rc
# auto set -o vi
test -n SSH_AGENT || {
@Integralist
Integralist / hugo-build.sh
Created August 28, 2017 06:51
[Hugo build script for User page] #github #hugo #build
#!/usr/bin/env bash
function contains {
local e match="$1"
shift
for e; do [[ "$e" == "$match" ]] && return 0; done
return 1
}
function remove_toplevel {
@igolden
igolden / react-native-ultisnip.snippet
Created December 6, 2016 01:05
React Native snippets for vim and ultisnip
snippet rnccf
import React, { PropTypes } from 'react'
import { View, StyleSheet, Text } from 'react-native'
$1.propTypes = {
}
export default function ${1:FunctionName} (props) {
return (
@Titerote
Titerote / ignition_config.yml
Last active June 29, 2018 13:19
Ignition problem on coreos
---
systemd:
units:
- name: etcd2.service
enable: true
dropins:
- name: 40-etcd-cluster.conf
contents: |
[Service]
Environment="ETCD_NAME={{.etcd_name}}"
import sys
# Constants
OPERATORS = ['*', '/', '+', '-']
DECIMAL_SYMBOLS = [',', '.']
SIGN_SYMBOLS = ['-', '+']
PARENTHESIS_OPEN = '('
PARENTHESIS_CLOSE = ')'
PRECEDENCE = [[PARENTHESIS_OPEN], ['*', '/'], ['+', '-']]
@christophermaier
christophermaier / docker-compose.yml
Created July 17, 2018 21:47
Habitat testing setup
version: '3.2'
services:
bastion:
image: christophermaier/test-probe:0.1.0-20180509175222
command:
- "run"
- "--listen-ctl=0.0.0.0:9632"
- "--permanent-peer"
hostname: bastion
domainname: habitat.dev
@epcim
epcim / docker-compose.yml
Created July 18, 2018 13:08 — forked from christophermaier/docker-compose.yml
Habitat testing setup
version: '3.2'
services:
bastion:
image: christophermaier/test-probe:0.1.0-20180509175222
command:
- "run"
- "--listen-ctl=0.0.0.0:9632"
- "--permanent-peer"
hostname: bastion
domainname: habitat.dev
@nstielau
nstielau / bash.sh
Created June 2, 2011 20:55
Set node attributes, run_list, chef_environment, etc
knife node configure my_node.example.com
@epcim
epcim / pmichalec.env
Last active August 29, 2018 14:26
shell bash simple environment profile env bashrc shellrc
# bash history
# echo 'shopt -s histappend' >> ~/.bashrc
# echo 'PROMPT_COMMAND="history -a;$PROMPT_COMMAND"' >> ~/.bashrc
# echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc
shopt -s histappend
PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
export HISTTIMEFORMAT=
# paths
export PATH=$PATH:~/bin