Skip to content

Instantly share code, notes, and snippets.

View dw5's full-sized avatar
πŸ‡¨πŸ‡­
Making better tasting swiss cheese for mail

dw5

πŸ‡¨πŸ‡­
Making better tasting swiss cheese for mail
  • ‍
  • 22:20 (UTC +03:00)
  • X @0x8616
View GitHub Profile
@dunderrrrrr
dunderrrrrr / GeoIP Block NGINX Ubuntu 20.04.md
Created April 19, 2021 08:28
Allow or block GeoIP in Nginx on Ubuntu 20.04

GeoIP Block NGINX Ubuntu 20.04

Block or filter IPs based on location in Nginx (tested on 1.18.0) on Ubuntu 20.04.

Install Nginx modules

To make use of the geographical filtering, we must first install the Nginx GeoIP module as well as the GeoIP database containing the mappings between visitors’ IP addresses and their respective countries. To do so, let’s execute:

$ sudo apt install libnginx-mod-http-geoip geoip-database
@zengxinhui
zengxinhui / convert2arch_x64.sh
Last active March 12, 2025 05:11
Replace Oracle Cloud Linux with Arch Linux remotely
[02/22/2025]
Refs:
1. https://mirrors.rit.edu/archlinux/iso/2025.02.01/archlinux-bootstrap-2025.02.01-x86_64.tar.zst
2. https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/x86_64/alpine-virt-3.21.3-x86_64.iso
3. https://wiki.alpinelinux.org/wiki/Replacing_non-Alpine_Linux_with_Alpine_remotely
4. https://wiki.archlinux.org/index.php/installation_guide#Configure_the_system
See also:
1. Convert to Debian https://gist.github.com/zengxinhui/ee0ad6b7c7f99e2ead6cd0d2bd6641fd
@liyinsg
liyinsg / migrate.sh
Created December 23, 2020 07:23
repo to gitea batch migration
#!/bin/bash
# repo forall -c /path/to/migrate.sh
GITEA_REPO=/local/yinli/repos/mirror
GITEA_API=http://sgsxdev005.isng.intel.com:6998/api/v1
GITEA_TOKEN=xxxx24939dc220dc7fc65c04d5ee9f04f5exxxx
REMOTE_URL=https://gts-chd.intel.com/scm
REMOTE_PASS="password"
REMOTE_USER="yinli"
migrate()
@milankragujevic
milankragujevic / zte-mf238v-reboot.sh
Created September 16, 2020 01:49
Reboot ZTE MF283V from shell
#!/usr/bin/expect
# to enable telnet, log in via web browser then run this command:
# curl "http://192.168.0.1/goform/goform_set_cmd_process" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "Referer: http://192.168.0.1/index.html" --data "isTest=false&goformId=URL_FILTER_ADD&addURLFilter=http%3A%2F%2Ffakeurl%2F%26%26telnetd%26%26"
# the command is needed to be run only once!
# to disable telnet, factory reset the modem
set timeout 20
set hostName "192.168.0.1"
set port "4719"
@Flix01
Flix01 / mini_mp3_radio_decoder.c
Last active August 22, 2024 14:23
Very basic single-file, plain C, openAL mp3 radio decoder
// gist made after this issue: https://github.com/mackron/dr_libs/issues/142
/*
The license refers to this single file.
Every included or linked library comes with its own license
===============================================================================
Public Domain (www.unlicense.org)
===============================================================================
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active April 17, 2025 04:55
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

Note

If you want to use pure WSLg, you can try the new WSLg (XWayland) tutorial or the WSLg (Wayland) tutorial.

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc) and tigervnc-standalone-server.

For this setup, I will use Ubuntu (20.04, 22.04 and 24.04 are working), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the [Sample

@ld100
ld100 / ArchLinuxWSL2.md
Last active March 24, 2025 13:09
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@MuhammadSaim
MuhammadSaim / rarreg.key
Last active April 24, 2025 13:37
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@ruario
ruario / chrome-ua-test.md
Last active January 24, 2023 11:40
Launching Google Chrome with a Vivaldi User Agent

The following will allow you to test Chrome with a Vivaldi user agent. Shutdown Chrome and start a Terminal (or cmd.exe on Windows), then paste in the code that is relevant for your platform and press β€œEnter”–you can triple-click to select an entire line.

Testing with Chrome

NOTE: There is little point testing in Vivaldi because old versions already had workarounds for these specific issues and from 2.10 onwards we use a Chrome User Agent string.

Windows

"%PROGRAMFILES(X86)%\Google\Chrome\Application\chrome.exe" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.94 Safari/537.36 Vivaldi/2.10.1745.21"
@dw5
dw5 / swine_hd_patch.txt
Last active April 11, 2020 14:41 — forked from kris7t/gist:2850110
Patch S.W.I.N.E. v1.9 to support 800x600, 1366x768, 1920x1080, 1920x1200 (loses support for 1024x768, 1280x1024, 1600x1200).
This difference file has been created by IDA Pro
swine.exe
0012F735: 30 33
0012F736: 32 36
0012F737: 34 36
0012F741: 32 39
0012F742: 38 32
0012F747: 32 38
0012F748: 34 30