Skip to content

Instantly share code, notes, and snippets.

View zeroc0d3's full-sized avatar
🎯
Building Awesome TFO (TelemetryFlow Observability)

Dwi Fahni Denni (dfdenni) zeroc0d3

🎯
Building Awesome TFO (TelemetryFlow Observability)
View GitHub Profile
@zeroc0d3
zeroc0d3 / mysql_bigfile.txt
Last active April 4, 2020 01:20
Dump MySQL & MariaDB Big File
$ mysql -u root -p
SET global net_buffer_length=1048576; --Set network buffer length to a large byte number
SET global max_allowed_packet=1073741824; --Set maximum allowed packet size to a large byte number
SET foreign_key_checks = 0; --Disable foreign key checking to avoid delays,errors and unwanted behaviour
source file.sql --Import your sql dump file
SET foreign_key_checks = 1; --Remember to enable foreign key checks when procedure is complete!
@zeroc0d3
zeroc0d3 / mysql-docker.sh
Created April 4, 2020 00:41 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@zeroc0d3
zeroc0d3 / bootstrap-4-sass-mixins-cheat-sheet.scss
Created March 22, 2020 01:41 — forked from anschaef/bootstrap-4-sass-mixins-cheat-sheet.scss
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.4.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12;
$grid-gutter-width: 30px;
@zeroc0d3
zeroc0d3 / benchmark-commands.md
Created March 6, 2020 06:41 — forked from ueokande/benchmark-commands.md
Kafka Benchmark Commands

Benchmark commands

Producer

Setup

bin/kafka-topics.sh \
  --zookeeper zookeeper.example.com:2181 \
  --create \

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@zeroc0d3
zeroc0d3 / README.md
Created February 9, 2020 03:53 — forked from justincjahn/README.md
Minecraft server(s) using systemd and screen.

Install

# Install dependencies
sudo yum install -y java-1.8.0-openjdk screen

# Create a new unprivileged user for minecraft
useradd -r -m -d /opt/minecraft minecraft

# Create the directory that will house our minecraft instances

sudo su --shell /bin/bash minecraft

@zeroc0d3
zeroc0d3 / proxvm.sh
Created January 27, 2020 23:20 — forked from huksley/proxvm.sh
Get list of all virtual machines on proxmox 4+, both LXC and QEMU and detect IP addresses
#!/bin/bash
# proxvm
# Output in specifed format (default csv) all virtual machines on proxmox 4+
SERVER=localhost
USERNAME=apiread@pve
PASSWORD=123456
FORMAT=csv
while [[ $# > 0 ]]; do
key="$1"
public function index(Request $request)
{
$sortBy = 'id';
$orderBy = 'desc';
$perPage = 20;
$q = null;
if ($request->has('orderBy')) $orderBy = $request->query('orderBy');
if ($request->has('sortBy')) $sortBy = $request->query('sortBy');
if ($request->has('perPage')) $perPage = $request->query('perPage');
#!/usr/bin/env sh
# ================================================================================================
# INSTALL GOLANG
# ================================================================================================
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --no-install-recommends \
g++ \
@zeroc0d3
zeroc0d3 / docker-compose.yml
Last active February 13, 2024 13:53
Swarmpit for Play With Docker (PWD)
version: '3.5'
services:
app:
image: swarmpit/swarmpit:latest
environment:
- VERSION=${DOCKER_VERSION:-19.03.2}
- SWARMPIT_DB=http://db:5984
- SWARMPIT_INFLUXDB=http://influxdb:8086
- INTERACTIVE=0