Skip to content

Instantly share code, notes, and snippets.

@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active May 7, 2024 19:33
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@lorenzleutgeb
lorenzleutgeb / rad-worktree.sh
Last active May 7, 2024 19:32
rad-worktree
#! /bin/sh
set -eu
jq -V >/dev/null
if [ $# -lt 1 ]
then
printf 'Usage: %s rad:… [name-of-worktree]\n' "$0"
printf 'The worktree will be created in a new directory within the current working directory.'
exit 1
@AndrewMast
AndrewMast / disable_vanguard.vbs
Last active May 7, 2024 19:32
Commands to disable Riot Vanguard when you aren't playing Valorant
' Disables Vanguard from starting when you boot your computer
Call CreateObject("Shell.Application").ShellExecute("cmd.exe", "/c ""sc config vgc start= disabled & sc config vgk start= disabled""", "", "runas")
@patchthecode
patchthecode / reset_idea_trial.sh
Created June 29, 2021 22:50 — forked from gulrich1/reset_idea_trial.sh
reset intellij trial
#!/bin/sh
#https://github.com/PythonicNinja/jetbrains-reset-trial-mac-osx/blob/master/runme.sh
for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine Rider; do
echo "Closing $product"
ps aux | grep -i MacOs/$product | cut -d " " -f 5 | xargs kill -9
echo "Resetting trial period for $product"
@rjescobar
rjescobar / extend-trial-jetbrains-windows.bat
Created August 31, 2021 02:53
JetBrains IDE trial reset windows
REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do (
for /d %%a in ("%USERPROFILE%\.%%I*") do (
rd /s /q "%%a/config/eval"
del /q "%%a\config\options\other.xml"
)
)
REM Delete registry key and jetbrains folder (not sure if needet but however)
rmdir /s /q "%APPDATA%\JetBrains"
@davidalves1
davidalves1 / formatar_cnpj_cpf.md
Last active May 7, 2024 19:28
Função para formatar CNPJ e CPF, disponível em PHP e JS

PHP

function formatCnpjCpf($value)
{
  $CPF_LENGTH = 11;
  $cnpj_cpf = preg_replace("/\D/", '', $value);
  
  if (strlen($cnpj_cpf) === $CPF_LENGTH) {
    return preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
  } 
@Axel-Erfurt
Axel-Erfurt / celluloidTV.m3u
Last active May 7, 2024 19:28
Livestreams deutscher TV-Sender
#EXTM3U
#EXTINF:-1,ARD
https://mcdn.daserste.de/daserste/de/master.m3u8
#EXTINF:-1,ARD ONE
https://mcdn.one.ard.de/ardone/hls/master.m3u8
#EXTINF:-1,ARD Alpha
https://mcdn.br.de/br/fs/ard_alpha/hls/de/master.m3u8
#EXTINF:-1,ARD Tagesschau
https://tagesschau.akamaized.net/hls/live/2020115/tagesschau/tagesschau_1/master.m3u8
#EXTINF:-1,ZDF
@qoomon
qoomon / conventional_commit_messages.md
Last active May 7, 2024 19:27
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@andreibosco
andreibosco / yubikey-windows10.md
Last active May 7, 2024 19:26
Setting up Yubikey with SSH and Git on Windows 10 + Powershell
@lewiwiii
lewiwiii / network_listener.py
Created May 7, 2024 19:16
[W.I.P.] Python script using scapy that will automatically run the PPPwn exploit every time the console sends PADI
from scapy.all import sniff, PPPoED
import threading
import subprocess
def packet_listener():
print("Starting packet listener on interface eth0...")
def handle_packet(packet):
print("Packet detected. Checking for PADI packets...")
# Check if it's a PADI packet (code 0x09 for PPPoE Discovery Initiation)
if PPPoED in packet and packet[PPPoED].code == 0x09: