Skip to content

Instantly share code, notes, and snippets.

@levinion
levinion / pacdep
Created September 26, 2025 09:11
Get all the ArchLinux packages that an executable file depends on
#!/bin/sh
comm -23 <(ldd $1 | cut -d' ' -f3 | xargs -n1 pacman -Qoq | sort -u) <(pactree -u base | sort)
@levinion
levinion / findshit
Last active September 3, 2025 05:25
Find electron shits on your system ( archlinux only). Note: You may need to have `fd` and `pacman-contrib` installed before you run this script.
#!/bin/bash
pacman -Qqn | grep electron | xargs -n 1 pactree -ru
for p in $(ls -d /opt/*/); do
fd -q 'electron' $p && pacman -Qoq $p
done
exit 0
@levinion
levinion / makels
Created September 1, 2025 14:21
alternative to `just --list` for makefile
#!/bin/bash
cat Makefile | grep .PHONY | cut -d: -f 2- | xargs -n 1 echo
@levinion
levinion / aurgit
Last active August 22, 2025 14:55
Simple script auto install package from aur's github mirror
#!/bin/bash
tempdir="$(mktemp -d)"
pkgname="$@"
cleanup() {
[[ -d "$tempdir" ]] && rm -rf "$tempdir"
}
cd "$tempdir"
@levinion
levinion / pactime
Last active June 27, 2025 05:29
list pacman packages by install time
#!/usr/bin/env python3
import subprocess
import datetime
import argparse
version = "0.1.2"
class PackageInfo:
@levinion
levinion / log.cpp
Created April 23, 2025 14:19
A simple cpp log macro
template<typename T, typename... Args>
void LOG(T value, Args... args) {
std::cout << value;
((std::cout << ' ' << args), ...);
std::cout << std::endl;
}
@levinion
levinion / v
Last active September 1, 2025 14:24
An easy script to automatically exec editor with or without sudo
#!/bin/env python3
import os
import subprocess
import sys
def main():
argv = sys.argv
_target = os.getcwd() if len(argv) == 1 else argv[1]
use crossbeam::channel::{unbounded, Receiver, Sender};
use std::{
sync::{Arc, Mutex},
thread,
};
#[derive(Clone)]
struct Runtime {
rx: Receiver<Task>,
}