Skip to content

Instantly share code, notes, and snippets.

//
// 1. Go to https://www.strava.com/athlete/training
//
// 2. Open the Chrome developer console
//
// 3. Paste into the console the code from
// https://github.com/eligrey/FileSaver.js/blob/master/src/FileSaver.js
//
// 4. Paste the two functions below into the console
//
@xirixiz
xirixiz / pihole-macvlan-synology-docker.txt
Last active December 2, 2024 19:32
Add a PiHole instance on a macvlan enabled Docker network (Synology eth0 example)
#!/bin/bash
# NAS IP: 192.168.1.10 in this example
# DHCP scope reservation for macvlan: 192.168.1.210/28 (Details below)
## Network: 192.168.1.210/28
## HostMin: 192.168.1.211
## HostMax: 192.168.1.224
## Hosts/Net: 14
# Create a Synology macvlan0 bridge network attached to the physical eth0, and add the ip range scope (sudo)
@zsoumya
zsoumya / bc4trialreset.cmd
Created July 12, 2019 21:25
Beyond Compare 4 Trial Reset
reg delete "HKCU\Software\Scooter Software\Beyond Compare 4" /v CacheID /f
@zoilomora
zoilomora / README.md
Last active April 20, 2025 20:46
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@tblong
tblong / rpi-network-watchdog.sh
Created May 29, 2019 23:09
Checks a pingable source and reboots the host when the failure limit is reached.
#!/bin/bash
#
# Original Source Attribution:
# Location: https://gist.github.com/SandroMachado/87e591fc42f368636b251b566485ae46
# Author: Sandro Machado
# Date of retrieval: 2019-05-28
#
# Script Summary:
# This script checks a pingable source and when the failure
# limit is reached the host is restarted. No files are written
#!/usr/bin/env python3
'''
calisuck: index, filter-out smartly and download ebooks from Calibre open directories
Installation:
You need python 3.5 installed
Download the file as a zip and unzip-it and get into the dir
@tonyklawrence
tonyklawrence / gist:b477dcf624577ab154ed3b51cea60e27
Last active July 10, 2024 03:43
Docker containers using VLAN network on Synology DSM 6.X
First we need to create the VLAN on the Synology from the command line:
See: https://nielshagoort.com/2016/03/30/synology-vlan-tagging/
Then add Network to Docker using maclvan driver
See: https://docs.docker.com/engine/userguide/networking/get-started-macvlan/#macvlan-8021q-trunk-bridge-mode-example-usage
Details...
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@gtback
gtback / contagio_unzip.py
Last active March 23, 2021 04:25
Contagio Unzip
#!/usr/bin/env python
"""
Extract malware from Contagio Zip files, determining the password
automatically.
Note that the password for each zip file consists of a common base password
along with the last character of the file name (prior to the .zip extension).
If you don't know the base password, please contact Mila directly.
@vdavez
vdavez / docx2md.md
Last active June 17, 2024 19:40
Convert a Word Document into MD

Converting a Word Document to Markdown in Two Moves

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

The Solution

As it turns out, there are several open-source tools that allow for conversion between file types. Pandoc is one of them, and it's powerful. In fact, pandoc's website says "If you need to convert files from one markup format into another, pandoc is your swiss-army knife." But, although pandoc can convert from markdown into .docx, it doesn't work in the other direction.