Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@marshyski
marshyski / download-go-linux-amd64.sh
Created January 17, 2024 23:16
Download latest golang version for linux amd64
#!/bin/sh
GO_VERSION=$(curl -fsSL 'https://go.dev/VERSION?m=text' | head -n1)
GO_FILE="$GO_VERSION.linux-amd64.tar.gz"
GO_URL="https://go.dev/dl/$GO_FILE"
cd /usr/local || exit 1
curl -fsSLO "$GO_URL"
tar -zxvf "$GO_FILE"
rm -f "$GO_FILE"
@marshyski
marshyski / Windows 10 Gaming Performance.md
Last active March 25, 2024 08:42
Windows 10 Gaming Optimizations

Windows 10 Gaming Performance

Tested On: MSI GS66 Stealth 10SFS-037 Laptop | Intel i7-10750H | Nvidia RTX 2070 Super

Date Updated: 28JUN2020

Est. Time to Completion: 1 hour

Expected improvement from stock Windows 10 install for gaming is 1-3x network improvement and reduction in OS overhead.

@heapwolf
heapwolf / policy.md
Last active April 12, 2019 15:41
Possible start of a strawman for node security policies

A node security policy is similar in concept to a CSP.

~/policy.json

{
  "sha384-...": { // <- this is the hash of a source (which self describes its hashing algorithm)
    fs: [ // <- this is an "entitlement", it's a whitelist (an array of objects)
      {
 path: "/home/alice/**/*", // &lt;- this is a "resource" (a filesystem path)
@edhemphill
edhemphill / fifo.go
Last active April 30, 2020 13:06
Thread / goroutine safe, batching and blocking FIFO queue in golang
import (
"net/http"
"sync"
"fmt"
)
type logBuffer struct {
stuff string
}
from distributed import Worker, Scheduler, Client, Nanny
from distributed.client import _wait
from tornado import gen
from tornado.ioloop import IOLoop
loop = IOLoop.current()
s = Scheduler(loop=loop)
s.start(0)
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@iamralch
iamralch / compress.go
Last active April 16, 2023 03:04
ZIP archives in Golang
import (
"archive/zip"
"io"
"os"
"path/filepath"
"strings"
)
func zipit(source, target string) error {
zipfile, err := os.Create(target)
@iamralch
iamralch / custom_flag.go
Created July 6, 2015 20:40
Custom flag arguments with flag package in Go
package main
import (
"flag"
"fmt"
"net/url"
"strings"
)
type UrlFlag struct {
@velocity303
velocity303 / winpf.pp
Last active August 29, 2015 14:21
Windows code snippets for base OS Settings
#profile class for https://forge.puppetlabs.com/ptierno/windowspagefile
class profile::winpf {
case $os[release][major] {
"2008 R2": { if $::issql == 'true' {
$initialpf = 24576
$maximumpf = 24576
}
elsif $memorysize_mb < 16384 {
$initialpf = 1024
$maximumpf = 1024
require 'facter'
require 'aws-sdk'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
ec2 = Aws::EC2::Client.new(region:region)
instance = ec2.describe_instances(instance_ids:[instance_id])
tags = instance.reservations[0].instances[0].tags
tags.each do |tag|