Skip to content

Instantly share code, notes, and snippets.

@mark-stopka
mark-stopka / e3372_openwrt_setup.md
Created October 17, 2020 15:32 — forked from aliicex/e3372_openwrt_setup.md
Using the Huawei E3372 4G Dongle with OpenWRT

Hardware requirements:

USB modem - Huawei E3372h-153/E3372s-153 (in StickMode; non-HiLink)

Firmware versions beginning with 21.xxx.xx.xx.xx NOT 22.xxx.xx.xx.xx

Router running OpenWRT; I use:

  • GL.iNet AR750S firmware v3.022
  • OpenWrt 18.06.1 r7258-5eb055306f / LuCI openwrt-18.06 branch (git-18.196.56128-9112198)
@zHaytam
zHaytam / Socks5.cs
Last active April 30, 2024 06:05
A Socks5 implementation in .NET Core (C# 8)
using System;
using System.Globalization;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace Socks
{
public static class Socks5
@micjabbour
micjabbour / main.cpp
Last active November 5, 2023 16:02
C++ WinAPI - get first physical drive serial number
#include <windows.h>
#include <memory>
#include <string>
//returns the serial number of the first physical drive in a std::string or an empty std::string in case of failure
//based on http://codexpert.ro/blog/2013/10/26/get-physical-drive-serial-number-part-1/
std::string getFirstHddSerialNumber() {
//get a handle to the first physical drive
HANDLE h = CreateFileW(L"\\\\.\\PhysicalDrive0", 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if(h == INVALID_HANDLE_VALUE) return {};
@novemberborn
novemberborn / howto.md
Created February 18, 2016 17:47
Creating a PKCS#12 file from a Let's Encrypt certificate
@Bekbolatov
Bekbolatov / tmux.md
Last active March 7, 2024 01:18
Clean tmux cheat-sheet

Clean tmux cheat-sheet

By resources

sessions

list-sessions        ls         -- List sessions managed by server
new-session          new        -- Create a new session
@drmalex07
drmalex07 / README-reverse-proxy-in-haproxy.md
Last active February 7, 2023 14:55
Perform simple reverse-proxying in HAProxy. #reverse-proxy #proxy #haproxy #proxypass

A more complete example (with rewriting cookie domains/paths) can be found at http://blog.haproxy.com/2014/04/28/howto-write-apache-proxypass-rules-in-haproxy/

We will try something roughly equivalent to the following ProxyPass directives in Apache2:

ServerName www.example.com
...
ProxyPass        /foo/  http://foo.local
ProxyPassReverse /foo/  http://foo.local

In haproxy.cfg we define a backend, say foo, to reverse-proxy to foo.local backend server.

@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1