Skip to content

Instantly share code, notes, and snippets.

View akora's full-sized avatar

Andras Kora akora

View GitHub Profile
@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 / .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 / 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 / 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 / parallels-dhcp-leases-mac.sh
Last active March 30, 2017 14:16
Location of the Parallels DHCP lease file on Mac OS X Yosemite. It's editable when Parallels is not running.
cat /Library/Preferences/Parallels/parallels_dhcp_leases
@akora
akora / disable-iPhoto-face-recognition.sh
Last active January 12, 2017 10:57
Disable iPhoto's face recognition on Mac OS X Yosemite. Run from command line.
defaults write com.apple.iPhoto PKFaceDetectionEnabled 0
# then right click your PhotoLibrary in Finder (in your Pictures folder) and remove the following files:
# Faces.db (in Pictures/iPhoto Library/Database/apdb)
# Faces folder (in Pictures/iPhoto Library/Database)
@akora
akora / virtualbox-shared-folder-on-debian
Last active January 4, 2016 19:29
Debian 7 VirtualBox shared folder setup in /etc/fstab
<SharedFolderName-on-host-OS> /home/<username>/shared vboxsf defaults,rw,uid=1000,gid=1000 0 0
@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