Skip to content

Instantly share code, notes, and snippets.

View sophieforceno's full-sized avatar

sophiejane sophieforceno

  • Connecticut, USA
View GitHub Profile
@BlaM
BlaM / cookiebanner-go-away.user.js
Last active May 18, 2024 16:55
Get rid of EU Cookie Banners (Tampermonkey)
// ==UserScript==
// @name Get rid of EU Cookie Banners
// @namespace http://blog.deobald.org/
// @description Get rid of EU Cookie Banners
// @license http://creativecommons.org/licenses/by-nc-sa/3.0/
// @downloadURL https://gist.githubusercontent.com/BlaM/6d826d6e9d77d2d77bf9a92fdad55788/raw/cookiebanner-go-away.user.js
// @homepage https://gist.github.com/BlaM/6d826d6e9d77d2d77bf9a92fdad55788
// @version 0.3.4
// @author Dominik Deobald
// @match http*://*/*
@carboneater
carboneater / nginx-ssl-failure.conf
Created April 28, 2017 21:00
Fail2ban filter to detect SSL Handshake Failure due to a bad client SSL Version
# fail2ban filter configuration for nginx
# Detects SSL Handshake Failures
[Definition]
failregex = \[crit\] \d+\#\d+: \*\d+ SSL_do_handshake\(\) failed \(SSL: error:1417D18C:SSL routines:tls_process_client_hello:version too low\) while SSL handshaking, client: <HOST>, server: \S*\s*$
ignoreregex =
@mapuo
mapuo / debian_ksm.md
Last active July 17, 2024 08:06
Enable KSM (Kernel Same-Page Merging) on boot in Debian

Enable KSM (Kernel Same-Page Merging) on boot in Debian

I have installed and run Netdata on my Debian based home server and I wanted to enable KSM after Netdata installer suggested it could save some RAM.

To enable the KSM on boot in Debian you I executed these steps:

  1. Install ksmtuned without all the QEMU dependencies:
@Tristor
Tristor / iptables.sh
Last active December 22, 2023 20:19
Simple IPtables script for an OpenVPN server
#!/bin/bash
# Flushing all rules
iptables -F FORWARD
iptables -F INPUT
iptables -F OUTPUT
iptables -X
# Setting default filter policy
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active July 19, 2024 22:35
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active July 7, 2024 19:47
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@bionik
bionik / gist:483b4b144da5cb54606b
Last active March 29, 2016 16:32
Slim down Ubuntu server dynamic motd
The dynamic motd shows a bit too much info by default:
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-45-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Thu Feb 12 22:05:52 EET 2015
System load: 0.01 Processes: 153
Usage of /home: 11.8% of 274.89GB Users logged in: 0
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@XVilka
XVilka / TrueColour.md
Last active July 9, 2024 23:28
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@bitmorse
bitmorse / lastexport.py
Created March 20, 2013 00:51
lastfm scrobble exporter (from https://gitorious.org/fmthings/lasttolibre/blobs/master/lastexport.py // changed the script to try more often on failure )
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of