Skip to content

Instantly share code, notes, and snippets.

View eliskvitka's full-sized avatar
🏳️‍⚧️
Trans rights are human rights!

Elis Kvitka eliskvitka

🏳️‍⚧️
Trans rights are human rights!
  • Ukraine
  • 11:58 (UTC +03:00)
View GitHub Profile

Custom data pack structures in 1.18.2

This guide will showcase how to create a data pack that adds a custom structure to the world. There is also a data pack download of this complete example.

Always leave the world and rejoin to apply the new changes!

Pack.mcmeta

Like every data pack, we need a pack.mcmeta. In this version, the pack format is 9!

{
@eliskvitka
eliskvitka / mongo_drop_user_from_notexisteddb.js
Created September 29, 2021 08:02
[mongodb] Delete user from system collection if user database doesn't exist. Use it from mongoshell
var users = db.system.users.distinct("_id")
var dbs = db.getMongo().getDBNames()
users.forEach( function(uid) {
var dbname = uid.split(".")[0]
if (dbs.includes(dbname)) {
print(dbname + " exist")
} else {
db.getMongo().getDB(dbname).dropUser("dev_user")
}
})
@eliskvitka
eliskvitka / es_unblock_indexes.sh
Created September 2, 2021 07:35
[Elasticsearch] Disable read-only mode after high disk watermark reached
#!/bin/bash
curl http://localhost:9200/_all/_settings -H "Content-type: application/json" -XPUT --data '{"index": {"blocks.read_only_allow_delete": null}}'
curl http://localhost:9200/_all/_settings -H "Content-type: application/json" -XPUT --data '{"index": {"blocks.read_only": false}}'
@eliskvitka
eliskvitka / jenkins_lib_example.groovy
Created September 2, 2021 07:30
[Jenkins] Jenkins Shared Library example usage from scripted pipeline
#!/usr/bin/env groovy
@Library('devopslib')
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
import spv.devops.*
// Create shared library instance with jenkins `steps` object
def utils = new Utils(this)
node {
@eliskvitka
eliskvitka / jenkins_build.groovy
Created September 2, 2021 07:20
[Jenkins] Build all jobs in folder from script console
#!/usr/bin/env groovy
def folderName = "backend/mp_back"
def folderJobs = Jenkins.instance.getItemByFullName(folderName)
folderJobs.items.each { job ->
job.scheduleBuild2(5)
}