Skip to content

Instantly share code, notes, and snippets.

@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.

@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 / jenkins-api-examples
Last active September 22, 2023 09:18
Jenkins trigger, create and remove jobs and folders
# check if job exists
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken
# with folder plugin
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# without folder plugin
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# create folder
@marshyski
marshyski / update_cf_record.sh
Created March 20, 2022 19:29
Update Cloudflare DNS Record with Dynamic IP
#!/bin/sh
CF_TOKEN=""
ZONE_ID=""
SITE_ID=""
DNS_RECORD="foobar.com"
PUB_IP=$(dig @1.1.1.1 ch txt whoami.cloudflare +short | cut -d\" -f 2)
curl -XPUT "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$SITE_ID" \
-H "Authorization: Bearer $CF_TOKEN" -H "Content-Type: application/json" \

First make sure Windows Update is caught up with all the system updates.

Follow the following steps below in order.

Snappy Driver Installer

  1. Download SDI Lite version https://sdi-tool.org/download/
  2. Extract Zip to Downloads or Documents
  3. Right-click SDI_x64_*.exe and Run as Administrator
  4. Download Indexes Only
@marshyski
marshyski / iptables
Last active December 17, 2020 10:43
DigitalOcean IPTables
*nat
:PREROUTING ACCEPT [235:14024]
:INPUT ACCEPT [235:14024]
:OUTPUT ACCEPT [418:29744]
:POSTROUTING ACCEPT [418:29744]
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [229:47805]
@marshyski
marshyski / terraform-example.tf
Last active October 7, 2020 13:13
Example of terraform with multiple security groups
variable "aws_region" {
default = "us-east-1"
}
variable "rhelami" {
default = {
us-east-1 = "ami-436a702a"
}
}
@marshyski
marshyski / puppetdb-curl.sh
Last active August 11, 2020 09:19
Puppet DB Curl Examples
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["node", "active"], true]'
curl -sf 'http://localhost:8080/v3/facts'
curl -sf 'http://localhost:8080/v3/nodes'
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fact", "kernel"], "Linux"]'
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fa, "operatingsystem"], "windows"]'
@marshyski
marshyski / yum-nginx-api-v1-proposal.md
Last active June 21, 2020 22:27
yum-nginx-api 2020 v1 proposal

Move API routes:

Old New
/api/health /v1/health
/api/upload /v1/rpm/upload /v1/deb/upload
/api/repo /v1/rpm/repo /v1/deb/repo

/rep will default to a single repo/xml directory. The goal would be manage multiple repos by utlizing a name query parameter as such:

@marshyski
marshyski / luajit-luarocks-osx.sh
Last active March 20, 2019 21:31
LuaJIT and luarocks on Mac OS X El Capitan
# This is to install both on OS X if you don't want to use homebrew
# xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcode-select --install
curl -O http://luajit.org/download/LuaJIT-2.0.4.zip
unzip LuaJIT-2.0.4.zip
cd LuaJIT-2.0.4
make && make install
curl -O http://keplerproject.github.io/luarocks/releases/luarocks-2.3.0.tar.gz