Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
talkingmoose / Download and Install Jamf Connect.zsh
Last active February 26, 2024 16:30
Downloads and installs the latest available Jamf Connect software for Mac directly on the client. This avoids having to manually download and store an up-to-date installer on a distribution server every month.
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
bill@talkingmoose.net
https://gist.github.com/talkingmoose/94882adb69403a24794f6b84d4ae9de5
@lantrix
lantrix / update-exif-from-date-in-filename.sh
Last active September 29, 2023 20:35
Update an exif DateTimeOriginal from data that is stored in the filename from the camera
#!/bin/bash
# For Camera Photos that need the following fix:
# - the DateTimeOriginal was in the filename (the actual time you want as Exif.Image.DateTimeOriginal, and File System Modification Date/Time)
# - The File System Modification Date/Time is wrong
# - the Exif.Image.DateTime was never set or was wrong
# - the Exif.Photo.DateTimeDigitized was never set or was wrong
# - the Exif.Image.DateTime was never set but exists in the MetadataDate
@krohne
krohne / countdown.sh
Last active March 1, 2024 20:17
Countdown timer in bash shell script
#!/bin/bash
# $1 = # of seconds
# $@ = What to print after "Waiting n seconds"
countdown() {
secs=$1
shift
msg=$@
while [ $secs -gt 0 ]
do
printf "\r\033[KWaiting %.d seconds $msg" $((secs--))
@andrepearce
andrepearce / chromium_update.sh
Last active April 2, 2024 09:21 — forked from Superbil/chromium_update.sh
Auto Update Chromium on OSX
#!/bin/sh -ex
# Chromium update script
# - forked from Superbil/chromium_update.sh
# - Updated by andrepearce
OS=mac
DL_URL=https://download-chromium.appspot.com/dl/${OS}?type=snapshots
INSTALL_DIR=/Applications
TMP_DIR="/tmp/update-chrome-$RANDOM"
TMP_File=chromium.zip
@Freaky
Freaky / borg-backup.sh
Last active February 20, 2023 20:39
Simple BorgBackup script
#!/bin/sh
#
# borg-backup.sh - BorgBackup shell script
#
# Author: Thomas Hurst <tom@hur.st>
#
# No warranty expressed or implied. Beware of dog. Slippery when wet.
# This isn't going to be your *only* backup method, right?
#
# Synopsis:
@geerlingguy
geerlingguy / dashcam-time-lapse.sh
Last active August 10, 2023 06:06
Create a time lapse video from a set of real-time dash cam clips.
#!/bin/bash
#
# Batch Time-Lapse creation script.
#
# This script can be used to speed up, trim, and finally concatenate tens or
# even hundreds of video clips, e.g. from a dash cam. You can do other things,
# too, but the main things this script does include:
#
# 1. Copy across and speed up video clips from an input dir to an output dir.
# 2. Trim off the first x frames of each of the copied/sped up clips.
@agunnerson-ibm
agunnerson-ibm / human_readable.sh
Last active May 30, 2019 16:58
Bash function to convert bytes to human readable size
# Copyright 2015 Andrew Gunnerson <andrewgunnerson@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@tkhduracell
tkhduracell / fix.sh
Last active February 19, 2023 13:09
Fix locale on raspberry pi (raspbian) "Setting locale failed."
#
# How to get rid of the locale warning on raspberry pi
#
sudo sed -i "s/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g" -i /etc/locale.gen
sudo locale-gen en_US.UTF-8
sudo update-locale en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
@rmondello
rmondello / gist:b933231b1fcc83a7db0b
Last active April 5, 2024 07:10
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

Update (October 2021)

Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.

Original, Obsolete Content (2014)

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.

@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active March 25, 2024 22:48
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /