Skip to content

Instantly share code, notes, and snippets.

<!-- not working yet -->
<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<general t="map">
<mode t="map">
<confirm t="boolean">false</confirm>
</mode>
<self_update config:type="boolean">false</self_update>
</general>
#!/bin/bash
url="https://discord.com/api/download?platform=linux"
remote_version=$(curl -sIL $url | grep location: | cut -d/ -f7 | sed -ne 's/discord-\([0-9.]*\)\.deb/\1/p' | tr -d '\r$')
local_version=$(dpkg-query -W -f'${Version}\n' discord)
rc=$(dpkg --compare-versions "${local_version}" "lt" "${remote_version}"; echo $?)
if [ $rc -eq 0 ]; then
#!/bin/bash
total_rss=0
total_vsz=0
total_size=0
while read -r size rss vsz user command; do
total_rss=$((total_rss+rss))
total_vsz=$((total_vsz+vsz))
total_size=$((total_size+size))
@papamoose
papamoose / One line to rebuild all DKMS modules on Ubuntu
Last active February 4, 2023 19:44 — forked from Brainiarc7/One line to rebuild all DKMS modules on Ubuntu
One line to rebuild all DKMS modules on Ubuntu
#!/bin/bash
ls -d /usr/src/linux-headers-* \
| sed -e 's/.*linux-headers-//' \
| grep generic \
| sort -V \
| tac \
| sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start
@papamoose
papamoose / ffmpeg.md
Created November 13, 2022 21:52 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
#!/bin/bash
umask 022
{% if letsencrypt_eab %}
server={{ letsencrypt_server }}
kid={{ letsencrypt_eab_kid }}
hmac={{ letsencrypt_eab_hmac }}
acmeurl={{ letsencrypt_acmeurl }}
{% elif letsencrypt_testmode %}
server=acme-staging-v02.api.letsencrypt.org
@papamoose
papamoose / README.md
Last active February 13, 2022 16:19
RobinLinus-snapdrop using docker-compose and traefik

Assumes you run Traefik.

You need to checkout the repository so you can mount the server and client directories into the container.

git clone https://github.com/RobinLinus/snapdrop.git

Then modify docker-compose.yml and create templates/default.conf.template.

@papamoose
papamoose / README.md
Created January 6, 2022 20:11
ZFS Health Check & Discord Notification Bash Script

Summary

This is a script I made to check the health of the ZFS pools on my Ubuntu server and send a notification with a summary to a Discord server channel (see image of example notification below) I have made for my servers. I borrowed and modified some parts for the actual ZFS health check from this Gist. The script checks ZFS pools overall condition, capacity, errors and time since last scrub. If an issue is detected with a pool a role on the Discord channel is pinged.

This script is only tested on Ubuntu Server 20.04.

Instructions

Copy the two bash files to a Linux server with ZFS pools and modify as required based on distro/version. Fill inn the Discord variables in the discord-variables.sh file.

@papamoose
papamoose / install-xcode-cli-tools.sh
Created December 8, 2021 17:31 — forked from mokagio/install-xcode-cli-tools.sh
Install Xcode CLI Tools without GUI
#!/bin/bash
# See http://apple.stackexchange.com/questions/107307/how-can-i-install-the-command-line-tools-completely-from-the-command-line
echo "Checking Xcode CLI tools"
# Only run if the tools are not installed yet
# To check that try to print the SDK path
xcode-select -p &> /dev/null
if [ $? -ne 0 ]; then
echo "Xcode CLI tools not found. Installing them..."
@papamoose
papamoose / show_GET_and_POST_requests.py
Created October 15, 2021 17:40
A simple web server that displays any GET or POST requests sent to it.
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):