Skip to content

Instantly share code, notes, and snippets.

@greatwolf
greatwolf / oci-publicip.txt
Last active March 17, 2024 15:40
Learning OCI commands to unassign/reassign fresh publicip
// get compartment-id & availability-domain
oci iam availability-domain list
// get publicip ocid + address & privateip ocid
oci network public-ip list --compartment-id ocid1.tenancy.oc1..aaaaaaaagyi66dc4o2cawmj4fclkpffuc6igwpx5aqh34mrcyx6qof6trs7a --scope AVAILABILITY_DOMAIN --availability-domain bgcw:AP-OSAKA-1-AD-1 --lifetime EPHEMERAL
// unassign current publicip w/o prompting
oci network public-ip delete --force --public-ip-id ocid1.publicip.oc1.ap-osaka-1.amaaaaaawl5wgbqaor6wq2a3ukag4cyvuta4xypphsk4ipxmol7367vkjqpq
// reassign new publicip -- failing
@greatwolf
greatwolf / proxysetup.lua
Last active March 19, 2024 09:47
Setup Signal + ShadowSocks Proxy on AWS using Lua
#!/usr/bin/env lua
server_domain = assert(..., 'Pass server domain as first argument')
-- Convenience functions for running shell commands
sh = os.execute
shout = function(cmd)
local out = assert(io.popen(cmd)):read '*all'
assert(type(out) == 'string')
return out:sub(0, -2) -- drop trailing newline
end
@greatwolf
greatwolf / chromeappid_patch.lua
Last active January 21, 2024 03:06
Allow deprecated Chrome Apps to work again on latest Chromium version
-- This script replaces one of the extension ids hardcoded in Chromium
-- with our own desired app extension id so it can function again.
-- See https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/web_applications/extensions/extension_status_utils.cc;l=30
local filename = ...
assert(filename, "missing filename")
local file = assert(io.open(filename, 'r+b'))
local bin = file:read '*a'
local kk_appid = 'idgiipeogajjpkgheijapngmlbohdhjg'
local replacement_appid = 'jdfhpkjeckflbbleddjlpimecpbjdeep'
@greatwolf
greatwolf / camenduru_webui_colab-stable.sh
Last active September 14, 2023 07:47
camenduru_webui_colab stable
#From https://github.com/camenduru/stable-diffusion-webui-colab
#Modified to use user selected model checkpoint passed in as first argument
cd /content
env TF_CPP_MIN_LOG_LEVEL=1
apt -y update -qq
wget https://github.com/camenduru/gperftools/releases/download/v1.0/libtcmalloc_minimal.so.4 -O /content/libtcmalloc_minimal.so.4
env LD_PRELOAD=/content/libtcmalloc_minimal.so.4
@greatwolf
greatwolf / camenduru_webui_colab-lite.sh
Last active August 16, 2023 08:17
camenduru_webui_colab lite
#From https://github.com/camenduru/stable-diffusion-webui-colab
#Modified to use user selected model checkpoint passed in as first argument
cd /content
env TF_CPP_MIN_LOG_LEVEL=1
apt -y update -qq
wget https://github.com/camenduru/gperftools/releases/download/v1.0/libtcmalloc_minimal.so.4 -O /content/libtcmalloc_minimal.so.4
env LD_PRELOAD=/content/libtcmalloc_minimal.so.4
@greatwolf
greatwolf / patch_konsolecursor.lua
Last active June 30, 2023 06:47
Lua script to force KDE Konsole to use a blinking vertical I cursor shape by default.
#!/usr/bin/lua
--[[
Intended for SteamOS v3.4.8 build 20230508.1.
Usage:
sudo steamos-readonly disable
sudo chmod +x patch_konsolecursor.lua
sudo patch_konsolecursor.lua /usr/lib/libkonsoleprivate.so.22.08.2
sudo steamos-readonly enable

Keybase proof

I hereby claim:

  • I am greatwolf on github.
  • I am greatwolf (https://keybase.io/greatwolf) on keybase.
  • I have a public key whose fingerprint is D92A 7BD0 33DD 16FF E492 C6F7 949E 25AC 2A21 57D4

To claim this, I am signing this object:

@greatwolf
greatwolf / luacom-scm.moteus-1.rockspec
Created January 31, 2020 05:16
LuaCOM rockspec modified to build with CMake.
package = "LuaCOM"
version = "scm.moteus-1"
source = {
url = "https://github.com/moteus/luacom/archive/master.zip",
dir = "luacom-master",
}
description = {
summary = "Use COM libraries from Lua",
detailed = [[
LuaCOM is an add-on library to the Lua language that allows Lua programs to use and implement objects that follow Microsoft's Component Object Model (COM) specification and use the ActiveX technology for property access and method calls. ]],
-- Monte Carlo Simulation of state machine in paper
-- Make one attempt to reach state 1000, fail at zero
function attempt (p)
local state = 2
local ups = 1
while state > 0 do
if state > 1000 then
-- attempt succeeded
@greatwolf
greatwolf / copyvstools.bat
Last active February 28, 2017 04:28
Modified batch for extracting Visual Build Tools 2017 into standalone
@echo off& setlocal& set x86=& set w32=system32
rem http://paulhoule.com/msvc14/copymsvc14.bat May 28, 2016
if "%~1"=="" echo Copies minimal files to run CL 14.0 (32 and 64 bit)
if "%~1"=="" echo First arg must be target directory& goto :eof
if exist "c:\Program Files (x86)\." set "x86= (x86)"& set w32=syswow64
rem set vs1=c:\Program Files%x86%\Microsoft Visual Studio 14.0
set vs1=c:\Program Files%x86%\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.10.24930
set vs2=c:\Program Files%x86%\Windows Kits\10
set vs3=c:\Program Files%x86%\Windows Kits\8.1