Skip to content

Instantly share code, notes, and snippets.

View davelevine's full-sized avatar
Working from home

Dave Levine davelevine

Working from home
View GitHub Profile
### Keybase proof
I hereby claim:
* I am davelevine on github.
* I am davelevine ( on keybase.
* I have a public key whose fingerprint is 27C8 99FF 1141 A64E 7588 EAA9 7280 7837 837F C9E1
To claim this, I am signing this object:
davelevine /
Created June 19, 2021 00:46 — forked from rumansaleem/
Instructions to clean up Arch Linux (Manjaro)


  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
davelevine / openbox_tiling.rc
Created June 27, 2021 13:02 — forked from uriel1998/openbox_tiling.rc
Openbox tiling emulation keybinds
<!-- Keybindings for moving windows -->
<keybind key="mod4-Left">
<action name="GoToDesktop">
<keybind key="mod4-Right">
<action name="GoToDesktop">
davelevine /
Created June 27, 2021 13:03 — forked from Firsh/
Cloudflare as Dynamic DNS
# Cloudflare as Dynamic DNS
# From:
# Based on:
# Original non-RPi article:
# Update these with real values
davelevine /
Created June 27, 2021 13:04 — forked from joepie91/
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
davelevine / nginx.conf
Created June 27, 2021 13:04 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
davelevine /
Last active January 12, 2022 18:29
How to Build a URL Shortener with Cloudflare Workers

How to Build a URL Shortener with Cloudflare Workers


This will serve as a step-by-step guide for creating a URL shortener with Cloudflare Workers. The project is a fork of Atomic URL by Jerry Ng, although I've heavily modified it to suit my needs.

In addition to leveraging Cloudflare Workers, this project will also leverage the following...

davelevine /
Last active January 15, 2023 02:14
Rewrite Subdomain URL for B2 with Cloudflare CDN

Remove B2 /file/<bucket-name> Prefix

While the article from James Ross is solid and works very well with images, I found it fell short with any streaming video with the Bandwidth Alliance (to be fair, the article mentions nothing about videos, only images). Although the URL was being rewritten, it didn't seem to be handling video properly and even short videos were taking a long time to load.

That being said, the following seems to work perfectly...

Note: None of this code is mine. I'm basically standing on the shoulders of giants.

davelevine /
Last active March 1, 2024 08:04
How to Properly Cache Content Hosted on Backblaze B2 with Cloudflare

How to Properly Cache Content Hosted on Backblaze B2


Because I use Cloudflare to manage my domains and Backblaze for backups, it only made sense to take advantage of their Bandwidth Alliance for creating my own CDN. This has been incredibly helpful for image hosting for this knowledge base, however, I recently noticed that caching wasn't working as it should.

The Problem

The overall problem started when I was adding a parking page for a domain I recently purchased. The background image was hosted on B2 and the image was supposed to be cached by Cloudflare. However, each time the page loaded, it would pull the image from the origin instead of the cache. I checked this on my knowledge base and found it was doing the same thing.