Skip to content

Instantly share code, notes, and snippets.

markcaudill markcaudill

Block or report user

Report or block markcaudill

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@markcaudill
markcaudill / app-track.sh
Created Jun 22, 2019
Linux App Usage Tracker
View app-track.sh
#!/bin/sh
DATABASE=${HOME}/.app-track.db
touch "${DATABASE}" && chmod 0600 "${DATABASE}"
active_window_id() {
xprop -root _NET_ACTIVE_WINDOW | rev | cut -d' ' -f1 | rev
}
window_pid_by_id() {
View keybase.md

Keybase proof

I hereby claim:

  • I am markcaudill on github.
  • I am mcaudill (https://keybase.io/mcaudill) on keybase.
  • I have a public key ASAx-_PBs4UHFolqsyS7tfK4aJ8Y1jbizy7bs82Ej60MJwo

To claim this, I am signing this object:

@markcaudill
markcaudill / README.md
Created Nov 8, 2017
letsencrypt certbot cloudflare zone pause and unpause
View README.md

Description

This makes it easy to automate pausing your Cloudflare zone(s), renewing your letsencrypt certs, and then unpausing your zone(s).

Installation

  • Ensure python-cloudflare is installed either in system or virtualenv.
  • Make sure you chmod 0700 certbot-renew.sh before you add your credentials.
  • Replace your existing certbot renew cron job with something like @daily /path/to/certbot-renew.sh.
  • It's helpful to have MAILTO="youremail" in the top of your crontab to easily see the output whenever it runs.

Author

View keybase.md

Keybase proof

I hereby claim:

  • I am markcaudill on github.
  • I am mcaudill (https://keybase.io/mcaudill) on keybase.
  • I have a public key whose fingerprint is 22DD 2ACE 6746 60A1 33A0 A523 2ED3 96FC E25E 7F77

To claim this, I am signing this object:

View gist:c161b4d30f7f7ffdabbe
# Install RPM Fusion
sudo dnf install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm
sudo dnf install http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-22.noarch.rpm
# The rest
sudo dnf install kernel-devel broadcom-wl akmod-wl akmods
sudo akmods
sudo reboot
View btsync
#!/bin/bash
#
# btsync Start up the btsync server daemon
#
# chkconfig: 2345 55 25
# description: btsync is like this sync thing. Google it.
#
# processname: btsync
# config: /etc/btsync.conf
# pidfile: /var/run/btync/btsync.pid
View schedulers.sh
#!/bin/bash
# Analyze your schedulers. Don't use this. 2nasty4u
# Usage: $0 [sda sdb ...] | tee -a schedulers.csv
devs=$*
for dev in $devs; do
# Save the current scheduler
active_scheduler=`cat /sys/block/$dev/queue/scheduler | grep -Eo '\[[a-z]+\]' | sed 's/\[//g' | sed 's/\]//g'`
for scheduler in `cat /sys/block/$dev/queue/scheduler | sed 's/\[//g' | sed 's/\]//g'`; do
View ip.sh
#!/bin/bash
LAST=/tmp/last_public_ip
NOTIFY="you@domain.tld"
ip=$(curl -s https://mrkc.me/ip)
if [[ ! -e $LAST ]] || [[ "$ip" != "$(cat $LAST)" ]]; then
cat $LAST
echo -n "$ip" > $LAST
View keybase.md

Keybase proof

I hereby claim:

  • I am markcaudill on github.
  • I am mcaudill (https://keybase.io/mcaudill) on keybase.
  • I have a public key whose fingerprint is 105C 4606 25A9 0BA4 7367 38DA B1CC CB0A 8630 0137

To claim this, I am signing this object:

View timestamp.py
# -*- coding: utf-8 -*-
from datetime import datetime
import sublime_plugin
class TimestampCommand(sublime_plugin.EventListener):
"""Expand `isoD`, `now`, `datetime`, `utcnow`, `utcdatetime`,
`date` and `time`
"""
You can’t perform that action at this time.