Skip to content

Instantly share code, notes, and snippets.

View epcim's full-sized avatar

Petr Michalec epcim

View GitHub Profile
@epcim
epcim / ipxe_with_dhcp.txt
Created April 13, 2023 08:33 — forked from tuxfight3r/ipxe_with_dhcp.txt
ipxe kickstart over http - dhcp and static configuration
#clone the repo
git clone http://git.ipxe.org/ipxe.git
cd ipxe/src
cat >ubuntu-amd64-installer.ipxe <<EOF
#!ipxe
dhcp
echo Starting Ubuntu x64 installer for ${hostname}
set base-url http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${base-url}/linux
@epcim
epcim / Makefile-vars.md
Created March 30, 2023 11:08
makefile vars from env

scenarios: TMPDIR=new/path make and make TMPDIR=new/path

SHELL  := env TMPDIR=$(TMPDIR) $(SHELL)
TMPDIR ?= "/tmp"

all:
  @echo $(TMPDIR)
@epcim
epcim / emoticons-ascii.howto.md
Last active March 22, 2023 19:57
emoticons-ascii.howto.md

Fucking work, nothing works as expected.

   ┓┏┓┏┓┃ 
   ┛┗┛┗┛┃\○/ 
   ┓┏┓┏┓┃ / Jdu se zabit
   ┛┗┛┗┛┃ノ) 
   ┓┏┓┏┓┃ 
   ┛┗┛┗┛┃ 
 ┓┏┓┏┓┃ 
tar cvJ /etc/vpm/ | age -r $(curl -qsSL https://f.apealive.net/pub/$USER.age.pub) | croc send
Receiving side
# cat croc-stdin-2310548854 | age -d -i <(pass show age-$USER-public) | tar xvJ
```
{__name__=~".+",site=~"gc1-iad-01",pod=~"(keycloak-s1-).*"}
```

VIM-GO

Plugin https://github.com/fatih/vim-go
Tutorial https://github.com/fatih/vim-go-tutorial
Vimrc https://github.com/fatih/dotfiles/blob/master/vimrc

Run

Commands

  • File :GoRun %
  • Package :GoRun
  • Debug :GoDebugStart
@epcim
epcim / gist:8434d2f7cae31ab77c620f1f321286bd
Created January 21, 2023 14:19
network debug api siege performance
```
apt install siege -y
siege -c 255 -t 5m https://my.tls.host/api/status
```
@epcim
epcim / brew_install_coreutils.sh
Created November 13, 2015 10:47
OSX brew install GNU coreutils, bin utils etc...
# From https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
brew install coreutils
brew install gnu-tar --with-default-names
# alternatively
brew install binutils
brew install diffutils
@epcim
epcim / systemd_loging.sh
Last active August 30, 2022 16:16
bash snippet for systemd logging functions
#!/bin/bash
printf_stdin() { local stdin; read -d '' -u 0 stdin; printf "$@" "$stdin"; }
exec {log_fd}> >(systemd-cat -t $(basename $0))
log_emerg() { echo "EMERG: $1"|tee /dev/stderr| printf_stdin '<0>%s\n' "$1" >&"$log_fd"; }
log_alert() { echo "ALERT: $1"|tee /dev/stderr| printf_stdin '<1>%s\n' "$1" >&"$log_fd"; }
log_crit() { echo "CRIT: $1" |tee /dev/stderr| printf_stdin '<2>%s\n' "$1" >&"$log_fd"; }
log_err() { echo "ERROR: $1"|tee /dev/stderr| printf_stdin '<3>%s\n' "$1" >&"$log_fd"; }
log_warn() { echo "WARN: $1" |tee /dev/stderr| printf_stdin '<4>%s\n' "$1" >&"$log_fd"; }