Skip to content

Instantly share code, notes, and snippets.

View congzhangzh's full-sized avatar
🎯
Focusing

Cong Zhang congzhangzh

🎯
Focusing
View GitHub Profile
@netrunn3r
netrunn3r / iptables_geoip_debian.md
Last active November 5, 2024 22:58
Install geoip for iptables in Debian 10
  1. change from buster to bullseye
  2. sudo apt install libnet-cidr-lite-perl libtext-csv-xs-perl libgeoip2-perl

for day of writing, there is a problem with building by dkms this package xtables-addons-common so wehave to install this from source

  1. sudo apt install pkg-config libxtables-dev
  2. wget http://inai.de/files/xtables-addons/xtables-addons-3.13.tar.xz
  3. tar xf xtables-addons-3.13.tar.xz
  4. cd xtables-addons-3.13/
  5. ./configure
  6. make
@rkkoszewski
rkkoszewski / gist:aa531cee7126edf329b76bdd0546f502
Last active December 31, 2024 12:32
Notes for installing XorgXrdp and Xrdp with GLAMOR support
THIS ARE MY NOTES OF BUILDING AN INSTALLING XORGXRDP AND XRDP WITH GPU ACCELERATION
TESTED ON DEBIAN 9.13
-- Build XorgXrdp with GPU acceleration ("script" - to be adjusted to your needs) : --
## << BUILD AND INSTALL SCRIPT START >> ##
#!/bin/bash
# Install Latest XRDP with XORGXRDP
# README
@PonyMaLoveJackMa
PonyMaLoveJackMa / netboot.sh
Last active October 30, 2020 01:57 — forked from AndersonIncorp/netboot.xyz.md
Install netboot.xyz.lkrn into grub
apt install wget -y
wget https://boot.netboot.xyz/ipxe/netboot.xyz.lkrn -O /netboot.xyz.lkrn
cat >> /etc/grub.d/40_custom <<EOF
#/etc/grub.d/40_custom
menuentry "netboot.xyz.lkrn" {
linux16 (hd0,msdos1)/netboot.xyz.lkrn # /boot is (hd0,msdos1) drive
}
EOF
grub2-mkconfig -o /boot/grub2/grub.cfg
grub-mkconfig -o /boot/grub/grub.cfg
@atdt
atdt / knock.py
Created July 26, 2020 16:11
Port-knocking client (e.g. for knockd) in Python
#!/usr/bin/env python3
# Port-knocking client
# Usage: knock HOST PORT [PORT...]
import socket
import sys
try:
host = sys.argv[1]
ports = [int(p) for p in sys.argv[2:]]
@SteveSandersonMS
SteveSandersonMS / Index.razor
Created February 20, 2020 14:24
Blazor WebAssembly use of ClientWebSocket
@page "/"
@using System.Net.WebSockets
@using System.Text
@using System.Threading
@implements IDisposable
<h1>Echo test</h1>
<h3>State: @webSocket.State</h3>
@if (webSocket.State == WebSocketState.Open)
@jjsanderson
jjsanderson / network-manager-raspbian-2020-02-05.md
Last active April 20, 2023 17:25
Installing Network Manager on Raspbian 2020-02-05

Installing Network Manager on Raspbian 2020-02-05

NOTE:
This guide was written more than two years ago, which in Pi years means it's now graduated college, or something. Inevitably, it's at least a little out of date, and it may even be entirely misleading. There are several helpful suggestions in the comments (thanks everyone), and most recently a report that what's here plain doesn't work on current (early 2022) Raspbian. Which isn't even called 'Raspbian' any more.
As of Jan 2022 I'm partially back in my office-which-has-access-to-eduroam, and I do have a need to build up a fresh Pi desktop. If and when I get that working I'll update this guide. In the meantime: good luck, and please leave a comment to report success or failure.
(June 2022) Nope, I still haven't actually tried any of this myself. However, I have had to troubleshoot eduroam wifi on my Linux ThinkPad. As of Ubuntu 22.04 it would no longer connect. [This Stack Exchange answer](https://askubuntu.com/questions/27976

@congzhangzh
congzhangzh / set_ipsec_tun.sh
Last active November 9, 2019 12:53 — forked from vishvananda/tunnel.sh
A script setup an ip sec tunnel to a server and use server as default route, this in fact create a security vpn which is very fast and NAT friendly which work for both NAT behind host. All the input parameter need be set in file which mark as input section!!!
#!/bin/bash
#
# the basic idea from https://gist.github.com/vishvananda/7094676
#
# if [ "$4" == "" ]; then
# echo "usage: $0 <local_ip> <remote_ip> <new_local_ip> <new_remote_ip>"
# echo "creates an ipsec tunnel between two machines"
# exit 1
@gengwg
gengwg / github_private_email.md
Created October 10, 2019 03:44
remote: error: GH007: Your push would publish a private email address.
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 681 bytes | 681.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: error: GH007: Your push would publish a private email address.
remote: You can make your email public or disable this protection by visiting:
remote: http://github.com/settings/emails
@hute37
hute37 / xvfb-xserverrc.sh
Last active February 27, 2024 14:01
Xvfb startup for nomachine headless (wayland) virtual desktop session
#!/bin/sh
##
# Xvfb headless startup
#
# #see: https://www.nomachine.com/AR10K00710
##
theory
Consensus_Demo
imports
Network
begin
datatype 'val msg
= Propose 'val
| Accept 'val