Skip to content

Instantly share code, notes, and snippets.

View dbirks's full-sized avatar
🦔

David Birks dbirks

🦔
View GitHub Profile
@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 / 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 / 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}
@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 / 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 / centos-rclone-backblaze.md
Last active December 21, 2017 19:39
centos-rclone-backblaze

Syncing with Backblaze B2 with rclone on CentOS

Here's how to sync your files onto Backblaze once you have a Backblaze account. More on that here. Also if you're uploading more than 10 GB, you'll want to increase your cap size on the web portal.

  • You'll want to do this all as root: sudo su -
  • Install rclone
    • Add the extra EPEL repos: yum install epel-release
    • Install some prerequisites: yum install golang git
    • Add Go's folder to your path: export GOPATH="$HOME/gopath/"
    • Install rclone in the Go folder: go get github.com/ncw/rclone
  • Copy the program to your binary folder: cp $GOPATH/bin/rclone /usr/bin/
@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 / exchange-calendar-notes.md
Last active November 17, 2017 14:39
Exchange calendar notes

Share Exchange calendar

Allow Mike Roe to see Samantha's calendar:

Add-MailboxFolderPermission -Identity samantha@internet.com:\Calendar -User "Mike Roe" -AccessRights Reviewer

Common roles with their associated permissions that you can assign with AccessRights are:

@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