Skip to content

Instantly share code, notes, and snippets.

@msfjarvis
msfjarvis / mullvad-vpn-speedtest-suite.md
Created January 9, 2019 14:28
Collection of bash hackery to determine which Mullvad WireGuard server is the lowest latency from your location
  • Grab all your wireguard configs from Mullvad and dump them in a folder. For this test, this folder is ~/wireguard/.
  • Add the following function to generate a list of all servers you have configs for
lswg ()  { 
    ls ~/wireguard/ | cut -d '-' -f 2 | sed 's/\.conf//'
}
  • Ping each server 10 times to determine latency.
lswg | xargs -I {} ping -c 10 {}-wireguard.mullvad.net | tee mullvadwgstats
@glubsy
glubsy / howto_record_youtube_livestreams.md
Last active May 3, 2024 07:27
How to properly record Youtube & Twitch live streams

How to record Youtube live streams:

  • use livestream_saver to download from the first segment. Can also record membership-only streams by supplying it your cookies (uses yt-dlp to download)

  • use ytarchive which basically does the same thing, except a bit better.

  • use youtube_stream_capture. You can use cookies file to get member-only streams too. Be aware that this script currently fails to download chunks as soon as the stream has ended (this might be a bug).

  • or use live-dl which does monitoring of streams too. This is a wrapper around streamlink and yt-dlp.

@dimabory
dimabory / dep.md
Created February 22, 2019 14:59
Dependency Elimination Principle
@romaonthego
romaonthego / NSDateFormatter cheat sheet
Last active May 3, 2024 07:26
Date Formats for NSDateFormatter
a: AM/PM
A: 0~86399999 (Millisecond of Day)
c/cc: 1~7 (Day of Week)
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday
d: 1~31 (0 padded Day of Month)
D: 1~366 (0 padded Day of Year)
@sohukia
sohukia / C_CPP_VSCode_INSTALL.md
Last active May 3, 2024 07:25
Install and run C project on VSCode

Warning

This is only for Windows, for Linux or MacOS, please refer to another tutorial. Kiss kiss.

System installation requirements

  • chocolatey. This package will help us install the compiler MinGW and CMake. Just copy and paste this line in a Admin Powershell :
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install cmake
@kirbysayshi
kirbysayshi / lib_game_entities.js
Created July 29, 2013 04:25
rotatablegame.js: Rotate the camera in an impactjs game! Underscores in filenames indicate directories.
ig.module(
'game.entities.square'
)
.requires(
'impact.entity'
)
.defines(function(){
EntitySquare = ig.Entity.extend({
@chaiwa-berian
chaiwa-berian / Step 1: Create API User.MD
Last active May 3, 2024 07:24
Testing MTN MoMo Collection API in Sandbox using Postman

A. Checklist

  • To create an API User, you need the following things in place: X-Reference-Id and Ocp-Apim-Subscription-Key

1. X-Reference-Id

  • This is used as User ID since the Sandbox is a Mock Environment so we kinda create our own ids and send them over to the sandbox so it can uniquely identify the user
  • Get the value for this here: https://www.uuidgenerator.net/api/version4
  • Remember to keep this safely as we will use it when configuring our POST request
  • Lets say you have your X-Reference-Id as: 9f92971b-cd2e-4feb-9053-0b14d53ac4f5

2. Ocp-Apim-Subscription-Key

  • Get this from the Primary or Secondary Key of your Collections | Enable remote collection of bills, fees or taxes subscription.
@AlexisTM
AlexisTM / test.cpp
Created May 5, 2021 12:11
Print types of variables at runtime c++
#include <type_name.h>
#include <iostream>
class A {
public:
int a = 1;
int b = 2;
int c = 3;
};
@janasco
janasco / AnyDesk-Reset.cmd
Created August 3, 2023 09:46
AnyDesk Reset
@echo off & setlocal enableextensions
title Reset AnyDesk
reg query HKEY_USERS\S-1-5-19 >NUL || (echo Please Run as administrator.& pause >NUL&exit)
chcp 437
call :stop_any
del /f "%ALLUSERSPROFILE%\AnyDesk\service.conf"
del /f "%APPDATA%\AnyDesk\service.conf"
copy /y "%APPDATA%\AnyDesk\user.conf" "%temp%\"
rd /s /q "%temp%\thumbnails" 2>NUL
xcopy /c /e /h /r /y /i /k "%APPDATA%\AnyDesk\thumbnails" "%temp%\thumbnails"
@edjdavid
edjdavid / file.md
Created October 13, 2022 12:45
Stream Windows webcam/desktop via RTSP

Can be used for streaming data (webcam or screen capture) from the Windows to WSL

Install

  1. Simple RTSP Server
  2. ffmpeg

Get the internal IP of WSL

Run from a WSL terminal

ip route list default | awk '{print $3}'