Skip to content

Instantly share code, notes, and snippets.

View MansM's full-sized avatar

Mans Matulewicz MansM

  • Utrecht, The Netherlands
View GitHub Profile
@MansM
MansM / dedup.ps1
Created January 8, 2023 14:22
Small snippet to deduplicate my canon camera's files (it writes raw files to both sd cards), usage dedup.ps1 "foldername"
param(
[Parameter()]
[string]$Locatie
)
$excluded = @("*_1.CR3", "*_1.CR3.dop")
$files = Get-ChildItem "$Locatie/" -Exclude $excluded
foreach ($f in $files){
$underscore_file = "$Locatie/$($f.BaseName)_1.CR3"
if (Test-Path -Path $underscore_file -PathType Leaf) {
$hash_orig = Get-FileHash $f.FullName
# original borrowed from https://www.trion.de/news/2019/02/01/kaniko-arm-image.html and adapted to normal arm instead of arm64
# keep in mind you need to put the arch in every FROM..... or it wont work
---
apiVersion: batch/v1
kind: Job
metadata:
name: kaniko-build
labels:
run: dind
name: dind
@MansM
MansM / brewupdater.sh
Created January 22, 2018 09:48
updating brew casks, just listing the casks not doing the actual work
#!/bin/bash
LIST=""
for i in $(brew cask list)
do
AVAIL=$(brew cask info $i|head -1|awk {' print $NF '})
INSTA=$(basename $(brew cask info $i|head -3|tail -1|awk {' print $1 '}))
if [ "$AVAIL" != "$INSTA" ]
then
echo "$i - $AVAIL != $INSTA"
Message
INFO interface: error: The box 'mansm/CentOS-7' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://atlas.hashicorp.com/mansm/CentOS-7"]
Error:
The box 'mansm/CentOS-7' could not be found or
'ascii' codec can't decode byte 0xe2 in position 90: ordinal not in range(128)
Docker for mac -> open docker preferences -> reset everything
docker-compose very slow:
add to /etc/hosts
127.0.0.1 localhost localunixsocket
@MansM
MansM / fixing line endings (dos 2 unix)
Last active November 12, 2015 11:08
line endings fixen op een windows machine
find . -not -type d -exec file "{}" ";" | grep CRL
for i in `find . -not -type d -exec file "{}" ";" | grep CRL|awk {'print $1 '} |tr -d ':'`; do dos2unix $i; done
images:
docker images |grep "<none>" |awk {'print $3'}|xargs docker rmi -f d
containers:
docker rm ${docker ps -a -q}