Skip to content

Instantly share code, notes, and snippets.

View chrisgilbert's full-sized avatar

Chris Gilbert chrisgilbert

View GitHub Profile
@chrisgilbert
chrisgilbert / gist:755a8e033cd7a072ed6f0c3abd757976
Last active August 5, 2023 12:46
Copy Apple XMP subject info to original file
# See https://exiftool.org/forum/index.php?topic=13167.msg71166#msg71166
# Also https://raw.githubusercontent.com/exiftool/exiftool/master/arg_files/xmp2exif.args
# Fix info including GPS
exiftool -overwrite_original_in_place -r -wm cg -ext mov -api QuickTimeUTC=1 -tagsFromFile %d%f.xmp '-AllDates<XMP-photoshop:DateCreated' '-Track*Date<XMP-photoshop:DateCreated' '-Media*Date<XMP-photoshop:DateCreated' '-Keys:CreationDate<XMP-photoshop:DateCreated' '-Keys:GPSCoordinates<$XMP:GPSLatitude# $XMP:GPSLatitudeRef, $XMP:GPSLongitude# $XMP:GPSLongitudeRef' '-Keys:DisplayName<XMP-dc:Title' '-Keys:Description<XMP-dc:Description' '-Keys:Keywords<XMP-dc:Subject' '-FileCreateDate<XMP-photoshop:DateCreated' '-FileModifyDate<XMP-photoshop:DateCreated' .
# Just import additional descriptions and keywords to original, don't replace any existing tag
# also change file modification and creation dates to dates of xmp data
exiftool -overwrite_original_in_place -wm cg -ext jpg -ext heic -tagsFromFile %d%f.xmp '-Keys:DisplayName
@chrisgilbert
chrisgilbert / Dockerfile
Last active April 10, 2024 18:55
nextcloud-ffpmeg
FROM nextcloud:apache
ENV PHP_UPLOAD_LIMIT 10G
RUN apt-get update && apt-get install -y \
imagemagick-common \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
before_compile:
- echo "Before compile"
stage_name_constructor: >
node seed/sanitise-branch.js "$SEED_STAGE_BRANCH" 2>/dev/null
if [[ $? -ne 0 ]]; then
echo "test-branch"
fi
@chrisgilbert
chrisgilbert / config
Last active May 5, 2022 14:10 — forked from jonnyyu/config
# add to ~/.aws/config and add the path to your folder.
[serverless-deployments-dev]
role_arn = arn:aws:iam::ACCOUNT_ID:role/ROLE-NAME
role_session_name = SESSION_NAME
region = eu-west-2
@chrisgilbert
chrisgilbert / test.md
Last active March 18, 2022 14:55
Test mermaid
graph TD
    A[Github PR]-->|Check code changes| B{Any changed terraform envs}
    B -->|Users| C[Terraform Init]
    B -->|Backups| C
    B -->|Prod| C
    B -->|Dev| C
    C --> D[Terraform Plan]
@chrisgilbert
chrisgilbert / gist:6cb797163e025500d35154305a99c3cd
Created October 11, 2021 08:56
OCC Photo Preview Generator With Quality Settings
#
# See: https://ownyourbits.com/2019/06/29/understanding-and-improving-nextcloud-previews/
#
OCC="sudo -u www-data php /var/www/nextcloud/occ"
$OCC config:app:set previewgenerator squareSizes --value="32 256"
$OCC config:app:set previewgenerator widthSizes --value="256 384"
$OCC config:app:set previewgenerator heightSizes --value="256"
$OCC config:system:set preview_max_x --value 2048
$OCC config:system:set preview_max_y --value 2048
@chrisgilbert
chrisgilbert / keybase.md
Created September 22, 2021 10:37
keybase.md

Keybase proof

I hereby claim:

  • I am chrisgilbert on github.
  • I am chrisg42 (https://keybase.io/chrisg42) on keybase.
  • I have a public key ASBHG45-1jFJEKScKrsTKaAmQe2R3Hopwxa5yUguyN4nugo

To claim this, I am signing this object:

function ecr-login()
{
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 761584570493.dkr.ecr.us-east-1.amazonaws.com
}
@chrisgilbert
chrisgilbert / findLongRunningOp.js
Created September 14, 2020 08:57 — forked from kylemclaren/findLongRunningOp.js
Find and (safely) kill long running MongoDB ops
db.currentOp().inprog.forEach(
function(op) {
if(op.secs_running > 5) printjson(op);
}
)
@chrisgilbert
chrisgilbert / reset-identity-columns.sql
Last active July 29, 2020 14:30
Reset SQL Server Identity Columns With a Gap
DECLARE @column_name varchar(MAX);
DECLARE @table_name varchar(MAX);
DECLARE curs CURSOR FOR
SELECT
identity_columns.name as ColumnName,
tables.name as TableName
FROM sys.tables tables
JOIN sys.identity_columns identity_columns
ON tables.object_id=identity_columns.object_id
ORDER BY tables.name;