Skip to content

Instantly share code, notes, and snippets.

View zlatko-minev's full-sized avatar
👋

Zlatko Minev zlatko-minev

👋
View GitHub Profile
@minidoc
minidoc / diff-dirs
Last active October 29, 2020 23:47
rsync-compare-directories - https://unix.stackexchange.com/a/463214
#!/bin/bash
# Compare two directories using rsync and print the differences
# CAUTION: options MUST appear after the directories
#
# SYNTAX
#---------
# diff-dirs Left_Dir Right_Dir [options]
#
# EXAMPLE OF OUTPUT
#------------------
@koter84
koter84 / update_gitkraken.sh
Last active April 16, 2019 18:29
updater for GitKraken
#!/bin/bash
# get current dir
prog_dir="/opt/$(ls /opt/ | grep gitkraken | grep -v tar)"
if [ "$prog_dir" == "/opt/" ]
then
prog_dir=""
fi
echo "DIR: $prog_dir"
if [ -f $prog_dir/gitkraken ]
@pmbuko
pmbuko / get_ordered_active_ens.py
Last active August 12, 2018 23:43
This python script returns a list of active ethernet interfaces in their service priority order. OS X only, as it depends on the 'networksetup' command.
#!/usr/bin/env python
from re import findall
from subprocess import check_output
def getOrderedInterfaces():
"""Returns all ethernet interfaces in service order."""
interfaces = check_output(['networksetup', '-listnetworkserviceorder'])
matches = findall(r' en[\d]+', interfaces)
return [ i.lstrip(' ') for i in matches ]
@kaloprominat
kaloprominat / python: simple pyobjc app example
Created July 29, 2013 15:36
python: simple pyobjc app example
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
# We need to import the relvant object definitions from PyObjC
from AppKit import *
from PyObjCTools import AppHelper