Skip to content

Instantly share code, notes, and snippets.

View StjerneIdioten's full-sized avatar

StjerneIdioten

  • Denmark
View GitHub Profile
@StjerneIdioten
StjerneIdioten / convert.sh
Created February 8, 2023 15:39
Recursively converts ISO-8859-1/Windows-1252/ANSI files to UTF-8
#!/bin/bash
shopt -s globstar
for f in "$(pwd)"/**; do
if [[ $(file -b --mime-encoding "$f") == "iso-8859-1" ]]
then
echo "$f" && iconv -f "iso-8859-1" -t "UTF-8" -o "$f.new" "$f" && mv -f "$f.new" "$f"
fi
done
@StjerneIdioten
StjerneIdioten / change_background.ps1
Created February 8, 2023 11:49
A little workaround for if your org enforces pesky default background settings, but still allows you to have administrative rights ;-) Put powershell and xml file somewhere. Change paths in files to suit your system. Import the xml in task scheduler to setup logon task for running the powershell.
$RegistryPath = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System'
$Name = 'Wallpaper'
$Value = <path_to_your_wallpaper>
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType String -Force
rundll32.exe user32.dll, UpdatePerUserSystemParameters
@StjerneIdioten
StjerneIdioten / zotero_obsidian_collaboration.md
Last active June 2, 2022 21:58
A guide on how I make Zotero and Obsidian collaborate

At the moment this is just a brief overview of what I do and an example of the code, because I was asked about it by someone. If I have the time I will make it look pretty later ;-)

I have a template setup in Zotero for the new markdown functionality. It applies different admonitions that are compatible with Obsidian such as > [!Note] based on the highlight color used in the pdf etc. but unfortunately Zotero escapes these so some cleanup is needed in Obsidian.

I also use the Better BibTeX plugin in Zotero to export a .bib file to the top level of my Obsidian vault, which is automatically updated by Better BibTeX, when I add references in Zotero. It can also tailor the citation keys which is great, because I use those for my Obsidian markdown file titles.

In Obsidian I use two plugins, Templater and Citation. I have setup a file called Escape Zotero.md which conta