Skip to content

Instantly share code, notes, and snippets.

@bluewalk
bluewalk / GetNordVPNWireGuardDetails.md
Last active May 6, 2024 01:14
Getting NordVPN WireGuard details

About

Instructions to obtain WireGuard details of your NordVPN account. These can be used to setup a WireGuard tunnel on your router to NordVPN.

Source: https://forum.gl-inet.com/t/configure-wireguard-client-to-connect-to-nordvpn-servers/10422/27

Prerequisites

If you have any linux machine, use that or install a vm if you don't have one.

Get their official linux app installed. Make sure you have wireguard installed too. And set the used technology to Nordlynx by running nordvpn set technology nordlynx

@r-darwish
r-darwish / theme.yml
Created December 27, 2018 08:25
Alacritty One Dark Theme
colors:
# Default colors
primary:
background: '0x1e2127'
foreground: '0xabb2bf'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not present.
@zanculmarktum
zanculmarktum / megafetch.sh
Last active May 3, 2024 15:34
Get download url from mega.nz
#!/bin/bash
# Copyright 2018, 2019, 2020 Azure Zanculmarktum
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@arieljannai
arieljannai / get_youtube_channel_rss_feed.js
Last active May 13, 2022 11:20
Get YouTube Channel RSS Feed
for (var arrScripts = document.getElementsByTagName('script'), i = 0; i < arrScripts.length; i++) {
if (arrScripts[i].textContent.indexOf('externalId') != -1) {
var channelId = arrScripts[i].textContent.match(/\"externalId\"\s*\:\s*\"(.*?)\"/)[1];
var channelRss = 'https://www.youtube.com/feeds/videos.xml?channel_id=' + channelId;
var channelTitle = document.title.match(/\(?\d*\)?\s?(.*?)\s\-\sYouTube/)[1];
console.log('The rss feed of the channel \'' + channelTitle + '\' is:\n' + channelRss);
break;
}
}

Demo:

Spoiler warning

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

console.log("I'm a code block!");
@mdonkers
mdonkers / server.py
Last active May 6, 2024 23:32
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@ageis
ageis / systemd_service_hardening.md
Last active May 4, 2024 15:57
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
@rponte
rponte / get-latest-tag-on-git.sh
Last active March 11, 2024 07:50
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
# -*- coding: utf-8 -*-
import socket
import os
print("Connecting...")
if os.path.exists("/tmp/python_unix_sockets_example"):
client = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
client.connect("/tmp/python_unix_sockets_example")
print("Ready.")
print("Ctrl-C to quit.")
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash