Skip to content

Instantly share code, notes, and snippets.

View FFengIll's full-sized avatar
🎯
Focusing

FFengIll FFengIll

🎯
Focusing
  • Galaxy
View GitHub Profile
@FFengIll
FFengIll / remove_apt_cache
Created February 4, 2024 05:52 — forked from marvell/remove_apt_cache
Remove APT cache (for Dockerfile)
apt-get clean autoclean
apt-get autoremove --yes
rm -rf /var/lib/{apt,dpkg,cache,log}/
@FFengIll
FFengIll / nicegui_webview_demo.py
Created August 16, 2023 07:49 — forked from eli-kha/nicegui_webview_demo.py
A small demo of using pywebview with NiceGUI based on wrapping both Unicorn.Server and webview in processes.
#!/usr/bin/env python3
import multiprocessing
import tempfile
from fastapi import FastAPI
from uvicorn import Config, Server
import webview
from nicegui import ui
@FFengIll
FFengIll / unixhttpc.go
Created December 14, 2022 03:16 — forked from teknoraver/unixhttpc.go
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@FFengIll
FFengIll / Caddyfile
Created September 19, 2022 07:56 — forked from ryanburnette/Caddyfile
Caddy v2.1 CORS whitelist
(cors) {
@origin{args.0} header Origin {args.0}
header @origin{args.0} Access-Control-Allow-Origin "{args.0}"
header @origin{args.0} Vary Origin
}
myawesomewebsite.com {
root * /srv/public/
file_server
header Access-Control-Allow-Methods "POST, GET, OPTIONS"
@options {
@FFengIll
FFengIll / local_ip.go
Created August 29, 2022 09:05 — forked from miguelmota/local_ip.go
Golang get local IP
package network
import (
"errors"
"net"
)
// LocalIP get the host machine local IP address
func LocalIP() (net.IP, error) {
ifaces, err := net.Interfaces()
@FFengIll
FFengIll / tcpshell.go
Created June 6, 2022 08:15 — forked from robleh/tcpshell.go
Simple Golang TCP Reverse Shell Implant and Server
package main
import (
"flag"
"io"
"log"
"net"
"os"
"os/exec"
)
@FFengIll
FFengIll / ZSH.md
Created April 27, 2022 07:57 — forked from YumaInaura/ZSH.md
Zsh — How to create user defined widget and map with bindkey ( For very beginner of zle )

Zsh — How to create user defined widget and map with bindkey ( For very beginner of zle )

Another titles

  • How to add customized event and bind keymap
  • The very beginner to zle of zsh keymapping with bindkey

Step. Create function in shell

@FFengIll
FFengIll / CHANGELOG.md
Created April 22, 2022 09:35 — forked from juampynr/CHANGELOG.md
Sample CHANGELOG

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[Unreleased] - yyyy-mm-dd

Here we write upgrading notes for brands. It's a team effort to make them as

@FFengIll
FFengIll / 00_README.md
Created February 11, 2022 05:30 — forked from reagent/00_README.md
Custom HTTP Routing in Go

Custom HTTP Routing in Go

Basic Routing

Responding to requests via simple route matching is built in to Go's net/http standard library package. Just register the path prefixes and callbacks you want invoked and then call the ListenAndServe to have the default request handler invoked on each request. For example:

package main

import (
@FFengIll
FFengIll / color-test.sh
Created August 19, 2021 01:35
color test
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256