Skip to content

Instantly share code, notes, and snippets.

View sitedata's full-sized avatar
🎯
Focusing

Larry Johnson sitedata

🎯
Focusing
View GitHub Profile
@mariodian
mariodian / btcpayserver.service
Last active October 12, 2022 11:27
BTCPayServer Systemd Service
[Unit]
Description=BtcPayServer daemon
Requires=btcpayserver.service
After=nbxplorer.service
[Service]
ExecStart=/usr/bin/dotnet run --no-launch-profile --no-build -c Release -p "/home/satoshi/source/btcpayserver/BTCPayServer/BTCPayServer.csproj" -- $@
User=satoshi
Group=satoshi
Type=simple
@sclaeys
sclaeys / response.json
Last active February 12, 2019 04:09
WEBZ.CC URL Shortener API response
// No errors
{
"error":0,
"short":"http:\/\/webz.cc\/DkZOb"
}
// An error has occurred
{
"error":1,
"msg":"Please enter a valid URL"
}
@sclaeys
sclaeys / api.php.php
Last active February 12, 2019 04:08
WEBZ.CC URL Shortener API PHP Request
<?php
// Using JSON Response
$api_url="http://webz.cc/api?key=APIKEY&url=THELONGURLTOBESHORTENED&custom=CUSTOMALIAS";
$res= @json_decode(file_get_contents($api_url),TRUE);
if($res["error"]){
echo $res["msg"];
}else{
echo $res["short"];
}
@sclaeys
sclaeys / Shortener.API.Function.php
Created July 13, 2018 00:03
Sample shortener API Function
<?php
define("SHORTENER_URL", "http://webz.cc");
define("SHORTENER_KEY", "123456789");
/**** Sample PHP Function ***/
function shorten($url, $custom = "", $format = "json") {
$api_url = SHORTENER_KEY."/api/?key=".SHORTENER_KEY;
$api_url .= "&url=".urlencode(filter_var($url, FILTER_SANITIZE_URL));
if(!empty($custom)){
@sclaeys
sclaeys / request.txt
Created July 12, 2018 23:45
Premium URL Shortener API Request
GET http://webz.cc/api?key=APIKEY&url=THELONGURLTOBESHORTENED&custom=CUSTOMALIAS

Keybase proof

I hereby claim:

  • I am radwebhosting on github.
  • I am rwh (https://keybase.io/rwh) on keybase.
  • I have a public key whose fingerprint is 128B 45D5 13AE 66AA B2BC 28F0 A817 08EE 5E7B 1B60

To claim this, I am signing this object:

#!/usr/bin/env bash -x
# Creates RAM disk.
#
# SYNOPSIS
# create_ramdisk [size [label]]
#
# OPTIONS
# size: RAM disk size in megabytes. Default: 1024
# label: RAM disk volume label. Default: UUID
@aedm
aedm / kickstart-ubuntu-docker-mongodb.sh
Last active November 17, 2022 11:57
Installs Docker & Nginx on Ubuntu 16.04, starts MongoDB container
#!/bin/sh
# curl {URL to this script} | sh -s
# install docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker
@jarek-przygodzki
jarek-przygodzki / iptables-reset.sh
Last active February 28, 2023 21:58
Reset iptables rules (IPv4, IPv6)
iptables -P INPUT ACCEPT && \
iptables -P FORWARD ACCEPT && \
iptables -P OUTPUT ACCEPT && \
iptables -F INPUT && \
iptables -F OUTPUT && \
iptables -F FORWARD && \
iptables -F && \
iptables -t nat -F && \
iptables -t mangle -F && \
iptables -X && \
@tankbar
tankbar / wp-google-tag-manager
Last active January 23, 2024 11:17
Add Google Tag Manager in WordPress with hooks and actions
<?php
/* ADD GTM TO HEAD AND BELOW OPENING BODY */
add_action('wp_head', 'google_tag_manager_head', 20);
function google_tag_manager_head() { ?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);