Skip to content

Instantly share code, notes, and snippets.

View TCB13's full-sized avatar
😎

Tadeu Bento TCB13

😎
View GitHub Profile
@ksverdlov
ksverdlov / boot_alert.sh
Last active November 1, 2024 19:04 — forked from joshspicer/boot_alert.sh
[OpenWrt] Telegram alert when a new wireless device associates with access point. (http://spcr.me/openwrt-alert)
#!/bin/sh
# Alerts via telegram after OpenWRT reboot, start monitoring and list of currently connected wireless devices.
# write-up at: spcr.me/openwrt-alert
# Some modifications: https://gist.github.com/ksverdlov/33a26fed4c4413171171de86ba59c74f
# ~ note ~
# Call from in /etc/rc.local
APIKEY=<YOUR_BOT_API_KEY_HERE>
@Duckle29
Duckle29 / Persistent reverse SSH tunnel.md
Last active September 30, 2024 04:56
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:
#
@patrocle
patrocle / Chroot SFTP user with www-data rights.md
Last active October 10, 2024 16:37
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  
@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