Skip to content

Instantly share code, notes, and snippets.

@nrollr
nrollr / nginx.conf
Last active April 22, 2024 15:11
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@bignall
bignall / dont-lose-konsole-terminal-sessions-on-reboot.md
Last active July 12, 2023 12:22 — forked from bguiz/dont-lose-gnome-terminal-sessions-on-reboot.md
Ensures that you don't lose your konsole sessions when you crash/ reboot Linux

Usage

  • Save the two files below. I put them in '~/.scripts'
  • Modify the configuration in konsole-watcher.sh to your liking
  • Modify the location of konsole-watcher.sh in konsole-watcher-autostart.sh if you chose to put it somewhere besides ~/.scripts
  • Create the directory ~/.konsole (or other location you chose for the save file)
  • Create a symlink to konsole-watcher-autostart.sh in '~/.config/autostart-scripts
  • or open System Settings > Startup and Shutdown and add a script to the Script Files (it does the same thing as creating the symlink)
  • You might want to add a menu entry as well in case KDE autostart doesn't work for some reason
@level323
level323 / altnetworking.sh
Created August 3, 2016 21:14
Run a command inside a customised networking environment (using cgroups)
#!/bin/bash
# === INFO ===
# altnetworking.sh
# Description: Run the specified application in a custom networking environment.
# Uses cgroups to run process(es) in a network environment of your own choosing (within limits!)
VERSION="0.1.0"
# Author: John Clark
# Requirements: Debian 8 Jessie (plus iptables 1.6 from unstable)
#
@bangedorrunt
bangedorrunt / article-style.css
Last active July 17, 2023 13:40
GoldenDict Dark Theme
body
{
margin-top: 1px;
margin-right: 3px;
margin-left: 2px;
margin-bottom: 3px;
background: #201F1F;
color: white;
font-family: Bookerly, Segoe UI, Palatino Linotype, Arial Unicode MS;
}
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active May 3, 2024 20:50
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@nerdalert
nerdalert / ipvlan_l3_mode_example.md
Last active July 30, 2019 10:54
IPVlan L3 Mode Two Host Example

Quick Paste Ipvlan L3 Instructions

  • Host #1
ip netns add ns1
ip link add link eth1 ipvl1 type ipvlan mode l3
ip link set dev ipvl1 netns ns1

ip netns exec ns1 bash
@0XDE57
0XDE57 / config.md
Last active April 18, 2024 04:36
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@nerdalert
nerdalert / Netfilter-IPTables-Diagrams.md
Last active April 9, 2024 09:18
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@rachelhyman
rachelhyman / gist:b1f109155c9dafffe618
Last active February 21, 2024 18:20
Github README anchor links

To create anchor links that jump down to different sections of a README (as in an interactive table of contents), first create a heading:
#Real Cool Heading

The anchor link for that heading is the lowercase heading name with dashes where there are spaces. You can always get the anchor name by visiting the README on Github.com and clicking on the anchor that appears when you hover to the left of the heading. Copy everything starting at the #:
#real-cool-heading

Wherever you want to link to your Real Cool Heading section, put your desired text in brackets, followed by the anchor link in parentheses:
[Go to Real Cool Heading section](#real-cool-heading)

@josejuansanchez
josejuansanchez / bazaar-to-git.md
Last active April 6, 2021 13:41
How to import the p2psp bazaar repository in GitHub

1. Install bzr and bzr-fastimport

sudo apt-get install bzr
sudo apt-get install bzr-fastimport

2. Get the trunk branch from launchpad

bzr branch lp:p2psp