Skip to content

Instantly share code, notes, and snippets.

View ringe's full-sized avatar

Runar Ingebrigtsen ringe

View GitHub Profile
@ThomasHineXYZ
ThomasHineXYZ / KeepToMarkdown.py
Last active January 7, 2023 13:58
Google Keep "Takeout" to Markdown Converter
#!/usr/bin/env python
# Google Keep "Takeout" to Markdown Converter
# This allows you to convert your Google Keep notes that are downloaded from
# Google's "Takeout" system. This works with Nextcloud's Notes system.
from datetime import datetime
import json
import os
import shutil
@mitchellrj
mitchellrj / readme.md
Last active April 22, 2021 19:22
Get snapshot from Unifi Protect

Any commands in this guide are to be run on the CloudKey over SSH.

1. Create a new read-only user

Do this through the web interface, create a local user with username & password (not email address). It doesn't matter what you set the password to, you'll never use it.

2. Set your user to have the right permissions

There's no option to set user permissions through the web interface for local users. We need to find out the ID of the View Only group...

psql -p 5433 -U unifi-protect unifi-protect -c "SELECT id from groups WHERE name='View Only';"
@ringe
ringe / Export all Exchange mailboxes
Last active December 15, 2015 07:59
Say you want to export all your Exchange mailboxes to PST files, but would like to know which Active Directory "Windows" user names the mailboxes belongs to. Turns out it's not straightforward, unless there's something I don't get. First: Export a list of all AD users by their name, including their username - the one used in "DOMAIN\username", y…
# Then this in Exchange Management Shell
$Location = "\\server\pstexport"
New-Item -path $Location -name "migrate.txt" -type File -force
Add-Content "$Location\migrate.txt" "datasourceuser,destinationuser"
# Create a hash table of Exchange mailboxes
$mailboxes = @{}
Get-Mailbox | Select-Object name, alias |
ForEach-Object { $mailboxes.Add($_.name, $_.alias) }
@olistik
olistik / gist:2627011
Last active August 12, 2021 06:39
Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

Basic pre-requisites

  • Some utilities:
sudo apt-get install vim tmux git curl
  • Copy/paste from the command line:
@chicagoworks
chicagoworks / jQuery.stringify.js
Created December 24, 2010 19:05
jQuery.stringify() utility
/**
* converted stringify() to jQuery plugin.
* serializes a simple object to a JSON formatted string.
* Note: stringify() is different from jQuery.serialize() which URLEncodes form elements
* UPDATES:
* Added a fix to skip over Object.prototype members added by the prototype.js library
* USAGE:
* jQuery.ajax({