Skip to content

Instantly share code, notes, and snippets.

@spike77453
spike77453 / Asset.sh
Created September 15, 2025 14:36 — forked from JoeyBurzynski/Asset.sh
Bash Scripting: Check if a Bash Variable Has Been Set (Or Is Empty String)
# How to determine if a bash variable is empty?
# A variable in bash (and any POSIX-compatible shell) can be in one of three states:
#
# unset
# set to the empty string
# set to a non-empty string
# Most of the time you only need to know if a variable is set to a non-empty string, but occasionally it's important to distinguish between unset and set # to the empty string.
#
@spike77453
spike77453 / bash_strict_mode.md
Created August 11, 2025 08:07 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@spike77453
spike77453 / ConnectX_encryption_support.md
Created June 30, 2025 17:45 — forked from Chester-Gillon/ConnectX_encryption_support.md
Notes about encryption support in Mellanox ConnectX adapters

0. Introduction

Contains notes about encryption support in Mellanox ConnectX adapters.

With a ConnectX-4 Lx or ConnectX-5 noticed that the ethtool statistics had some counters with tls in their names, so wasn't sure if that meant the adapters has hardware offload support for encryption.

1. Mellanox product highlights

Starting at ConnectX SmartNICs and looking at the product features:

  1. ConnectX-4 Lx says ENCRYPTION N/A
@spike77453
spike77453 / 00-serial-console.md
Created June 27, 2025 01:22 — forked from lukasnellen/00-serial-console.md
kvm serial console for virtual machine

Serial console for KVM based VM and IPMI serial channel

grub and kernel console

Set in /etc/default/grub:

...
###GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,115200n8 console=tty1"
GRUB_CMDLINE_LINUX=""
@spike77453
spike77453 / git-user-stats
Created June 13, 2025 15:16 — forked from shitchell/git-user-stats
Show user stats in a git repo
#!/bin/bash
#
# Show user stats (commits, files modified, insertions, deletions, and total
# lines modified) for a repo
git_log_opts=( "$@" )
git log "${git_log_opts[@]}" --format='author: %ae' --numstat \
| tr '[A-Z]' '[a-z]' \
| grep -v '^$' \
@spike77453
spike77453 / 2serv.py
Created April 6, 2024 20:30 — forked from phrawzty/2serv.py
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@spike77453
spike77453 / java_download.sh
Created April 2, 2024 08:58 — forked from wavezhang/java_download.sh
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@spike77453
spike77453 / resize_disk_image.md
Created February 20, 2024 15:00 — forked from joseluisq/resize_disk_image.md
How to resize a qcow2 disk image on Linux

How to resize a qcow2 disk image on Linux

This example takes olddisk.qcow2 and resizes it into newdisk.qcow2, extending one of the guest's partitions to fill the extra space.

1. qcow2 format

1.1. Verify the filesystems of olddisk.qcow2

@spike77453
spike77453 / krb5_ccache.py
Created July 6, 2023 10:46 — forked from cluther/krb5_ccache.py
Python module for reading krb5 credential cache files.
#!/usr/bin/env python
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2013, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################
@spike77453
spike77453 / hfsc-shape.sh
Created December 16, 2022 10:24 — forked from eqhmcow/hfsc-shape.sh
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.