Skip to content

Instantly share code, notes, and snippets.

View wberdowski's full-sized avatar

Wojciech Berdowski wberdowski

View GitHub Profile
@wberdowski
wberdowski / SocketKeepAlive.cs
Created June 15, 2023 18:37
C# TCP Socket Keep Alive Extensions
using System.Net.Sockets;
using System.Runtime.InteropServices;
namespace SocketKeepAlive
{
public static class SocketKeepAlive
{
public static void SetKeepAlive(this Socket socket, bool enabled, int keepalivetime, int interval)
{
int size = Marshal.SizeOf((uint)0);
@wberdowski
wberdowski / LatLon2Dms.cs
Created June 14, 2021 14:38
Convert latitude and longitude to DMS (degrees minutes seconds) format
public static class LatLon2Dms
{
public static string Convert(double lat, double lon)
{
return ConvertSingle(lat, true) + ", " + ConvertSingle(lon, false);
}
private static string ConvertSingle(double value, bool isLat)
{
double v = Math.Abs(value);
@wberdowski
wberdowski / Popcat no-click bot POC.js
Last active December 8, 2023 04:38 — forked from DaWe35/Popcat click bot.js
Ban-proof popcat bot
/*
1) Open https://popcat.click
2) Open console (F12 or CTRL+SHIFT+I)
3) Insert code & run
4) Monitor bot progress in the console
Note: popcat.click server registers only 800 pops every 30 seconds per IP address (that's why this bot is slow and runnig it in multiple tabs won't work).
If you'll send 800 or more clicks 10 times in a row, you'll get banned for 12 hours ("ban" cookie is set).
This bot addresses this issue and will NOT get you banned.
@wberdowski
wberdowski / VLC_Multiple_Audio_Tracks_Fix.reg
Last active April 17, 2021 13:43
Changes default VLC launch parameters in order to play all audio tracks of Nvidia ShadowPlay MP4 files.
Windows Registry Editor Version 5.00
; WARNING!
; RUN ONLY IF YOUR VLC INSTALLATION DIRECTORY IS C:\Program Files\VideoLAN\VLC
; WARNING!
[HKEY_CLASSES_ROOT\VLC.mp4\shell\Open\command]
@="\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\" --started-from-file \"%1\" --sout-all --sout #display"
@wberdowski
wberdowski / clean_start_menu_win10.ps1
Last active November 7, 2020 13:38
Clean Windows 10 start menu from preinstalled bloatware.
Get-AppxPackage *Microsoft.3dbuilder* | Remove-AppxPackage
Get-AppxPackage *AdobeSystemsIncorporated.AdobePhotoshopExpress* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Asphalt8Airborne* | Remove-AppxPackage
Get-AppxPackage *king.com.CandyCrushSodaSaga* | Remove-AppxPackage
Get-AppxPackage *Microsoft.DrawboardPDF* | Remove-AppxPackage
Get-AppxPackage *Facebook* | Remove-AppxPackage
Get-AppxPackage *BethesdaSoftworks.FalloutShelter* | Remove-AppxPackage
Get-AppxPackage *FarmVille2CountryEscape* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsFeedbackHub* | Remove-AppxPackage
Get-AppxPackage *Microsoft.GetHelp* | Remove-AppxPackage