Skip to content

Instantly share code, notes, and snippets.

@ShadowMonster99
ShadowMonster99 / library.js
Last active May 20, 2023 17:30
check when new game is clicked / loaded into view
//TIPS
//by the time this script is injected, the dom MAY be loaded
//alert function breaks CEF
console.log('hello from patcher current page -> ' + document.title);
function game_selected(name, appid)
{
console.log(`game: ${name}, appid: ${appid}`)
}
@leuc
leuc / amdgpu_metrics.py
Last active June 23, 2024 06:30
Decode AMD GPU Metrics from SysFS
#!/usr/bin/env python3
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# amdgpu_metrics.py decode amdgpu metrics from sysfs
# Copyright (C) 2021 leuc
#
# This program is free software: you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
.subviewbutton:not(.subviewbutton-iconic, [image], .all-tabs-close-button) > image {
width: 16px;
height: 16px;
margin-inline-end: 8px !important;
-moz-context-properties: fill;
fill: currentColor;
}
#overflowMenu-customize-button > .toolbarbutton-icon {
margin-inline-end: 0.5em !important;

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@sergiosusa
sergiosusa / steamtradematcher-scan-utilities.user.js
Last active February 9, 2022 14:26
Bring some utilities to the Steam Trade Matcher results page.
// ==UserScript==
// @name Steamtrade Matcher Scan Utilities
// @namespace http://sergiosusa.com
// @version 0.3
// @description Bring some utilities to the Steam Trade Matcher results page.
// @author Sergio Susa (sergio@sergiosusa.com)
// @match http://www.steamtradematcher.com/compare
// @match https://www.steamtradematcher.com/compare
// @grant none
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
@ageis
ageis / systemd_service_hardening.md
Last active July 3, 2024 21:02
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@thomasfr
thomasfr / mysqld.service
Created July 23, 2014 17:43
mysqld.service file for systemd
[Unit]
Description=MySQL Server
After=syslog.target
After=network.target
[Service]
Type=simple
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/run/mysqld
ExecStartPre=/bin/chown mysql:mysql -R /var/run/mysqld
@techtonik
techtonik / find_executable.py
Last active April 4, 2022 06:23
Python Which/Where - Find executable
#!/usr/bin/env python
# https://gist.github.com/4368898
# Public domain code by anatoly techtonik <techtonik@gmail.com>
# AKA Linux `which` and Windows `where`
# For Python 3 you probably want
# https://docs.python.org/dev/library/shutil.html#shutil.which
import os
@kepler
kepler / sshplus.py
Created September 2, 2011 18:03
SSHplus
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# SSHplus
# A remote connect utlity, sshmenu compatible clone, and application starter.
#
# (C) 2011 Anil Gulecha
# Based on sshlist, incorporating changes by Benjamin Heil's simplestarter
#
# This program is free software: you can redistribute it and/or modify