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
@kgizdov
kgizdov / Davmail
Last active October 25, 2022 19:41
DavMail setup
#!/bin/sh
# /usr/bin/davmail
DAVMAIL_HOME=/usr/share/java/davmail
exec "$JAVA_HOME/bin/java" -jar "$DAVMAIL_HOME/davmail.jar" "$@"
@kgizdov
kgizdov / i3lock-us-layout-convert
Created May 30, 2020 08:29
i3lock wrapper to set keyboard layout and match input image to screen resolution
#!/bin/bash
# set keyboard to us
setxkbmap us
# convert to fit screen
SCREEN_RES="$(xdpyinfo | grep dimensions | cut -d\ -f7)"
SCREEN_WIDTH="$(echo "$SCREEN_RES" | cut -dx -f1)"
# echo $SCREEN_RES
# echo $SCREEN_WIDTH
@kgizdov
kgizdov / CMakeLists.txt
Last active December 3, 2019 16:25
ROOT CMake Test
cmake_minimum_required(VERSION 3.10)
# set the project name
project(Tutorial VERSION 0.0.1)
# add the executable
add_executable(Tutorial tutorial.cpp)
# find_package(ROOT)
# Load Macro to locate ROOT and needed libraries
@kgizdov
kgizdov / per_bin_sqsum_weights.py
Created October 18, 2017 15:53
Construct per bin squared sum of weights for later error estimation
def per_bin_sqsum_weights(bins, sample, v_name, w_name):
return sqrt_sqs_w = [sqrt_sqs_w.append(np.sqrt(np.sum((sample[w_name][np.where(bin_ids == i)[0]])**2))) for i in np.digitize(sample[v_name], bins)]
> 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
@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.
@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 / 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 / .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 / .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