Skip to content

Instantly share code, notes, and snippets.

View zeushammer's full-sized avatar
😃
Contributing to Open Source!

Andrew Gerhold zeushammer

😃
Contributing to Open Source!
View GitHub Profile
echo "something==" | base64 -d | zstd -d | cat
echo -e '\x1dclose\x0d' | telnet google.com 80
import random, math
def output_card_value(card_value):
if card_value > 1 and card_value < 11:
print(card_value)
elif card_value == 11:
print("Jack")
elif card_value == 12:
print("Queen")
elif card_value == 13:
[
{
"id": "699af9de.c896a8",
"type": "location",
"z": "22a7d869.b5f338",
"parameters": {
"location": "api-request-response",
"target": "",
"info": ""
},
cashPayment = 45000
amountTendered = 100000
changeDue = amountTendered – cashPayment
print("Cash payment amount: ", cashPayment)
print("Tendered amount: ", amountTendered)
print("Change due: ", changeDue)
hundredThousands = changeDue / 100000;
hundredThousands = int(hundredThousands)
If you use SSH to connect to remote Linux servers, you'll notice that if you keep your SSH session inactive for some time and then try to use it again, the SSH session disconnects with an error message like this:
:client_loop: send disconnect: Broken pipe
On some systems, it will display 'Write failed: Broken pipe' or 'Connection closed by remote host'.
Let's see what causes this error and how to go about keeping your SSH connection alive.
Fixing broken pipe error with SSH
As you may have guessed, the SSH connection is closed because of inactivity. There is no set value but it usually around 5 minutes or so.
[
{
"id": "c78b305a.d4fc48",
"type": "tab",
"parameters": {
"label": "CounterComponent",
"disabled": false,
"info": ""
},
"is_user_parameter": {},
@zeushammer
zeushammer / gist:a2cfd961c242bee861e3ea1e387eebde
Created August 10, 2022 20:35 — forked from LarsFronius/gist:e579051d7f140fd803b0
If you ever want to debug a kinesis stream, copy this bash one liner.
On a mac, `brew install awscli gnu-sed` before.
streamname=staging;aws kinesis describe-stream --stream-name $streamname --output text | grep SHARDS | awk '{print $2}' | while read shard; do aws kinesis get-shard-iterator --stream-name $streamname --shard-id $shard --shard-iterator-type LATEST --output text | while read iterator; do while output=`aws kinesis get-records --shard-iterator $iterator --output text`; do iterator=`echo "$output" | head -n1`; echo "$output" | gsed 1d | grep RECORDS | while read record; do echo $record | awk '{print $2}' | base64 -D; done; done; done; done
//CUSTOMIZER VARIABLES
// The number of columns in the tray.
number_of_columns = 10; // [1:20]
// The number of rows in the tray.
number_of_rows = 5; // [1:20]
// The diameter of each tray hole in mm.
diameter = 10.2;
#!/usr/local/bin/python3
import requests,json,getpass
import sys,os
import certifi,urllib3
def post_request(target_url,dataobj=None,headerobj=None):
if headerobj==None:
response = requests.post(target_url,data=json.dumps(dataobj),timeout=5, verify=True)
elif dataobj==None: