Skip to content

Instantly share code, notes, and snippets.

View kgizdov's full-sized avatar
🏠
Working from home

Konstantin Gizdov kgizdov

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am kgizdov on github.
  • I am kgizdov (https://keybase.io/kgizdov) on keybase.
  • I have a public key whose fingerprint is 4BE6 1D68 4CB4 E317 4161 4E70 89AA 2723 1C53 0226

To claim this, I am signing this object:

@kgizdov
kgizdov / robbyrussell.zsh-theme
Last active March 27, 2019 21:39
Variation on robbyrussell theme for ZSH
#!/bin/zsh
local user_host="%{$fg_bold[yellow]%}%n%{$reset_color%}%{$fg[green]%}@%{$reset_color%}%{$fg[blue]%}${HOST[(ws:.:)1]}%{$reset_color%}"
local ret_status="%(?:%{$fg_bold[green]%}❯ :%{$fg_bold[red]%}❯ )%{$reset_color%}"
local curr_dir="%{$fg_bold[cyan]%}%c%{$reset_color%}"
local work_dir="/afs/cern.ch/work/k/kgizdov"
dir_arrow () {
local dir_arrow
if [[ $(pwd) == $HOME ]]; then
dir_arrow="%{$fg_bold[green]%}⁕ %{$reset_color%}"
@kgizdov
kgizdov / image-update.sh
Last active November 15, 2016 14:32
Update docker image
#!/bin/bash
IMAGENAME=$1
LOCALFILE=$2
DESTINATION=$3
DIR=$(dirname $3)
docker run -i ${IMAGENAME} /bin/bash -c 'mkdir -p "$1" && cat > "$2"' -- ${DIR} ${DESTINATION} < ${LOCALFILE}
docker commit `docker ps -l -q` ${IMAGENAME}:latest
@kgizdov
kgizdov / PKGBUILD
Last active October 17, 2016 14:36
Pythia8 package with correct PYTHONPATH
# Maintainer: Stefano Campanella <stefanocampanella1729@gmail.com>
# Contributor: Konstantin Gizdov <kgizdov@gmail.com>
pkgname=pythia
pkgver=8.2.19
_pkgid=$pkgname`echo $pkgver | tr -d '.'`
pkgrel=1
pkgdesc="Generation of high-energy physics events."
arch=('i686' 'x86_64')
url="http://home.thep.lu.se/Pythia/"
license=('GPL')
@kgizdov
kgizdov / .SRCINFO
Created December 30, 2016 00:41
TeamViewer PKGBUILD
pkgbase = teamviewer
pkgdesc = All-In-One Software for Remote Support and Online Meetings
pkgver = 12.0.71510
pkgrel = 7
url = http://www.teamviewer.com
install = teamviewer.install
arch = i686
arch = x86_64
license = custom
depends = fontconfig
@kgizdov
kgizdov / .zshrc
Last active April 10, 2017 11:29
# Path to your oh-my-zsh installation.
export ZSH=/home/$USER/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@kgizdov
kgizdov / ext-disp.sh
Last active April 10, 2017 11:26
Automatic XRandR for external monitor
#!/bin/zsh
ext-disp () {
if [[ $# < 4 || $# > 5 ]]; then
echo "usage: ${0} <side> <scale factor> <width> <height>"
echo "usage: ${0} <side> <scale factor> <width> <height> <do>"
echo "<side>: left, right, above, below"
echo "<scale factor>: must be integer"
echo "<do>: should the command be executed - [1/0] [yes/no] [y/n]"
echo " by default the command is printed only"
return 1
@kgizdov
kgizdov / python_g.py
Last active February 15, 2019 00:46
Helper functions for Ganga
import traceback
import sys
import os
# Define EOS Folder
_EOS_PATH = 'root://eoslhcb.cern.ch//eos/lhcb/grid/user'
def dprint(is_debug = False, message = None):
'''
@kgizdov
kgizdov / keytab.py
Created July 23, 2017 13:57
Template to later be converted to expect syntax
#!python
from getpass import getuser, getpass
default_keytab = '/home/%s/.kt' % getuser()
default_domain = 'CERN.CH'
ktutil = '/usr/bin/ktutil'
__doc__ = """Keytab file maintenance utility.
> ktutil
ktutil: addent -password -p username@CERN.CH -k 1 -e rc4-hmac
Password for username@ADS.IU.EDU: [enter your password]
ktutil: addent -password -p username@CERN.CH -k 1 -e aes256-cts
Password for username@ADS.IU.EDU: [enter your password]
ktutil: wkt username.keytab
ktutil: quit