sudo add-apt-repository multiverse
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install lib32gcc1 steamcmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
- 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
- Extract the tar archive in your home directory and rename the folder to
rcon
:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, abort | |
import hmac | |
import hashlib | |
import base64 | |
app = Flask(__name__) | |
SECRET = 'hush' | |
def verify_webhook(data, hmac_header): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Create a product: | |
$productData = array( | |
'product' => array( | |
'title' => "Shopify Logo T-Shirt", | |
'price' => 19.99)); | |
$shopifyResponse = performShopifyRequest( | |
$shop, $accessToken, 'products', $productData, 'POST' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://localhost/generate_token.php?code=6a94694acf0339e9eb8068d8f4718eea&hmac=710205c27e7f780b0cd7ee58146388094be1b9e4762e3752840d1de21deeac5d&shop=johns-apparel.myshopify.com×tamp=1516399193 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
NewerOlder