Skip to content

Instantly share code, notes, and snippets.

@cpburnz
cpburnz / README.md
Last active December 30, 2023 17:17
Upgrade OpenVPN Access Server from 2.5.2 to 2.8.8 on Ubuntu 16.04 Xenial

OpenVPN Access Server 2.5.2 on Ubuntu 16.04 can no longer connect to the OpenVPN licence server (as of some time in 2023). This can be temporarily fixed by upgrading to 2.8.8 which still works (as of 2023-12-30 at least). According to OpenVPN's Keeping Access Server Updated, the openvpn-as package is not installed through the repositories until 2.7.5. If you happen to be on an earlier version, say 2.5.2, you need to setup the repository. The instructions for Ubuntu 16.04 are out-of-date if you can find them.

OpenVPN Repo for Ubuntu 16.04 Xenial

NOTE: All commands are assumed to be run as root. If not running as root, use the sudo command where appropriate.

Download the OpenVPN repo signing key (The curl command can be used, but only wget was available on my machine):

@cpburnz
cpburnz / Ubuntu_Server_22_04_Static_IP.markdown
Created July 6, 2022 16:12
Ubuntu Server 22.04 Static IP

Static IP Address

In order to set a static IP address on Ubuntu Server 22.04, you need to configure it through netplan.

You can view the current network information using networkctl by running the following command:

@cpburnz
cpburnz / dropbox_ignore.sh
Last active May 30, 2022 14:46
This script sets or removes the Dropbox ignored flag (the "com.dropbox.ignored" attribute) on a path.
#!/bin/sh
#
# This script sets or removes the Dropbox ignored flag (the
# "com.dropbox.ignored" attribute) on a path.
#
# Author: Caleb P. Burns
# License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# Version: 1.0.0
# Created: 2020-07-18
# Updated: 2020-07-18
@cpburnz
cpburnz / letsencrypt_tls_manual.md
Last active July 18, 2022 22:26
Manually Request Let's Encrypt TLS Certificate with certbot

Manually Request Let's Encrypt TLS Certificate with certbot

A TLS certificate can be manually requested from [Let's Encrypt][1] using [certbot][2]. In order to successfully acquire the certificate you will need to have a domain name properly set up through DNS, and you need to be able to make a file available from an arbitrary URL under your domain.

TL;DR

@cpburnz
cpburnz / venv.sh
Created May 23, 2020 16:45
This script activates the given Python virtual environment, and then # executes the given command.
#!/bin/sh
#
# This script activates the given Python virtual environment, and then
# executes the given command.
#
# Author: Caleb P. Burns
# License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# Version: 1.0.0
#
@cpburnz
cpburnz / Ubuntu_18.04_Networking.markdown
Last active January 29, 2019 17:38
Ubuntu 18.04 Networking

Fix systemd's broken DNS resolution

Systemd by default breaks DNS name resolution by overriding /etc/resolv.conf to use its useless stub DNS server, and not the network managed one.

Symlink /run/systemd/resolve/resolv.conf to /etc/resolv.conf:

sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Sources:

@cpburnz
cpburnz / ssh-check-username.py
Created December 17, 2018 15:43
OpenSSH user enumeration (CVE-2018-15473)
#!/usr/bin/env python
# Copyright (c) 2018 Matthew Daley
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@cpburnz
cpburnz / XSLT_Update_Attribute_in_Elements.rst
Last active May 19, 2016 13:31
Update Attribute in Elements using XSLT

XSLT Update Attribute in Elements

Transform XML document:

xsltproc -o output.xml update-attribute.xslt input.xml
@cpburnz
cpburnz / XSLT_Remove_Attribute_from_Elements.rst
Last active May 19, 2016 13:30
Remove Attribute from Elements using XSLT

XSLT Remove Attribute from Elements

Transform XML document:

xsltproc -o output.xml remove-attribute.xslt input.xml
@cpburnz
cpburnz / NVIDIA_GeForce_GTX_960M_with_Optimus_on_Arch_Linux.rst
Last active August 31, 2023 13:23
NVIDIA GeForce GTX 960M with Optimus on Arch Linux

Packages

  • bumblebee 3.2.1-10 (provides nvidia-libgl)
  • mesa 11.0.4-1
  • mesa-libgl 11.0.4-1
  • nvidia 355.11-4 (Nvidia driver)
  • primus 20150118-2 (Bumblebee bridge)
  • xf86-video-intel 1:2.99.917+478+gdf72bc5-2 (Intel driver)