Skip to content

Instantly share code, notes, and snippets.

View TCB13's full-sized avatar
😎

Tadeu Bento TCB13

😎
View GitHub Profile
@Duckle29
Duckle29 / Persistent reverse SSH tunnel.md
Last active October 8, 2023 18:53
A systemd service file to ensure a persistent reverse SSH tunnel is active

Persistent reverse-ssh-tunnel systemd unit

This unit file, if enabled on boot, will attempt to connect to a remote server and establish a reverse tunnel. It uses StrictHostKeyChecking=accept-new for the ssh connection, so if you want to make sure the host you're connecting to is the right one, carry out the first connection manually and check the key.

REMOTE is considered a remote server that's available over ssh
LOCAL is considered the device initiating the remote tunnel. This will likely be a device dropped behind a NAT with no option of portforwarding

To use it, copy this multiline command somewhere to edit the configs and run it as root on the device:

@mzpqnxow
mzpqnxow / build-ecryptfs-debian-buster.sh
Last active December 10, 2021 20:57
Build ecryptfs-utils from source on Debian 10
#!/bin/bash
set -e
#
# As of 11/24/2019, Debian still can't get it together with ecryptfs-utils so there
# is no longer an ecryptfs-utils in the apt repositories, removing the ability for
# a user to use ecryptfs at all, unless they build from source and manually configure
# the system
#
# Before using this, please see the status of the bugreport:
#
@meganlkm
meganlkm / laravel5_shared_hosting_project.sh
Last active January 3, 2019 19:49
setup a laravel5 project to deploy to a shared hosting provider
#!/bin/bash
myproject='myproject'
mywww='public_html'
# initialize project
composer create-project laravel/laravel $myproject --prefer-dist
cd $myproject
# fix paths to public
@patrocle
patrocle / Chroot SFTP user with www-data rights.md
Last active December 11, 2018 23:11
SFTP MYUSER will have all rights to create files/folders with www-data as owner and group in /var/www

Debian tips to chroot a user in it's home and add rights for www-data

STEP 1

sudo apt-get -y install bindfs

STEP 2

sudo mkdir -p /home/MYUSER/www
sudo chown -Rf MYUSER:MYUSER /home/MYUSER/www