Skip to content

Instantly share code, notes, and snippets.

View nogweii's full-sized avatar
🍀

Nogweii nogweii

🍀
View GitHub Profile
@nogweii
nogweii / gist:7761427
Created December 3, 2013 00:02
Automatically install -debuginfo packages for all installed packages in OpenSUSE (tested on 13.1)
#!/bin/sh
zypper packages -i 2>/dev/null | cut -d'|' -f3 | sort -u | sed -n 's/^ \([a-z0-9-]*\)\s\+/\1-debuginfo/p' | xargs zypper search -u -t package | cut -d'|' -f2 | sed -n 's/^\s//;s/\s\+$//gp' | tail -n+2 | xargs sudo zypper install
@nogweii
nogweii / color_scheme.yaml
Last active February 20, 2023 17:54
The current color scheme I use in my gnome terminal, plus accompanying ruby script which generated it
---
:blue: "#3465A4"
:cyan: "#06989A"
:green: "#4E9A06"
:bright_red: "#EF2929"
:bright_yellow: "#FCE94F"
:bright_purple: "#AD7FA8"
:bright_white: "#EEEEEC"
:red: "#CC0000"
:yellow: "#C4A000"
@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 / metaflac.list.txt
Created March 14, 2013 08:16
Output from running `metaflac --list *.flac` on the Symphony of Science album, to try fixing https://github.com/sampsyo/beets/issues/220#issuecomment-14890379
This file has been truncated, but you can view the full file.
01-Our Story (intro).flac:METADATA block #0
01-Our Story (intro).flac: type: 0 (STREAMINFO)
01-Our Story (intro).flac: is last: false
01-Our Story (intro).flac: length: 34
01-Our Story (intro).flac: minimum blocksize: 4096 samples
01-Our Story (intro).flac: maximum blocksize: 4096 samples
01-Our Story (intro).flac: minimum framesize: 362 bytes
01-Our Story (intro).flac: maximum framesize: 14413 bytes
01-Our Story (intro).flac: sample_rate: 44100 Hz
01-Our Story (intro).flac: channels: 2
@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 / Test.java
Created October 1, 2013 23:39
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed. If you don't, in Java 6 you'll see 128. If you do, you'll see 2147483647. Thanks to http://stackoverflow.com/questions/11538746/check-for-jce-unlimited-strength-jurisdiction-policy-files
import javax.crypto.Cipher;
class Test {
public static void main(String[] args) {
try {
System.out.println("Hello World!");
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
System.out.println(maxKeyLen);
} catch (Exception e){
System.out.println("Sad world :(");
@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)