Skip to content

Instantly share code, notes, and snippets.

View xealits's full-sized avatar
🥘

Alex Toldaiev xealits

🥘
View GitHub Profile
@Sharpie
Sharpie / README.md
Last active May 17, 2024 16:42
Metric Scraping Scripts

This gist contains various scripts for scraping metrics. Mostly useful for processing the contents of Puppet Enterprise support bundles:

  • sar2influx.rb: A Ruby script that uses sadf to turn SAR archives into InfluxDB line format. For best results, run from a Linux VM using a recent operating system. Such as Ubuntu 22.04.
  • pdb2influx.sh: A bash script that uses awk and mlr to extract command processing times from puppetdb.log files.
  • top-api-calls.sh: Extracts the 10 most popular API calls from *-access.log along with their median and max duration grouped into 30 minute periods (Puppet $runinterval). Uses awk and mlr.
@prasadwrites
prasadwrites / queueUse.cpp
Created October 22, 2019 20:37
TBB concurrent queue example
#include <tbb/concurrent_queue.h>
#include <tbb/concurrent_priority_queue.h>
#include <iostream>
int array[10] = { 0,11,22,33,44,55,66,77,88,99 };
# This is heavily based in the code here:
# https://gist.github.com/enpassant/0496e3db19e32e110edca03647c36541
# Special thank you to the user enpassant for starting it https://github.com/enpassant
#!/bin/bash
SYNTAX="$2"
EXTENSION="$3"
OUTPUTDIR="$4"
INPUT="$5"
@githubfoam
githubfoam / Mellanox OFED cheat sheet
Last active November 23, 2024 17:55
Mellanox OFED cheat sheet
--------------------------------------------------------------------------
# ofed_info -s
--------------------------------------------------------------------------
Find Mellanox Adapter Type and Firmware/Driver version
ConnectX-4 card
# lspci | grep Mellanox
0a:00.0 Network controller: Mellanox Technologies MT27500 Family [ConnectX-3]
# lspci -vv -s 0a:00.0 | grep "Part number" -A 3
# lspci | grep Mellanox | awk '{print $1}' | xargs -i -r mstvpd {}
@Neo23x0
Neo23x0 / audit.rules
Last active November 21, 2024 14:24
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@oltolm
oltolm / ptrmath.nim
Last active February 25, 2024 19:17
Nim pointer arithmetic
# from https://forum.nim-lang.org/t/1188#7366 by Jehan
# most of the time only the dereference operator is needed, import it like this:
# from ptrmath import `[]`
template `+`*[T](p: ptr T, off: int): ptr T =
cast[ptr type(p[])](cast[ByteAddress](p) +% off * sizeof(p[]))
template `+=`*[T](p: ptr T, off: int) =
p = p + off
@akatrevorjay
akatrevorjay / git-fshow
Last active May 19, 2024 01:39 — forked from junegunn/gist:f4fca918e937e6bf5bad
Browsing git commit history with fzf
#!/bin/zsh
# git-fshow - git commit browser
#
# https://gist.github.com/akatrevorjay/9fc061e8371529c4007689a696d33c62
# https://asciinema.org/a/101366
#
git-fshow() {
local g=(
git log
@enpassant
enpassant / vimwiki2html.md
Last active May 14, 2024 20:56
Convert VimWiki to HTML (markdown, mediawiki)

With this wiki2html.sh bash script and pandoc program, you can convert markdown to html.

Usage: In the vim list section of the .vimrcfile, include options:

let g:vimwiki_list = [{'path': ‘your_wiki_place',
  \ 'path_html': ‘wiki_html_location’,
  \ 'syntax': 'markdown',
 \ 'ext': '.md',
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@tylerneylon
tylerneylon / animated_svg.html
Created March 17, 2016 20:49
Example of an animated geometric figure
<!DOCTYPE HTML>
<html>
<body>
<svg width="600" height="600" vertion="1.1"
id="svg" xmlns="http://www.w3.org/2000/svg">
<defs>
<clipPath id="angleClip">
<polygon id="atriangle" />
</clipPath>