Skip to content

Instantly share code, notes, and snippets.

@hibearpanda
hibearpanda / staging-build.yml
Created January 12, 2021 01:32
Github Actions for building Electron Wix Installer
name: Build for Staging
on:
push:
branches:
- buildCi
jobs:
build-and-distribute:
runs-on: windows-latest
@hibearpanda
hibearpanda / gitflowrebasing.md
Created September 2, 2019 14:05 — forked from markreid/gitflowrebasing.md
git flow with rebasing

Best Practices for Azure Redis

Below are a set of best practices that I recommend for most customers. This information is based on my experience helping hundreds of Azure Redis customers investigate various issues.

Configuration and Concepts

  1. Use Standard or Premium Tier for Production systems. The Basic Tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are really meant for simple dev/test scenarios since they have a shared CPU core, very little memory, are prone to "noisy neighbor", etc.
  2. Remember that Redis is an In-Memory data store. Read this article so that you are aware of scenarios where data loss can occur.
  3. Configure your client library to use a "connect timeout" of at least 10 to 15 seconds, giving the system time to connect even under higher CPU conditions. If your client or server tend to be under high load
@hibearpanda
hibearpanda / nsqd.service
Created December 15, 2017 08:33 — forked from a-r-g-v/nsqd.service
nsqd, nsqdlookupd systemd service files
[Unit]
Description=NSQD
After=network.target
[Service]
WorkingDirectory=/usr/local/nsq
ExecStart=/usr/local/nsq/bin/nsqd -http-address 127.0.0.1:4151 -tcp-address 127.0.0.1:4150 -lookupd-tcp-address 127.0.0.1:4160
ExecReload=/bin/kill -HUP $MAINPID
Type=simple
KillMode=process
@hibearpanda
hibearpanda / letsencrypt_2017.md
Created July 11, 2017 10:41 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

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

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

package main
import (
"io"
"log"
"os"
"os/exec"
"io/ioutil"
"bytes"
)