Skip to content

Instantly share code, notes, and snippets.

View andyshinn's full-sized avatar
🖥️
don't put computers in your mouth

Andy Shinn andyshinn

🖥️
don't put computers in your mouth
View GitHub Profile
#pragma once
#include "wled.h"
//
// Inspired by the v1 usermods
// * rotary_encoder_change_brightness
// * rotary_encoder_change_effect
//
// v2 usermod that provides a rotary encoder-based UI.
@andyshinn
andyshinn / README.md
Created June 9, 2016 15:38
pbcopy over SSH

Install

  • Add pbcopy.plist to your ~/Library/LaunchAgents/ folder.
  • Launch the listener with launchctl load ~/Library/LaunchAgents/pbcopy.plist.
  • Add RemoteForward 2224 127.0.0.1:2224 in your ~/.ssh/config file under your Host * or specific hosts sections.
  • Add [ -n "$SSH_CLIENT" ] && alias pbcopy="nc localhost 2224" to your remote ~/.bash_profile or other shell profile.
  • Enjoy pbcopy remotely!
@andyshinn
andyshinn / gist:3511fbd091dc87ad78771e380fb527d4
Created September 9, 2016 20:54
Mimicking CORS preflight responses in Apache
<VirtualHost _default_:443>
ServerName yourhost
ServerAdmin someperson@yourorg.com
SSLEngine on
SSLCertificateFile /etc/ssl/private/yourorg.com.crt
SSLCertificateKeyFile /etc/ssl/private/yourorg.com.key
SSLCertificateChainFile /etc/ssl/private/chain.pem
SSLProxyEngine On
@andyshinn
andyshinn / DEISGCE.md
Last active June 7, 2020 19:17
Deis in Google Compute Engine

Deis in Google Compute Engine

Let's build a Deis cluster in Google's Compute Engine!

Google

Get a few Google things squared away so we can provison VM instances.

Google Cloud SDK

resource "google_compute_network" "nat" {
project = var.gcp_project_id
name = "nat"
}
resource "google_compute_router" "nat" {
project = var.gcp_project_id
name = "nat"
network = google_compute_network.nat.self_link
}
@andyshinn
andyshinn / maybe_2020_is_year_of_the_linux_desktop?
Created March 4, 2020 21:17
Trying out Ubuntu Budgie as a desktop OS: First week notes
I built a HEDT Windows PC late 2019 and wanted to start using it as a development environment in addition to games. It's got a Threadripper 2950X, Nvidia 2080 Ti, 64 GB memory, and 2 x Samsung 970 Pro NVMe SSDs (one dedicated to Windows 10, one to Ubuntu). These are my notes after week one of installation and usage as a work environment (Python development, DevOps, remote administration, and hopefully some video / media transcoding and manipulation). I come from a Macbook Pro as my primary work / development machine.
• No LVM in normal ISO? Had to use alternative "netinstall" ISO...OK.
• Can't click dismiss on initial WiFi notification... dismiss button broken?
• Change time from 24 hour to AM/PM. Status bar shows AM/PM but desktop still shows 24 hour...
• Xorg Nvidia driver by default, terrible resolution. Use nvidia proprietary. Reboot.
• Looks good but refresh rate 60hz? Manually change to 144.
• Refresh rate changes back to 60 on logout and back to 144 on login... How to make system wide?
• SSH keys not
@andyshinn
andyshinn / BYEQUICKSWITCHER.md
Last active July 16, 2019 15:37
Get rid of Slack Quick switch / Jump to widget

These instructions will help you get rid of the Slack quick-switcher on macOS. Slack 4.0.0 introduces a different packing mechanism which adds some steps. But both sets of steps will use the following JavaScript snippet:

document.addEventListener("DOMContentLoaded", function() {
  let customCustomCSS = `
  div.p-channel_sidebar__navigation_bar {
    display: none;
  }
  `
  
version: "3"
services:
test:
env_file: ./myenv
image: alpine
command: env
// This #include statement was automatically added by the Particle IDE.
#include <blynk.h>
// This #include statement was automatically added by the Particle IDE.
#include <RelayShield.h>
RelayShield myRelays;
LEDStatus blinkRed(RGB_COLOR_RED, LED_PATTERN_BLINK);
char auth[] = "e2f9e87c65c04d9f8ae6c05c46af0271";
from datadog_checks.utils.subprocess_output import get_subprocess_output
from datadog_checks.checks import AgentCheck
class AptCheck(AgentCheck):
def check(self, instance):
metric_prefix = 'package.updates'
package_updates = self.get_update_count()
self.gauge('%s.security' % metric_prefix, package_updates['security'])
self.gauge('%s.regular' % metric_prefix, package_updates['regular'])