Skip to content

Instantly share code, notes, and snippets.

View dbirks's full-sized avatar
🐏

David Birks dbirks

🐏
View GitHub Profile
@dbirks
dbirks / notebook.ipynb
Created October 14, 2023 19:59
Convert RDS backup into sql file
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dbirks
dbirks / clean-build.sh
Created September 30, 2020 03:08
Clean build an Arch Linux package inside a container
#!/bin/sh
set -o errexit
trap "docker rm --force lens-build" EXIT
docker pull archlinux
docker run \
--detach \
@dbirks
dbirks / migrate-git-repos.md
Last active September 11, 2023 06:05
Script to fully migrate git repos, including all tags and branches

Migrate git repos script

I used this for migrating git repos from Bitbucket to Github. It uses git's --mirror flag for cloning and pushing to also transfer all tags and branches.

It would be helpful to have SSH keys set up on both ends. Then all you should have to do is to make sure the hardcoded orgname is set to the appropriate one for both the source and destination.

Once I migrated repos, I used this to replace my origin url locally (assumes using ssh):

sed -i s/bitbucket.org:orgname/github.com:orgname/g .git/config
@dbirks
dbirks / google-analytics-for-static-sites.sh
Created February 8, 2018 23:30 — forked from stevenscg/google-analytics-for-static-sites.sh
Add Google Analytics tracking to an existing static website
#!/bin/sh
#
# Add a Google Analytics tag to static website files
# @see http://adambuchanan.me/post/26345221717/updating-google-analytics-code-on-many-static-pages
# Tested on MacOS 10.8.X
#
# Usage:
# Set the GA parameters below
# Execute the script from the top-level of the static site
#
@dbirks
dbirks / shared-inbox-notes.md
Last active May 11, 2018 19:46
Exchange shared inbox notes

Exchange shared inbox notes

Copy sent emails to the shared inbox's sent folder

For emails sent as from the shared inbox, make a copy of the email in the shared inbox's sent items folder as well.

set-mailbox <mailbox name> -MessageCopyForSentAsEnabled $True
@dbirks
dbirks / helpful-powershell-commands.md
Last active June 21, 2018 15:09
Helpful Powershell commands

Helpful Powershell commands

Add a computer to the domain

Add-Computer -DomainName corp.contoso.com 

I've found the FQDN is required in my environment.

@dbirks
dbirks / chan-setup-notes
Last active December 8, 2017 09:48
chan setup notes
https://github.com/arisu-dev/arisuchan
debian 9
apt install git apache2 mysql-server php php-mbstring php-gd php-pdo imagemagick php-mysql php-mcrypt
systemctl enable --now apache2
mysql_secure_installation
@dbirks
dbirks / change-room-booking.md
Created November 2, 2017 13:37
Change how far in advance you can book a room in Exchange

For Office 365, the default time into the future you can book a room looks to be 180 days. Find out the current time with:

Get-CalendarProcessing -Identity "Conference Room" | select BookingWindowInDays

You can then set the window to the maximum of 1080 days with:

Set-CalendarProcessing -Identity "Conference Room" -BookingWindowInDays 1080
@dbirks
dbirks / arch-install-notes.md
Last active July 27, 2018 15:21
Arch install notes

Rank repo mirrors

rankmirrors is included in the pacman-contrib package.

Make a backup, then run the rankmirrors script through sed to remove some extra commented-out lines.

mv /etc/pacman.d/mirrorlist{,.old}