Skip to content

Instantly share code, notes, and snippets.

@Pisi-Deff
Pisi-Deff / regiongrid.js
Last active November 9, 2023 17:25
Dynmap RegionGrid component
componentconstructors['regiongrid'] = function(dynmap, configuration) {
// var cfg = $.extend({}, configuration);
var me = this;
this.chunkGroup = new L.LayerGroup();
this.regionGroup = new L.LayerGroup();
this.chunkMarkers = [];
this.regionMarkers = [];
@aaroncoffey
aaroncoffey / Puppet_6.3_Raspbian.md
Last active April 22, 2023 15:08
How to get puppet 6.3 up and running on a raspberry pi running Raspbian

How to get puppet 6.3 up and running on a raspberry pi running raspbian.

These instructions were tested on a pi 3 with the latest version of raspbian (Raspbian GNU/Linux 9.8 (stretch)).

This guide assumes basic competency with the command line. It also assumes you have a functional puppet master set up with the hostname of puppet. If you can ping puppet, you should be all set. Also note that I am just getting into puppet and am not a master of this domain. There may be errors, and there is probably a better way to do this, but in my searching, I was unable to locate a good set of instructions to get this working, so here we are. Feel free to contact me for corrections.

You can either switch to root sudo -i, or prepend all the following commands with sudo.

Update first

apt update
@peteristhegreat
peteristhegreat / freedesktop.org_icons_with_descriptions.txt
Last active December 26, 2023 19:28
QIcon::fromTheme, List of icons in gnome theme, in qt standardPixmaps and list on freedesktop.org
# https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html, aggregate list from each section
address-book-new The icon used for the action to create a new address book.
application-exit The icon used for exiting an application. Typically this is seen in the application's menus as File->Quit.
appointment-new The icon used for the action to create a new appointment in a calendaring application.
call-start The icon used for initiating or accepting a call. Should be similar to the standard cellular call pickup icon, a green handset with ear and mouth pieces facing upward.
call-stop The icon used for stopping a current call. Should be similar to the standard cellular call hangup icon, a red handset with ear and mouth pieces facing downward.
contact-new The icon used for the action to create a new contact in an address book application.
document-new The icon used for the action to create a new document.
document-open The icon used for the action to open a document.
document-open-recent T
@dayreiner
dayreiner / log-all-zsh-bash-commands-syslog.md
Last active January 14, 2024 23:40
Log all users zsh / bash commands via syslog without 3rd-party tools or auditd

Sending Bash and ZSH Commands to Syslog

Also posted here: http://18pct.com/sending-bash-and-zsh-commands-to-syslog/

Your bash/zsh history is great if its complete, but it doesn't capture commands across all users, sudo's, root commands etc. In particular with test environments, someone may perform a "one-off" procedure and then months later it needs to be repeated. It would be nice to be able to look up what the user did at the time, and searching through multiple, possibly truncated history files is a pain.

Tools like typescript are great if you're actively documenting, but not something you would use all the time in practice and capture more than just a history of your commands. There are third-party tools like rootsh and Snoopy that can accomplish this, but third-party tools can be overkill if all you want is a quick reference in a re

@Jikoo
Jikoo / Experience.java
Last active May 10, 2024 15:32
A utility for managing experience with Bukkit.
package com.github.jikoo.planarwrappers.util;
import org.bukkit.entity.Player;
/**
* A utility for managing player experience.
*/
public final class Experience {
/**
@manifestinteractive
manifestinteractive / sniff.txt
Last active November 23, 2023 02:16
A friendly formatter for curl requests to help with debugging.
\n
============= HOST: ==========\n
\n
local_ip: %{local_ip}\n
local_port: %{local_port}\n
remote_ip: %{remote_ip}\n
remote_port: %{remote_port}\n
\n
======= CONNECTION: ==========\n
\n
@TiZ-HugLife
TiZ-HugLife / conky-toggle
Created March 27, 2015 19:29
conky-toggle
#!/bin/bash
if [[ "$(cat /tmp/.conkystate)" = "above" ]]; then
STATE="below"
REMOVE="above"
else
STATE="above"
REMOVE="below"
fi
echo $STATE > /tmp/.conkystate
@diasjorge
diasjorge / partman.cfg
Last active August 3, 2020 14:14
Partman example using lvm
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/device_remove_lvm_span boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-auto-lvm/new_vg_name string system
d-i partman-lvm/confirm boolean true
d-i partman/alignment string "optimal"
d-i partman-auto-lvm/guided_size string max
@gambrell
gambrell / logstash-remove-nulls.conf
Created March 19, 2015 13:47
Logstash filter to remove embedded NULL characters
# Logstash filter to remove embedded NULL characters
filter {
mutate {
gsub => [
# Replace all NULL characters empty string. Do this to the message field first which will apply to all fields instead of specifying individual fields.
"message", "[\u0000]", ""
]
}
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active February 27, 2024 10:15
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})