Skip to content

Instantly share code, notes, and snippets.

@eljojo
eljojo / test-ups.sh
Created February 25, 2025 01:35
script to regularly test UPS using NUT
#!/bin/bash
set -euo pipefail
# Configuration
UPS_NAME="my-ups"
UPS_USER="ups-admin"
UPS_PASS="super-secret-password"
EMAIL_RECIPIENT="[email protected]"
CHECK_INTERVAL=10 # Seconds between status checks
@larskanis
larskanis / outlook_imap_login.rb
Last active April 1, 2025 07:22
This is how to access the online service of Microsoft Office 365 by IMAP protocol in Ruby. It uses OAUTH2 authentication through the browser.
#
# This is how to access the online service of Microsoft Office 365 by IMAP protocol in Ruby.
#
# It uses OAUTH2 authentication through the browser.
# The authentication is done with the Thunderbird client_id, so that it should work equally to your Thunderbird access.
#
# Adjust your mail address:
email_address = '[email protected]'
@progzone122
progzone122 / clipboard.sh
Last active December 20, 2024 13:20
Fixing the wps-office clipboard in Linux on Wayland
#!/bin/bash
# Credits
# DiabloSat - https://github.com/progzone122
# Andrés Alberto - https://gist.github.com/andriandreo
while true; do
# Capture the current clipboard content
clipboard_content=$(wl-paste)
# Remove trailing newlines using sed
cleaned_content=$(echo "$clipboard_content" | sed ':a; /^$/{$d; N;}; /\n$/ba')
@askareija
askareija / INSTALL.md
Last active February 4, 2025 20:28
Install Ollama with AMD GPU (On Laptop) Arch Linux

My laptop specs: MSI Bravo 15 B7E

  • CPU: AMD Ryzen™ 5 7535HS Processor with AMD XDNA™ architecture 6 cores, Max Boost Clock 4.55 GHz
  • GPU: AMD Radeon™ RX 6550M 4GB GDDR6
  • RAM: 32GB DDR5-4800
  1. Clone ollama git clone --recursive https://github.com/ollama/ollama.git
  2. go to directory cd ollama
@augustin-laurent
augustin-laurent / rocm_arch_guide.md
Last active March 11, 2025 13:22
ROCm Installation guide on Arch
Date of the guide : December 17, 2023

Introduction

In this post, I will provide the solution that worked on my system on how to install Radeon Open Compute (ROCm) on Arch (linux-6.6.7.arch1-1) for RX 6900 XT (Should work on other 6000 series). ROCm is an open-source software platform that allows GPU-accelerated computation. This tool is a prerequist to use GPU Acceleration on TensorFlow or PyTorch. In this guide I will use Paru as my AUR package helper, feel free to use any other (https://wiki.archlinux.org/title/AUR_helpers). I will assume you have a working operating system and know what you do with it (Otherwise Arch will be painfull for you).

#######
## These results are still open to the public. See
## https://blog.ktz.me/the-best-media-server-cpu-in-the-world/
## for analysis of them.
# https://github.com/ironicbadger/quicksync_calc
# zoidberg - dell 7040 sff pc
CPU TEST FILE BITRATE TIME AVG_FPS AVG_SPEED AVG_WATTS
i5-6600T h264_1080p_cpu ribblehead_1080p_h264 18952 kb/s 116.352s 29.88 1.04x N/A
@ChenyangGao
ChenyangGao / alist.sh
Last active July 15, 2024 07:05
在服务器部署alist和clouddrive(原来只支持openwrt,现在已通用)
#!/usr/bin/env bash
# current_shell_rcfile() {
# if [ -n "$BASH_VERSION" ]; then
# printf "%s\n" ~/.bashrc
# elif [ -n "$ZSH_VERSION" ]; then
# printf "%s\n" ~/.zshrc
# elif [ -n "$FISH_VERSION" ]; then
# printf "%s\n" ~/.config/fish/config.fish
# elif [ -n "$XONSH_VERSION" ]; then
@mietzen
mietzen / macos-bitwarden-cli-ssh.md
Last active January 14, 2025 16:57
How to use use Bitwarden CLI for SSH-Keys in macOS

How to use use Bitwarden CLI for SSH-Keys in macOS

If you want to use Touch ID have a look at: How to use use Bitwarden CLI with macOS Touch ID

Wirtten and tested on macOS Ventura

Add SSH-Keys to Bitwarden

Before you can use Bitwarden CLI for your SSH private keys you have to add them to your Bitwarden account. Just create a normal login. The name, username and URI fields doesn't matter for my functions.

@geerlingguy
geerlingguy / stable-diffusion-ubuntu-2004-amd.sh
Last active March 15, 2024 06:52
Install Stable Diffusion on an AMD GPU PC running Ubuntu 20.04
# Note: This will only work on Navi21 GPUs (6800/6900+).
# See: https://github.com/RadeonOpenCompute/ROCm/issues/1668#issuecomment-1043994570
# Install Conda (latest from https://docs.conda.io/en/latest/miniconda.html#linux-installers)
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh
bash Miniconda3-py39_4.12.0-Linux-x86_64.sh
# follow the prompts to install it, and run `conda` to make sure it's working.
# Install git and curl, and clone the stable-diffusion repo
sudo apt install -y git curl
@mr-karan
mr-karan / deployment.hcl
Last active February 3, 2025 23:36
Single Node nomad and consul
job "hello-world" {
datacenters = ["dc1"]
namespace = "default"
type = "service"
group "redis" {
# Specify number of replicas of redis needed.
count = 1
# Specify networking for the group, port allocs.