Skip to content

Instantly share code, notes, and snippets.

View MichaelMai2000's full-sized avatar
:octocat:
Getting busy

Michael Mai MichaelMai2000

:octocat:
Getting busy
  • Sydney, NSW, Australia
View GitHub Profile
@miyouzi
miyouzi / nginx_with_socat.md
Last active May 3, 2024 14:05
配置 Nginx 通过代理访问反代目标(B站代理解析)

简介

众所周知,有些服务存在着地区限制,我们可以通过在服务所属地区搭建代理服务来解决,其中在其服务范围内部署 Nginx 反代服务是个有效且流行的办法。

但如果区域很多,每个区域都布置一台服务器那成本会有些高昂且利用率很低,通常我们只是需要该地区的 IP 而已,如果手头上正好有这些地区的代理池的话,那我们就可以只用一台服务器部署Nginx反向代理结合服务所在地区的代理实现相同的效果。

本文着重介绍的就是如何让 Nginx 通过代理访问上游服务。(即 proxy_pass 的目标)

详细图文说明可以参见《Nginx 如何与 Socat 配合使用》

PS:本配置兼容 《哔哩漫游》《解除b站区域限制》

@ziadoz
ziadoz / pdf-img.sh
Created March 11, 2020 00:04
Extract Images From PDF / Build PDF From Images / Remove PDF White Margins (Ubuntu)
#!/usr/bin/env bash
# Extract images from a PDF: https://askubuntu.com/questions/117143/command-line-tool-to-bulk-extract-images-from-a-pdf
sudo apt-get install poppler-utils
pdfimages -all input.pdf images/image
# Build PDF from images: https://stackoverflow.com/questions/8955425/how-can-i-convert-a-series-of-images-to-a-pdf-from-the-command-line-on-linux
sudo apt install img2pdf
img2pdf --output d.pdf images/image*.jpg
// ==UserScript==
// @name DLSite page search
// @namespace https://www.south-plus.net/
// @version 0.2
// @description add sp search link to item page
// @author nideii
// @match https://www.dlsite.com/*/work/=/product_id/*.html
// @require https://cdn.jsdelivr.net/npm/jquery@2.2.4/dist/jquery.min.js
// @require https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js
@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

@narate
narate / create-hotspot.md
Last active July 21, 2024 09:30
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@mirai-iro
mirai-iro / VIMJ-utils.md
Last active December 26, 2019 10:09
コロムビアさん MASTER BOX DSはまだですか……

VIMJ utils

ファイルの説明

  • vimj_cut.pl
    • F_XXX.BIN & F_XXX.IDX からファイルを取り出します
  • vimj_sss2s14.pl
  • MIDステレオの楽曲データ(*.SSS)を2つの *.S14 ファイルに分割します
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active July 21, 2024 14:28
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@dominicgs
dominicgs / set_bdaddr.sh
Created July 26, 2013 04:48
A script to change the address of a CSR Bluetooth dongle using bccmd. Example: # set_bdaddr.sh hci1 01 02 03 04 05 06
#!/bin/bash
#hci1 01:02:03:04:05:06
#bccmd -d hci1 psset bdaddr 04 00 06 05 03 00 02 01
CMD="bccmd -d $1 psset bdaddr $(($5)) 00 $(($7)) $(($6)) $(($4)) 00 $(($3)) $(($2))"
echo $CMD
$CMD