Skip to content

Instantly share code, notes, and snippets.

@Aqours
Aqours / create_swap_asuswrt.sh
Last active April 14, 2024 16:07
Creating Swap File for AsusWrt(RT-AC86U)
# @see https://www.snbforums.com/threads/add-swap-to-usb-drive-on-asus-router.46911/
# Run the command `df` to see where your USB drive is mounted.
# Should be something like /tmp/mnt/volume-label
# Of course use your volume label in the following commands.
#--------------------------------------------
# Create a swap file
#--------------------------------------------
dd if=/dev/zero of=/tmp/mnt/volume-label/myswap.swp bs=1k count=524288
mkswap /tmp/mnt/volume-label/myswap.swp
r4---sn--cxaaj5o5q5-tt16.googlevideo.com
r2---sn--u2oxu-2v16.googlevideo.com
r3---sn--q5u5bgv02-3c26.googlevideo.com
r7---sn--w5nuxa-o536.googlevideo.com
r1---sn--nx5e6n76.googlevideo.com
r2---sn--nx5e6n76.googlevideo.com
r3---sn--nx5e6n76.googlevideo.com
r4---sn--nx5e6n76.googlevideo.com
r5---sn--nx5e6n76.googlevideo.com
r6---sn--nx5e6n76.googlevideo.com
@AfroThundr3007730
AfroThundr3007730 / socks-create.sh
Created June 23, 2019 17:48
Create an on-demand SSH-based SOCKS5 proxy via systemd socket activation
#!/bin/bash
# These steps will allow the setup of an on-demand SSH proxy
# Three unit files will be created to serve this purpose:
# ssh-socks-helper.socket - The listening socket providing activation
# ssh-socks-helper.service - A systemd proxy to pass the socket fd
# ssh-socks.service - The actual SSH service providing the tunnel
cat <<'EOF' > ~/.config/systemd/user/ssh-socks-helper.socket
[Unit]
Description=Proxy Helper Socket for Bastion SOCKS5 Proxy
@wwqgtxx
wwqgtxx / client_config.sh
Last active November 13, 2019 08:24
tunnel
#!/bin/bash
that_ip=192.168.31.1
server_ip=10.10.16.27
my_ip=$(ip -f inet address show ens33| grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/24'| grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')
echo that_ip=$that_ip
echo server_ip=$server_ip
echo my_ip=$my_ip
@blueset
blueset / telegram-zh.scpt
Last active September 6, 2018 10:39
Telegram Swift Native load language file
-- Telegram Native Swift 汉化脚本
-- 制作:Eana Hufwe
set zh_cn to "简体中文语言文件,来自 @zh_CN 的 GitHub Repo"
set zh_tw to "正體中文化文件(台灣),尚未收录"
set zh_hk to "繁體中文化文件(香港),尚未收录"
set tlocal to "本地语言文件"
set iinput to (choose file with prompt "选择您的 Telegram Native Swift 程序。" of type {"app"} default location "Applications") as string
set tgpath to POSIX path of iinput
@mckelvin
mckelvin / chnroute_for_ipsec.py
Last active March 17, 2020 03:32
Split VPN traffic for IPSec using CHNROUTE 监听 syslog, 发现 IPSec VPN 连接建立或断开后基于CHNROUTE去修改路由表。
# coding: utf-8
#
# OS X 11 (macOS ) 之后不再支持 PPTP VPN. 但 Cisco IPSec VPN 不支持像 PPTP 的
# /etc/ppp/ip-up 和 /etc/ppp/ip-down 一样方便j的机制来更新 chnroute 路由表。
# 这个脚本尝试在 Cisco IPSec VPN 下自动处理 chnroute, 做的主要工作是监听 syslog,
# 发现 IPSec VPN 连接建立或断开后去修改路由表。
#
# NOTE: 使用前可能需要修改 CUSTOMED_ROUTE_DATA, 建议将其设为
# 排除VPN子网后的 rfc1918 定义的内网IP段
#
@ivikash
ivikash / mpd.conf
Created August 4, 2016 07:15
Config file for Music Player Daemon (MPD) on Mac OSX
# Basic configuration
music_directory "~/Music"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd.pid"
state_file "~/.mpd/mpdstate"
# Audio configuration
@leolovenet
leolovenet / install_StrongSwan.sh
Created July 6, 2016 08:50
IPSEC VPN on Centos6 with StrongSwan for iOS9
#!/bin/bash
## Main reference https://raymii.org/s/tutorials/IPSEC_vpn_with_CentOS_7.html
yum -y install epel-release
yum -y install haveged strongswan
/etc/init.d/haveged start
chkconfig haveged on
cd /etc/strongswan || exit
cat > strongswan.conf <<'EOF'
@puhitaku
puhitaku / supervisor
Last active March 9, 2022 11:15
Supervisor init script for OpenWrt (procd).
#!/bin/sh /etc/rc.common
#
# AUTHOR: Takumi Sueda <puhitaku@gmail.com>
#
# Start/stop/restart supervisor in OpenWrt.
START=91
USE_PROCD=0
PROG=/usr/bin/supervisord
@xorrbit
xorrbit / setup_mosh_centos.sh
Last active July 27, 2016 16:18 — forked from tancnle/setup_mosh_centos.sh
Setup mosh 1.2.5 on Centos 6.x
#!/bin/sh
# Update latest epel
sudo yum -y instlal epel-release
# perl-IO-Socket-IP isn't in the repos
wget http://rpm.mag-sol.com/Centos/6/x86_64/perl-IO-Socket-IP-0.31-1.el6.noarch.rpm
sudo rpm -Uvh perl-IO-Socket-IP-0.31-1.el6.noarch.rpm
rm perl-IO-Socket-IP-0.31-1.el6.noarch.rpm