Skip to content

Instantly share code, notes, and snippets.

@nealfennimore
nealfennimore / wireguard.conf
Last active January 29, 2025 10:57
Wireguard VPN - Forward all traffic to server
# ------------------------------------------------
# Config files are located in /etc/wireguard/wg0
# ------------------------------------------------
# ---------- Server Config ----------
[Interface]
Address = 10.10.0.1/24 # IPV4 CIDR
Address = fd86:ea04:1111::1/64 # IPV6 CIDR
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Add forwarding when VPN is started
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE # Remove forwarding when VPN is shutdown
// ==UserScript==
// @name Abema 区域限制
// @version 1.0.0
// @run-at document-end
// @namespace Violentmonkey Scripts
// @match https://abema.tv/*
// @grant none
// ==/UserScript==
Object.defineProperty(__CLIENT_REGION__, 'isAllowed', {
get: () => true
@longbill
longbill / wxcrypto.js
Last active March 4, 2022 08:43
微信公众号消息加密解密nodejs模块
const crypto = require('crypto');
const debug = require('debug')('wxcrypto');
/**
* 微信公众号消息加密解密,支持 node > 8.0
*
* var WXCrypto = require('this module');
* var wx = new WXCrypto(token, aesKey, appid);
*
* var [err, encryptedXML] = wx.encrypt(xml, timestamp, nonce);
@venkyvb
venkyvb / ODataReadMetadata.py
Created November 1, 2015 02:21
Python OData Read Metadata
import urllib2, base64
username = "user_name_here"
password = "password_here"
request = urllib2.Request("https://myNNNNNN.crm.ondemand.com/sap/c4c/odata/v1/c4codata/$metadata")
base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
request.add_header("Authorization", "Basic %s" % base64string)
result = urllib2.urlopen(request)
content = result.read()
@bajanReece
bajanReece / gist:5186538
Last active February 26, 2016 01:43
How to programatically create new content with Concrete5
<?php
$my_page_type = 'php_news';
$parent_path = '/languages/php/news';
$hide_from_nav = TRUE;
$parent = Page::getByPath($parent_path);
/**
* Let's pretend the title and description have been set by POST values
* and added to the variables $title, $description and $content
@borisguery
borisguery / wssetoken.php
Created September 27, 2012 08:19
WsseToken generator for curl
#!/usr/bin/env php
<?php
function wsse_header($username, $password) {
$nonce = hash_hmac('sha512', uniqid(null, true), uniqid(), true);
$created = new DateTime('now', new DateTimezone('UTC'));
$created = $created->format(DateTime::ISO8601);
$digest = sha1($nonce.$created.$password, true);
return sprintf(