Skip to content

Instantly share code, notes, and snippets.

@donovansolms
donovansolms / autostart_windows.go
Created March 3, 2019 20:20
Hack ProtonMail/go-autostart for Windows start menu item
package autostart
// #cgo LDFLAGS: -lole32 -luuid
/*
#define WIN32_LEAN_AND_MEAN
#include <stdint.h>
#include <windows.h>
uint64_t CreateShortcut(char *shortcutA, char *path, char *args);
*/
@donovansolms
donovansolms / hwinfo.go
Last active October 14, 2018 17:18
A sample of getting information (CPUs, Memory, GPUs, OS) from the current system in Go.
package main
import (
"fmt"
"math"
"strings"
"github.com/jaypipes/ghw"
"github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/host"

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers