Skip to content

Instantly share code, notes, and snippets.

View andrius's full-sized avatar

Andrius Kairiukstis andrius

View GitHub Profile
@zengxinhui
zengxinhui / convert2arch_x64.sh
Last active March 8, 2024 23:40
Replace Oracle Cloud Linux with Arch Linux remotely
[09/23/2023]
Refs:
1. http://mirror.cs.pitt.edu/archlinux/iso/2023.09.01/archlinux-bootstrap-2023.09.01-x86_64.tar.gz
2. https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/x86_64/alpine-virt-3.18.0-x86_64.iso
3. https://wiki.alpinelinux.org/wiki/Replacing_non-Alpine_Linux_with_Alpine_remotely
4. https://wiki.archlinux.org/index.php/installation_guide#Configure_the_system
See also:
1. Convert to Debian https://gist.github.com/zengxinhui/ee0ad6b7c7f99e2ead6cd0d2bd6641fd
@dusenberrymw
dusenberrymw / proxy.pac
Last active February 7, 2024 23:50
Proxy PAC file template for selective SSH SOCKS proxies, plus a [re]installation script.
// Proxy PAC File
// - Used to redirect certain addresses to the server through the SOCKS ssh port (1280 for this file), i.e.
// tunnel traffic through server.
// - Useful for easily accessing webpages from services running on a server (Jupyter notebooks, TensorBoard, Spark UI, etc.)
// that is otherwise locked down by a firewall.
// - To install on OS X/MacOS, go to "Settings->Network->Advanced->Proxies->Automatic Proxy Configuration"
// and paste the local file url (`file:///absolute/path/to/proxy.pac`).
// - Alternatively, use `./reinstall_proxy.sh`.
// - SSH to the server with `ssh -D 1280 ....`.
function FindProxyForURL(url, host) {
@kremalicious
kremalicious / tor-openvpn.sh
Last active February 25, 2024 07:40
Install and configure Tor as proxy for all OpenVPN server traffic
# what we want:
# client -> OpenVPN -> Tor -> Internet
# Install & configure OpenVPN
# https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04
# assumed OpenVPN configuration
# 10.8.0.1/24-Subnet
# tun0-Interface
@rtfpessoa
rtfpessoa / .config
Last active August 11, 2019 06:42 — forked from sit/gitproxy-socat
Wrappers around socat and netcat to use git behind a proxy
# Use netcat to proxy git ssh through a proxy.
# Useful if you are trying to clone ssh:// from inside a company.
#
# Save this file as `~/.ssh/config`
#
# See http://www.emilsit.net/blog/archives/how-to-use-the-git-protocol-through-a-http-connect-proxy/ for Emil Sit's original HTTP proxy script.
# See http://www.jones.ec/blogs/a/entry/using_git_through_a_socks/ for updated SOCKS version.
#
ProxyCommand nc -x 10.0.0.84:1986 %h %p
#!/bin/bash
usage ()
{
cat <<UsageHERE
boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host
Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT
or boot2docker-fwd -d RULE_NAME
or boot2docker-fwd -l
or boot2docker-fwd -A
@Fire-
Fire- / installDante.sh
Created October 3, 2014 19:53
Basic Dante Socks5 Server Setup and Configuration
# Basic Dante Socks5 Setup, Debian
apt-get update
apt-get install make gcc
cd /usr/src
# get newest from http://www.inet.no/dante/download.html
wget http://www.inet.no/dante/files/dante-1.4.1.tar.gz
@idleberg
idleberg / DropboxIgnore.md
Last active June 4, 2023 12:02
Ignore node_modules/bower_components folders in your Dropbox

This script scans your Dropbox (or any given folder) for folders stored in the ignore array and excludes them from syncing. Makes use of the official Dropbox CLI

I'm a beginner at bash, so all improvements are welcome!

#!/bin/bash

set -e

# SETTINGS
@padde
padde / SSH-Remote-Port-Forwarding.markdown
Last active September 8, 2022 06:03
SSH Remote Port Forwarding

!!! WIP !!!

SSH Remote Port Forwarding

TODO: intro

Provision Server

  • DigitalOcean
  • 512 MB RAM
@zenorocha
zenorocha / .hyper.js
Last active November 12, 2023 15:13 — forked from millermedeiros/osx_setup.md
Setup macOS Sierra (10.12)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active May 8, 2024 05:28
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost