Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View akora's full-sized avatar

Andras Kora akora

View GitHub Profile
@akora
akora / .zshrc
Last active January 17, 2022 10:45
zsh-prompt-macos-catalina
# compaudit | xargs chmod g-w
autoload -Uz compinit && compinit
autoload -U promptinit && promptinit
autoload -U colors && colors # Enable colors in prompt
autoload -Uz vcs_info
precmd() { vcs_info }
setopt prompt_subst
# The below is based on the fantastic work of Josh Dick from
# https://joshdick.net/2017/06/08/my_git_prompt_for_zsh_revisited.html
@akora
akora / rename-basedOn-ShutterCount-DateTimeOriginal.sh
Last active September 30, 2018 17:30
This script renames ( << suggests new filenames) Nikon NEF (RAW) files based on shutter count and date & time information the photos were taken
#!/bin/bash
# This script renames Nikon NEF (RAW) files based on shutter count (EXIF "Shutter Count")
# and date & time information the photos were taken (EXIF "DateTimeOriginal")
# Dependency: exiftool must be installed
# by Andras Kora, ak@akora.info, 2018-09-30 Sun 18:21:19 CEST @723
for file in *.nef ; do
echo -n "Processing $file >> "
exif_shutter_count_info=$(exiftool -ShutterCount -s -s -s "$file")
@akora
akora / extract-shutterCount.sh
Created September 29, 2018 15:00
This script extracts Shutter Count information from Nikon NEF (RAW) files and saves the output into a CSV file (uses exiftool)
#!/bin/bash
# This script extracts Shutter Count information from Nikon NEF (RAW) files
# and saves the output into a CSV file (for further processing)
# Dependency: exiftool must be installed
# by Andras Kora, ak@akora.info, 2018-09-29 Sat 16:18:37 CEST @638
TIMESTAMP=$(date +%s)
FILENAME=$1
@akora
akora / set-default-ical-time-zones-mac-os.sh
Created April 18, 2015 16:54
Set default time zones in iCal in Yosemite
# read the current settings
defaults read com.apple.iCal 'RecentlyUsedTimeZones'
#set new defaults
defaults write com.apple.iCal 'RecentlyUsedTimeZones' '("America/New_York", "Europe/Budapest", "Europe/London")'
@akora
akora / capture-windows-without-shadows-mac-os.sh
Created March 17, 2015 22:14
Capture windows on Mac OS X as JPEGs without shadows
screencapture -ow ~/Documents/<subdirectory>/<name-of-the-file>.jpg
# -o in window capture mode, do not capture the shadow of the window
# -w only allow window selection mode
@akora
akora / remove-diacritics-google-sheet
Created February 28, 2015 11:18
Removes all diacritics from strings (e.g. names) in a Google spreadsheet
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C2,"ö","o"),"ü","u"),"ó","o"),"ő","o"),"ú","u"),"é","e"),"á","a"),"ű","u"),"í","i"),"Ö","O"),"Ü","U"),"Ó","O"),"Ő","O"),"Ú","U"),"É","E"),"Á","A"),"Ű","U"),"Í","I")
@akora
akora / remove-formatting-clipboard-content-yosemite
Last active August 29, 2015 14:15
Remove formatting of clipboard content (turning it into plain text) when copy-pasting - Mac OS Yosemite
Open 'System Preferences'
Select 'Keyboard'
Select tab 'Shortcuts'
Select 'App Shortcuts' from the left listbox
Click '+' below right listbox
Select 'All Applications' for 'Application' input box
Type 'Paste and Match Style' into the 'Menu Title' input box
@akora
akora / mac-os-git-aware-bash-prompt.sh
Created February 22, 2015 16:57
Mac OS Yosemite Git aware (two-line) bash prompt
# settings for the main prompt
BLUE="\[\e[44;36m\]"
PATH_SHORT="\w"
COLOR_RESET="\[\e[0m\]"
NEW_LINE="\n"
# RAG colors indicating git status
RED="\[\033[0;31m\]"
AMBER="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
@akora
akora / install-packer-on-mac-os.sh
Last active September 7, 2020 18:37
Install packer on Mac OS
curl -O -L https://dl.bintray.com/mitchellh/packer/packer_0.7.5_darwin_amd64.zip
unzip packer_0.7.5_darwin_amd64.zip
sudo mv packer_0.7 /usr/local/packer
sudo chown $USER /usr/local/packer/
# then update your .bash_profile with the new path e.g.:
# export PATH="/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/local/packer:$PATH"
@akora
akora / install-flash-plugin-on-debian7-kde.sh
Created February 16, 2015 18:10
Install Flash plugin (for Chrome) on Debian 7 KDE
sudo echo "deb http://ftp.dk.debian.org/debian wheezy-backports main contrib" >> /etc/apt/sources.list
sudo apt-get update
sudo aptitude -t wheezy-backports install pepperflashplugin-nonfree