Skip to content

Instantly share code, notes, and snippets.

@audabas
audabas / forum_cpc_home_button.user.js
Created March 21, 2025 22:30
Add home button to the top bar. Modified to put pin on the left side
// ==UserScript==
// @name Home button canardpc.com
// @namespace http://tampermonkey.net/
// @match https://forum.canardpc.com/*
// @grant none
// @version 1.1
// @author sangoon
// @author Calys
// @description 12/03/2025 19:04:17
// ==/UserScript==
@audabas
audabas / proxmox-proxy.md
Last active April 19, 2024 13:08 — forked from caraar12345/proxmox-proxy.md
Running Proxmox behind a single IP address

I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables.

What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding.

Network configuration

Here’s how it’s done:

  • Create a virtual interface that serves as the gateway for your VMs:
@audabas
audabas / default
Created September 28, 2023 09:18
Nginx block https on unregistred domains
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
# Disable logging
error_log /dev/null;
access_log off;
# Snakeoil TLS to appease Nginx
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
@audabas
audabas / coingecko.user.js
Last active October 14, 2021 11:47
Fix Coingecko portfolio decimals
// ==UserScript==
// @name Fix Coingecko portfolio decimals
// @include /^https?://www\.coingecko\.com/.*/portfolio.*/
// @version 1.1
// @grant none
// ==/UserScript==
var cryptoValDivs = document.querySelectorAll('.text-right.col-gecko.no-wrap div:nth-child(2)');
for(var idx in cryptoValDivs) {
var div = cryptoValDivs[idx];
@audabas
audabas / install-sass-and-compass
Created August 12, 2020 15:40 — forked from jasodeep/install-sass-and-compass
Install Sass & Compass on debian
sudo aptitude install ruby-full
sudo gem install sass
sudo gem install compass
@audabas
audabas / turtl2joplin.php
Last active August 6, 2020 09:13
Turtl to Joplin script
#!/usr/bin/php
<?php
/* source : https://discourse.joplinapp.org/t/turtl-to-markdown-directory/3313 by magnusmanske */
function sanitize_filename($s) {
$s = preg_replace('/[_\/\|\"]/',' ',$s) ;
$s = preg_replace('/\.+/','.',$s) ;
return $s ;
}
@audabas
audabas / logs-sms.sh
Last active November 21, 2020 15:02
Free mobile sms notification on ssh login
#!/bin/bash
# Surveillance des logs, et envoi d'un SMS quand un utilisateur se connecte ou déconnecte.
logger "SMS: Démarrage script SMS connexions."
envoie_sms () {
chaine="$(hostname): `date +%Y-%m-%d_%Hh%M` $*"
logger "SMS: $chaine"
curl -G -d user=UTILISATEUR -d pass=MOTDEPASSE --data-urlencode msg="$chaine" 'https://smsapi.free-mobile.fr/sendmsg'
}
/*=============================
jquery.barousel.js
v.0.1
Julien Decaudin - 03/2010
www.juliendecaudin.com
=============================*/
(function ($) {
$.fn.barousel = function (callerSettings) {
var settings = $.extend({
table ,tr td{
border:1px solid red
}
tbody {
display:block;
max-height:160px;
overflow-y:scroll;
}
thead, tbody tr {
display:table;
@audabas
audabas / empty_database.sql
Created March 1, 2019 13:19
Empty a database
SET FOREIGN_KEY_CHECKS = 0;
SET @tables = NULL;
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables
FROM information_schema.tables
WHERE table_schema = 'database_name'; -- specify DB name here.
SET @tables = CONCAT('DROP TABLE ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;