Skip to content

Instantly share code, notes, and snippets.

View jamiemtdwyer's full-sized avatar

Jamie Dwyer jamiemtdwyer

  • T.O.
View GitHub Profile

Project Zomboid Dedicated Server Guide

Ubuntu Server 20.04 LTS (64-bit)

1. Install steamcmd

 sudo add-apt-repository multiverse
 sudo dpkg --add-architecture i386
 sudo apt update
 sudo apt install lib32gcc1 steamcmd 
#!/bin/bash
# Connect to an RCON client listening on the port specified by RCON_PORT
RCON_DIR=~/rcon/
RCON_CONFIG_FILE=~/rcon/rcon.yaml
export RCON_PORT=27015
export PATH=$RCON_DIR:$PATH
echo "Waiting for RCON server on port ${RCON_PORT} to open..."
timeout 300 bash -c 'until echo > /dev/tcp/localhost/"${RCON_PORT}"; do sleep 0.5; done' 2>/dev/null

Project Zomboid - RCON client configuration (GNU/Linux)

  1. Download the RCON client from Github
root@vultr:~# cd ~
root@vultr:~# wget https://github.com/gorcon/rcon-cli/releases/download/v0.10.1/rcon-0.10.1-amd64_linux.tar.gz

NOTE: This URL is for example only, find the latest release for your architecture here

  1. Extract the tar archive in your home directory and rename the folder to rcon:
def get_all_inventory_levels():
get_inventory_levels(page_info: nil) # get first page of results
sleep 0.5 # naive approach to rate limiting
while is_next_page():
next_page_info = get_next_page_info()
get_inventory_levels(page_info: next_page_info)
sleep 0.5 # naive approach to rate limiting
from flask import Flask, request, abort
import hmac
import hashlib
import base64
app = Flask(__name__)
SECRET = 'hush'
def verify_webhook(data, hmac_header):
<?php
// Create a product:
$productData = array(
'product' => array(
'title' => "Shopify Logo T-Shirt",
'price' => 19.99));
$shopifyResponse = performShopifyRequest(
$shop, $accessToken, 'products', $productData, 'POST'
@jamiemtdwyer
jamiemtdwyer / get_access_token.php
Created January 19, 2018 22:24
Exchange authorization code
// Set variables for our request
$query = array(
"client_id" => $api_key, // Your API key
"client_secret" => $shared_secret, // Your app credentials (secret key)
"code" => $params['code'] // Grab the access key from the URL
);
// Generate access token URL
$access_token_url = "https://" . $params['shop'] . "/admin/oauth/access_token";
// Set variables for our request
$shared_secret = "TBB5wltKarRtKn5mUVZck9RxHePNN6Jo";
$params = $_GET; // Retrieve all request parameters
$hmac = $_GET['hmac']; // Retrieve HMAC request parameter
$params = array_diff_key($params, array('hmac' => '')); // Remove hmac from params
ksort($params); // Sort params lexographically
// Compute SHA256 digest
$computed_hmac = hash_hmac('sha256', http_build_query($params), $shared_secret);
http://localhost/generate_token.php?code=6a94694acf0339e9eb8068d8f4718eea&hmac=710205c27e7f780b0cd7ee58146388094be1b9e4762e3752840d1de21deeac5d&shop=johns-apparel.myshopify.com&timestamp=1516399193
<?php
// Set variables for our request
$shop = $_GET['shop'];
$api_key = "1r30mrvCFMfq2DLGuIXyY2veEJVgTtDD";
$scopes = "read_orders,write_products";
$redirect_uri = "http://localhost/generate_token.php";
// Build install/approval URL to redirect to
$install_url = "https://" . $shop . ".myshopify.com/admin/oauth/authorize?client_id=" . $api_key . "&scope=" . $scopes . "&redirect_uri=" . urlencode($redirect_uri);