Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Dowwie's full-sized avatar

Darin Gordon Dowwie

View GitHub Profile
@Dowwie
Dowwie / remove_usb_guard.md
Created March 19, 2024 19:54 — forked from pjobson/remove_usb_guard.md
Remove USB Guard From Ubuntu

Remove USB Guard From Ubuntu

If you're a sucker like me and installed usbguard on a Ubuntu variant you may find that you will have access to none of your usb devices at all, because F you. The installer automatically sets up the daemon which has no rules so will just block all of your devices. Doing a basic apt remove usbguard may fail at 25%, because also F you.

My kernel is version 4.15.0-47-generic, not sure if this stopped working at some point or what.

Regain Access

sudo echo "allow id *:*" > /etc/usbguard/rules.conf

sudo sed -i 's/PresentDevicePolicy=apply-policy/PresentDevicePolicy=allow/' /etc/usbguard/usbguard-daemon.conf

@Dowwie
Dowwie / ssl_verify_fun_error.md
Created September 4, 2023 09:19
could not compile dependency :ssl_verify_fun, "mix compile" failed

When you get the following error when trying to compile your Elixir project, it is due to library maintainers not properly pinning version per dependency and being affected by a breaking change that has affected many projects downstream.

could not compile dependency :ssl_verify_fun, "mix compile" failed

To fix, simply run from command line:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name="viewport" />
<link rel="icon" href="data:,">
<title>String art</title>
<script type="text/javascript" src="jquery.min.js"></script>
<style>
html, body {
import collections
import math
import os
import cv2
import numpy as np
import time
MAX_LINES = 4000
N_PINS = 36*8
MIN_LOOP = 20 # To avoid getting stuck in a loop
@Dowwie
Dowwie / public-ip-address.md
Created April 17, 2023 14:10
Ways to get info public IP address

Find out ip address using CLI

wget -qO- icanhazip.com
wget -qO- ipecho.net/plain; echo
curl checkip.amazonaws.com     # ipv4
curl ifconfig.co               # ipv6
@Dowwie
Dowwie / tsrange.ex
Created February 8, 2023 13:16
Elixir Ecto tsrange type
defmodule My.Postgres.TsRange do
@moduledoc """
Wraps a `Postgrex.Range` and casts to a PostgreSQL `tsrange` type.
Works w/ecto 3.8.0, postgrex 0.16
"""
use Ecto.Type
alias Postgrex.Range
defstruct lower: nil,
@Dowwie
Dowwie / instructions.md
Created April 8, 2019 18:10 — forked from harding/instructions.md
Working With Multiple Repositories On GitHub

Working With Multiple Repositories On GitHub

Most projects on GitHub have a main repository that's the focal point of activity. For example, the Example organization has the Example.com repository:

https://github.com/example/example.com

Developers of Example.com typically call this the 'upstream' repository. We'll come back to it in a moment.

@Dowwie
Dowwie / keybase.md
Last active October 26, 2018 12:21

Keybase proof

I hereby claim:

  • I am dowwie on github.
  • I am dowwie (https://keybase.io/dowwie) on keybase.
  • I have a public key ASCP2ZdSKPFGdm0BB6qVpYSEy4MYa8s29VooXlJn-9gnSgo

To claim this, I am signing this object:

@Dowwie
Dowwie / letsencrypt_2018.md
Created June 21, 2018 14:46 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

[dependencies]
serde = "1.0.27"
serde_derive = "1.0.27"
serde_json = "1.0.9"
serde_yaml = "0.7.3"
diesel = { version = "1.1.1", features = ["postgres"] }
r2d2 = "0.8.2"
r2d2-diesel = "1.0.0"