Skip to content

Instantly share code, notes, and snippets.

View kuba--'s full-sized avatar
☮️
stop war

Kuba Podgórski kuba--

☮️
stop war
View GitHub Profile
@kuba--
kuba-- / elasticput.go
Created May 23, 2017 21:34
elasticsearch put index
package main
import (
"encoding/csv"
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
@kuba--
kuba-- / .vimrc
Last active May 5, 2017 11:36
.vimrc
" NeoBundle Scripts---------------------------------
if has('vim_starting')
set runtimepath+=~/.config/nvim/bundle/neobundle.vim/
set runtimepath+=~/.config/nvim/
endif
let neobundle_readme=expand('~/.config/nvim/bundle/neobundle.vim/README.md')
if !filereadable(neobundle_readme)
echo "Installing NeoBundle..."
@kuba--
kuba-- / git-reset.sh
Last active October 1, 2021 06:57 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@kuba--
kuba-- / service.md
Last active March 11, 2017 13:45 — forked from naholyr/_service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@kuba--
kuba-- / wc-tail.py
Created May 19, 2013 07:23
unix wc | tail commands in python
def wc (fname, options = "-l"):
p = subprocess.Popen(['wc', options, fname], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result, err = p.communicate()
if p.returncode != 0:
return -1
return int(result.strip().split()[0])
def tail (fname, n = 30, out = subprocess.PIPE):