python

Example python scripts archlinux packages import subprocess def packages_list(): """Yay packages list""" packages = subprocess.run(["yay", "-Qu"], capture_output=True, text=True) if packages.stdout: return packages.stdout else: return "all packages updated!" return packages_list() get the wireless interface import subprocess import re def get_wlan_iface(): """Get the wireless interface name.""" interfaces = subprocess.run( ["ip", "link", "show"], capture_output=True, text=True ) pattern = r"(^\d+:\s+)(wl.+):" for iface in interfaces.stdout.splitlines(): if re.search(pattern, iface): match = re.search(pattern, iface) assert match is not None return match....

March 14, 2024 · Kristian Alexander P

rust

Hello world fn main() { // Statements here are executed when the compiled binary is called. // Print text to the console. println!("Hello World!"); } Backlinks rustup

February 25, 2024 · Kristian Alexander P

rustup

Install rust Get the installer script here for linux, but alsow support other os’es like windows.

February 25, 2024 · Kristian Alexander P