Skip to content

Instantly share code, notes, and snippets.

@hiphopsmurf
hiphopsmurf / openvpncloudlared.txt
Created February 11, 2025 01:03 — forked from rameshkrishna/openvpncloudlared.txt
OpenVPN with Cloudflared Tunnels - No Port Fowarding - No Static IP - NO DDNS
Task:
Access OpenVPN or any Service on Home Network from Public Networks (Hotel) without configuring router and without static IP
Step 1:
Install OpenVPN on any device connected to Home Network (Raspberry mychoice with pivpn)
- Change default OpenVPN protocol from UDP to TCP (Cloudflare doesn't support UDP)
- Make a note of TCP port number (default is 443)
- Grab the OpenVPN client config file
Step 2:
Install Cloudflared on Raspberry PI
- Create a tunnel
@hiphopsmurf
hiphopsmurf / alpine-user.Dockerfile
Created June 23, 2023 16:21 — forked from utkuozdemir/alpine-user.Dockerfile
A gist to add a user to the Alpine docker image
FROM alpine:3
ENV USER_ID=65535
ENV GROUP_ID=65535
ENV USER_NAME=rsync-user
ENV GROUP_NAME=rsync-user
RUN addgroup -g $GROUP_ID $GROUP_NAME && \
adduser --shell /sbin/nologin --disabled-password \
--no-create-home --uid $USER_ID --ingroup $GROUP_NAME $USER_NAME
@hiphopsmurf
hiphopsmurf / pageant-startup-script.bat
Created January 22, 2020 17:41
Pageant Batch File for loading keys on startup
@ECHO off
REM Program : Pageant Key Loader
REM Author : Lee Robert
REM Description : Automatically loads specified private keys into
REM pageant on execution
REM =============================================================
REM
REM Add a private key
IF EXIST "C:\path\to\your\key.ppk" (SET KEYS=%KEYS% "C:\path\to\your\key.ppk")
IF EXIST "C:\path\to\your\key2.ppk" (SET KEYS=%KEYS% "C:\path\to\your\key2.ppk")
// Extend jQuery addClass function to accept callback function
var oAddClass = $.fn.addClass;
$.fn.addClass = function () {
for (var i in arguments) {
var arg = arguments[i];
if ( !! (arg && arg.constructor && arg.call && arg.apply)) {
arg();
delete arg;
}
}
@hiphopsmurf
hiphopsmurf / delete-events-before-import.php
Created April 2, 2019 16:48 — forked from andrasguseo/delete-events-before-import.php
Event Aggregator - delete events before import
<?php
/**
* Created by PhpStorm.
* Plugin Name: Berean Baptist Church Calendar Import Fixer
* Description: Forces removal of events no longer represented in the imported calendar.
* Version: 0.0.1
* Author: Steve Dwire for Berean Baptist Church
* Author URI: https://www.berean-baptist.org/
* License: GPLv2
*/
@hiphopsmurf
hiphopsmurf / ifcfg-he-ipv6
Created December 15, 2018 07:09 — forked from briancline/ifcfg-he-ipv6
HE.net IPv6 Tunnel Broker - CentOS/RHEL/Fedora NIC config
DEVICE="he-ipv6"
DEVICETYPE=sit
BOOTPROTO=none
ONBOOT=yes
IPV6INIT=yes
IPV6TUNNELIPV4=184.105.253.10
IPV6TUNNELIPV4LOCAL=XXX.XXX.XXX.XXX
IPV6ADDR=2001:470:YYYY:YYYY::2/64
IPV6_DEFAULTGW=2001:470:YYYY:YYYY::1
@hiphopsmurf
hiphopsmurf / Dockerfile
Created December 7, 2018 06:24 — forked from bsod90/Dockerfile
Centos 7 with Systemd Dockerfile
FROM centos:7
MAINTAINER "orion" <[email protected]>
# Steps needed to use systemd enabled docker containers.
# Reference: https://hub.docker.com/_/centos/
ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
@hiphopsmurf
hiphopsmurf / digitalocean-centos-wordpress.sh
Created May 31, 2018 16:36 — forked from reitermarkus/digitalocean-centos-wordpress.sh
Install WordPress on DigitalOcean CentOS Droplet with PHP 7
#!/bin/sh
DATABASE_NAME='wordpress'
DATABASE_USER='wordpress'
ROOT_MYSQL_PASSWORD=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev`
WORDPRESS_MYSQL_PASSWORD=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev`
# Write Passwords to File.
@hiphopsmurf
hiphopsmurf / heartbeat-api-demo.php
Created March 22, 2018 04:53 — forked from strangerstudios/heartbeat-api-demo.php
Minimal example demonstrating the WordPress Heartbeat API being added in WP version 3.6.
<?php
/*
Plugin Name: Heartbeat API Demo
Plugin URI: http://www.strangerstudios.com/wp/heartbeat-api-demo
Description: Minimal example demonstrating the WordPress Heartbeat API being added in WP version 3.6.
Version: .1
Author: strangerstudios
If logged in as a user and viewing the frontend of your website,
every 15 seconds you should see the following in your Javascript console:
/**
* Redirect WordPress front end https URLs to http without a plugin
*
* Necessary when running forced SSL in admin and you don't want links to the front end to remain https.
*
* @link http://blackhillswebworks.com/?p=5088
*/
add_action( 'template_redirect', 'bhww_ssl_template_redirect', 1 );