Skip to content

Instantly share code, notes, and snippets.

View dbirks's full-sized avatar
🐏

David Birks dbirks

🐏
View GitHub Profile
@dbirks
dbirks / adminer-apache-ubuntu-16.04.md
Last active April 15, 2024 08:51
Install Adminer with Apache on Ubuntu 16.04

Adminer is in the repos, so install it with:

apt install adminer

Copy the configuration to your available configs folder and enable it.

cp /etc/adminer/apache.conf /etc/apache2/conf-available/adminer.conf
@dbirks
dbirks / change-last-logged-on-user-windows-10.md
Last active February 26, 2024 13:00
Change last logged on user on Windows 10

In Windows 10 you can no longer change the last logged on user in the registry like you could in Windows 7. Windows 10 requires the user's SID to be entered as well. Here's an updated guide.

In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI, you'll want to change 4 entries:

  • LastLoggedOnDisplayName
    • Enter the user's full name, like Allan Jude
  • LastLoggedOnSAMUser
    • Enter the username, like SHORTDOMAIN\allan.jude
  • LastLoggedOnUser
  • Enter the username again, like SHORTDOMAIN\allan.jude
@dbirks
dbirks / certbot-systemd-ubuntu.md
Last active November 2, 2023 08:49
Certbot renew with a systemd timer on Ubuntu

Ubuntu 16.04

/etc/systemd/system/certbot.service

[Unit]
Description=Let's Encrypt renewal

[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --quiet --agree-tos
@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 / 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 / speedtest-cli-edgerouter.md
Last active February 10, 2023 08:22
Make a Speedtest log on a Ubiquity Edgerouter

Tested on an Edgerouter Lite, EdgeOS 1.9.0

Enable the Wheezy repo

configure
set system package repository wheezy components 'main contrib non-free'
set system package repository wheezy distribution wheezy 
set system package repository wheezy url http://http.us.debian.org/debian
commit
save
@dbirks
dbirks / mailbox-recursive-access.md
Last active January 4, 2023 12:31
Give a user access recursively to another mailbox's folders

Give a user access recursively to another mailbox's folders

I was running into a problem giving a user access to another user's mailbox, where the user was only getting permission to view the top level folders, while the subfolders had no viewing permissions set on them.

Here's the way to set permissions on each folder recursively if all else fails.

In this example, we are giving Mike editor privileges on Kukuri's mailbox folders.

ForEach($f in (Get-MailboxFolderStatistics kukuri@company.com | Where { $_.FolderPath.Contains("/") -eq $True } ) ) {
@dbirks
dbirks / set-mouse-cursor-size.md
Created June 21, 2017 15:31
Set mouse cursor size in Linux

I've found a couple places that need the change.

In ~/.Xresources, add something like Xcursor.size: 16. This fixed many issues for me, but chromium still had a large cursor when I hovered over it. A quick change to gsettings fixed it: gsettings set org.gnome.desktop.interface cursor-size 16.

@dbirks
dbirks / centos-zfs-urbackup.md
Last active July 13, 2022 09:12
Install Urbackup on CentOS 7 using ZFS

Installing Urbackup on CentOS using ZFS

Here's the details on installing Urbackup on the ZFS file system on the stable CentOS 7.

  • Install CentOS 7. I'll be using the Minimal install.
    • Once you have the .iso, write it to a CD or USB drive. I recommend using Rufus if you're on Windows to write it to USB.
    • Go ahead and boot to it.
    • Most of the defaults on the Installation Summary page should be good. However you will want to:
      • Confirm the time zone is correct.
      • Click the disk you want to install to.