Skip to content

Instantly share code, notes, and snippets.

View nogweii's full-sized avatar
🍀

Nogweii nogweii

🍀
View GitHub Profile
@nogweii
nogweii / sudo_debug.txt
Created January 29, 2023 07:37
sudo debug logs
Jan 29 07:20:33.814 sudo[1731408] -> sudo_check_suid @ ./sudo.c:912
Jan 29 07:20:33.814 sudo[1731408] <- sudo_check_suid @ ./sudo.c:967
Jan 29 07:20:33.814 sudo[1731408] -> save_signals @ ./signal.c:75
Jan 29 07:20:33.814 sudo[1731408] <- save_signals @ ./signal.c:82
Jan 29 07:20:33.814 sudo[1731408] -> init_signals @ ./signal.c:121
Jan 29 07:20:33.814 sudo[1731408] will restore signal 13 on exec
Jan 29 07:20:33.814 sudo[1731408] <- init_signals @ ./signal.c:168
Jan 29 07:20:33.814 sudo[1731408] -> sudo_conf_read_v1 @ ./sudo_conf.c:659
Jan 29 07:20:33.814 sudo[1731408] -> sudo_secure_open @ ./secure_path.c:108
Jan 29 07:20:33.814 sudo[1731408] -> sudo_check_secure @ ./secure_path.c:42
@nogweii
nogweii / INSTRUCTIONS.md
Last active September 2, 2022 08:54
Easily upload the latest Arch Linux cloudimg to UpCloud

Just run ./upload_to_upcloud.sh and it'll download the latest qcow2 image, then upload the raw version to UpCloud as a template.

It's smart, too. It won't needlessly redownload the latest image if it doesn't need to, nor will it upload it to UpCloud if it exists already in your account.

Dependencies

You'll need a few tools:

@nogweii
nogweii / FIX.md
Last active May 11, 2022 03:35
neovim crashing (on linux)

Rebuild the luv package with the patch at luvit/luv#598 applied. See PKGBUILD for an example.

@nogweii
nogweii / FIX.md
Last active May 9, 2022 23:19
neovim debugging

this was resolved by compiling luv from the latest HEAD to include PR #598. Then reinstalling neovim from source to pick up the later version of luv.

brew unlink neovim luv
brew install --HEAD luv

brew install --HEAD neovim

@nogweii
nogweii / README.md
Created January 7, 2022 22:59
A webhook payload example for Datadog that includes every single variable in their documentation.

Read more about Datadog's webhook support in their documentation.

In order to create a webhook, you must build a JSON payload to send to the destination URL. Their pre-filled in one only covers a few variables, but is pretty general. But what if you wanted everything? I did, so I made this payload. Hope it can be of use to you, too!

@nogweii
nogweii / foo.lua
Last active May 21, 2021 06:48
test case in neovim for table.move
local merge_arrays = function(a, b)
local result = {unpack(a)}
table.move(b, 1, #b, #result + 1, result)
return result
end
local first = {1,2,3}
local second = {2,4,6}
merge_arrays(first, second)
@nogweii
nogweii / github_starred.gql
Created September 18, 2019 06:41
GraphQL query for Github to get N recently starred repos, along with their langauges/topics
query RecentlyStarredRepos($numRepos: Int, $cursor: String) {
viewer {
starredRepositories(last: $numRepos, before: $cursor) {
edges {
starredAt
cursor
node {
id
name
description
@nogweii
nogweii / status_play.gql
Created September 18, 2019 06:16
Github GraphQL query to change your Github status
query GetCurrentStaus {
viewer {
login
status {
emoji
message
}
}
}
@nogweii
nogweii / xmas_tree.rb
Created December 22, 2018 20:50 — forked from mehdi-farsi/xmas_tree.rb
A light-up christmas tree in your terminal
class ChristmasTree
FIRST_LINE_LENGTH = 1
LEVEL_HEIGHT = 3
COLORS = ["\033[0m", "\033[0m", "\033[0m", "\033[31m", "\033[33m", "\033[32m", "\033[34m"] # red, yellow, blue
def initialize(levels)
@levels = levels.to_i < 1 ? 3 : levels.to_i
@last_line_length = 5 + ((@levels - 1) * 2)
@current_line_length = FIRST_LINE_LENGTH
end
@nogweii
nogweii / telegraf-1.5.1-sqlserver-stats.txt
Created July 20, 2018 21:33
telegraf --test --input-filter=sqlserver runs
* Plugin: inputs.sqlserver, Collection 1
> Log\ size\ (bytes),host=devsqldist,environment=Development,owner=$MACHINE_OWNER,role=$MACHINE_ROLE,type=Database\ size,servername=DEVSQLDIST,source=sqlserver model=8388608i,Repl_Counters=8388608i,ReportServer=8388608i,ReportServerTempDB=8388608i,Test=8388608i,tempdb=142606336i,msdb=20578304i,distribution=143654912i,master=2097152i 1532122345000000000
> Rows\ size\ (bytes),role=$MACHINE_ROLE,host=devsqldist,type=Database\ size,servername=DEVSQLDIST,source=sqlserver,environment=Development,owner=$MACHINE_OWNER distribution=550502400i,model=8388608i,msdb=30474240i,tempdb=301989888i,ReportServerTempDB=8388608i,ReportServer=8388608i,Repl_Counters=8388608i,Test=8388608i,master=4653056i 1532122345000000000
> Rows\ size\ (8KB\ pages),role=$MACHINE_ROLE,servername=DEVSQLDIST,type=Database\ size,source=sqlserver,host=devsqldist,environment=Development,owner=$MACHINE_OWNER ReportServer=1024i,ReportServerTempDB=1024i,tempdb=4096i,distribution=67200i,msdb=3720i,Test=1024i,master=