Skip to content

Instantly share code, notes, and snippets.

View u9g's full-sized avatar
💯
on my grind!

u9g

💯
on my grind!
View GitHub Profile
@u9g
u9g / create_service.sh
Created March 2, 2019 01:24 — forked from DashLt/create_service.sh
Quickly make 100 service accounts and generate keys for them
#!/bin/bash
# requires gcloud command line tools; go to https://cloud.google.com/sdk/docs/quickstarts to get them
# max 100 service accounts per project
# run gcloud init --console-only first and select a project
KEYS_DIR=keys
for name in service{1..100}; do echo $name; done | parallel --citation -j100 gcloud iam service-accounts create {}
for name in $(gcloud iam service-accounts list --format='value(email)'); do echo $name; done | parallel --citation -j100 gcloud iam service-accounts keys create $KEYS_DIR/{}.json --iam-account={}
@u9g
u9g / create_service.sh
Created March 5, 2019 02:32 — forked from The-OMG/create_service.sh
Small script for creating Google Cloud Service Accounts
#!/bin/bash
# requires gcloud command line tools
# go to https://cloud.google.com/sdk/docs/quickstarts to get them OR you can install with Node (npm) "npm install --save -g @google-cloud/cloud-sdk"
# max 100 service accounts per project
# run "gcloud init --console-only" first and select a project; run it again to select another project to create more service accounts
# Location of where service account keys will be created
KEYS_DIR=keys
@u9g
u9g / patch.js
Created March 5, 2021 22:02
Add altening support to mineflayer
const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
authServer: 'http://authserver.thealtening.com',
sessionServer: 'http://sessionserver.thealtening.com',
host: 'localhost',
port: 25565,
username: 'TOKEN',
password: '12345678',
version: false
@u9g
u9g / chat.js
Last active March 6, 2021 05:12
logs chat but good
const { escapeMarkdown, sendDiscordMessage } = require('./util')
const fs = require('fs')
const path = require('path')
const fileName = path.join('logs', `${new Date(Date.now()).toLocaleDateString().replace(/\//g, '_')}.json`)
let data = {}
function start (bot, client) {
bot.once('spawn', async () => {
data = await getData()
setInterval(write, 10000)
{
"collected": [
"login",
"custom_payload",
"difficulty",
"abilities",
"held_item_slot",
"declare_recipes",
"tags",
"entity_status",
@u9g
u9g / dump.yml
Last active April 15, 2021 12:53
GH Workflow to decompile MC (put both files in .github/workflows/)
name: Dump
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
@u9g
u9g / example_simple_item.json
Created July 2, 2021 22:02
example simple-item
{
"slot": 10,
"count": 1,
"nbt": {
"ench": [
{
"lvl": 5,
"id": 16
},
{
@u9g
u9g / text.md
Last active August 15, 2021 05:03
Info about window updates in 1.17+

What's new in 1.17+

No more transaction packets, and no Action Ids. Also, the window click packet has a changed slots parameter and a clicked item parameter. The changed slots parameter is what the slots look like after they have changed. The clicked item is what's on your cursor after the click is done.

What is StateId

StateId is a variable in the client that should be replaced with the stateid from a set slot packet or window items packet every time one is received, then should be sent as part of the window click packet. StateId is only used in 1.17.1+.

Windows with a function (enchanting tables, furnaces, etc)

This file has been truncated, but you can view the full file.
[{"name":"Sheet 1","rows":1,"cells":{"A0":{"kind":"LiteralString","value":"44609","type":"Numeric","type_metadata":{"length":-1,"format":null,"alignment":"CenterRight"},"conditional_formats":[],"evaluated_formats":{}},"A1":{"kind":"LiteralString","value":"45281","type":"Numeric","type_metadata":{"length":-1,"format":null,"alignment":"CenterRight"},"conditional_formats":[],"evaluated_formats":{}},"A2":{"kind":"LiteralString","value":"29856","type":"Numeric","type_metadata":{"length":-1,"format":null,"alignment":"CenterRight"},"conditional_formats":[],"evaluated_formats":{}},"A3":{"kind":"LiteralString","value":"25210","type":"Numeric","type_metadata":{"length":-1,"format":null,"alignment":"CenterRight"},"conditional_formats":[],"evaluated_formats":{}},"A4":{"kind":"LiteralString","value":"41231","type":"Numeric","type_metadata":{"length":-1,"format":null,"alignment":"CenterRight"},"conditional_formats":[],"evaluated_formats":{}},"A5":{"kind":"LiteralString","value":"38873","type":"Numeric","type_metadata":{"le