Skip to content

Instantly share code, notes, and snippets.

View lg's full-sized avatar

Larry Gadea lg

View GitHub Profile
@lg
lg / currentline.psm1
Created June 9, 2019 04:14
current line in script
$tocontinue = $MyInvocation.MyCommand.ScriptBlock.ToString().split([Environment]::NewLine)[(Get-PSCallStack).Position.StartLineNumber,-1] -join [Environment]::NewLine | Out-String
@lg
lg / cloudygamer.psm1
Last active June 9, 2019 23:18
CloudyGamer initialization script (run manually up to each ###### line)
# CloudyGamer
#
# CURRENTLY WRITTEN FOR PAPERSPACE (see link above for additional azure/aws items)
# based off of: https://github.com/lg/cloudy-gamer/blob/master/cloudygamer.psm1
#
# troubleshooting:
# 1. latency spikes:
# - if hooked up to an external monitor, disconnect
# - if on wifi, try wired
# - if wired and on a fancy switch, turn on/off congestion control on the port
@lg
lg / paperspace-gaming.ps1
Last active October 31, 2023 17:24
A script to provision a new Paperspace machine for gaming
# init stuff
Install-PackageProvider -Name NuGet -Force
mkdir c:\cloudygamer\downloads
Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DontUsePowerShellOnWinX" -Value 0
################
# install steam first since windows updates will take forever (and you can install games)
(New-Object System.Net.WebClient).DownloadFile("https://steamcdn-a.akamaihd.net/client/installer/SteamSetup.exe", "c:\cloudygamer\downloads\steamsetup.exe")
@lg
lg / test.css
Last active August 19, 2017 07:55
Animating elements in an SVG via CSS (see live example here: https://lg.io/assets/extern/css-svg/test.html)
@keyframes hover {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(3px); }
}
#cow {
animation: hover 1.0s infinite ease;
}
#bang {
@lg
lg / cloudy-gamer-launcher.sh
Last active April 28, 2021 14:25
Easily start/stop Paperspace and Parsec instances
#!/bin/bash
#
# CloudyGamerLauncher by Larry Gadea
# Easily start/stop Paperspace and Parsec instances
#
# Make sure to fill out the variables below. For the machine id, use the
# 8-letter identifier for the machine on Paperspace (ex. PS8RGDUY)
#
# Note: Requires Paperspace API key (generate one in account settings)
@lg
lg / just-in-time-babel.js
Last active January 28, 2017 22:51
Use ES2017 async functions on browsers that don't support it (like Safari)
// JustInTimeBabel by Larry Gadea
// Use ES2017 async functions on browsers that don't support it (like Safari)
//
// Example usage:
//
// <script src='just-in-time-babel.js'></script>
// <script>
// async function pong() {
// await new Promise(resolve => setTimeout(resolve, 1000))
// console.log("pong!")
@lg
lg / update-cloudflare-v4-ip.sh
Created December 4, 2016 23:18
Update router IP address on CloudFlare using their v4 API
#!/bin/sh
#
# cloudflare v4 ip updater for edgerouter
#
# this uses the v4 api which ddclient doesn't support directly. though v1 api of cloudflare is still active, we've disabled it (for SAML support), so v4 is mandatory.
# updating the ip of a hostname is a 3 step process:
#
# 1. get the list of zones:
# curl -X GET "https://api.cloudflare.com/client/v4/zones" -H 'X-Auth-Email: ***CLOUDFLARE-EMAIL***' -H 'X-Auth-Key: ***CLOUDFLARE-TOKEN***' -H 'Content-Type: application/json'
# 2. get the DNS records in a zone (by the id returned above)
@lg
lg / angry_wifi.sh
Last active November 28, 2023 23:56
auto disconnects clients with a low signal strength on LEDE / OpenWRT
#!/bin/ash
#
# angry_wifi.sh
#
# auto disconnects clients with a low signal strength on LEDE / OpenWRT. great
# for clients who hold onto a lower-signal-strength accesspoint instead of
# roaming. before running, make sure to download the latest MAC addresses with:
#
# wget --no-check-certificate -O - 'https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MAC&text=apple' | cut -d, -f2 > apple_mac_addresses
#
@lg
lg / uap-ac-lite-openwrt.txt
Last active October 22, 2023 12:16
making the ubnt wifi awesome (uap ac lite) w/ openwrt
making the ubnt wifi awesome (uap ac lite) w/ lede (openwrt)
the reasons you would do this:
- you get 802.11r
- you get better roaming
- you get access to some new 5ghz channels
I AM NOT TO BE HELD RESPONSIBLE FOR ANYTHING IN HERE. DO AT YOUR OWN RISK. THANK YOU AND HAVE A LOVELY DAY.
** note that though we're using Lede, it's essentially openwrt minus the drama
@lg
lg / build_tvvlckit.sh
Last active April 5, 2020 15:48
Building MobileVLCKit for AppleTV: TVVLCKit
# note these instructions are as of Dec 28, 2015
# the vlc and vlckit repos are super complex and have thousands of dependencies from everywhere on the internet.
# so, you'll need to mess with things a bit
git clone http://code.videolan.org/videolan/VLCKit.git
cd VLCKit
./buildMobileVLCKit.sh -t