Skip to content

Instantly share code, notes, and snippets.

@x86128
x86128 / main.go
Last active May 15, 2023 03:21
parser generator
package main
import (
"fmt"
"time"
)
type Article struct {
ID int
Title string
@x86128
x86128 / CMakeLists.txt
Last active April 24, 2023 16:59
pico rgb led and timers
add_executable(blink
blink.c
)
# pull in common dependencies
target_link_libraries(blink pico_stdlib hardware_spi)
# enable stdio output to usb serial
pico_enable_stdio_usb(blink 1)
@x86128
x86128 / fighter.go
Created January 12, 2023 18:17
Fighter written in Go
package main
import "fmt"
type Fighter struct {
name string
health int
attack int
defence int
}
@x86128
x86128 / provision_ubuntu2004_qemu_macosx.sh
Created July 19, 2022 05:01 — forked from relyt0925/provision_ubuntu2004_qemu_macosx.sh
Provisions a Ubuntu 20.04 VM in QEMU on Mac OSX using Cloud-Init
#!/usr/bin/env bash
#Install brew and qemu + cloud init metadata dependencies
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install qemu
brew install cdrtools
rm -rf /tmp/ubuntuqemuboot
#download Ubuntu 20.04 Cloud Image and resize to 30 Gigs
mkdir -p /tmp/ubuntuqemuboot/images
@x86128
x86128 / pinger.cr
Last active May 29, 2022 07:12
pinger
require "http/server"
require "pinger"
BATCH_SIZE = 2
BATCH_INTERVAL = 1
PING_INTERVAL = 0.05
PING_COUNT = 1
PING_TIMEOUT = 1
hostnames = ["1.1.1.1", "8.8.8.8", "127.0.0.1"]
@x86128
x86128 / simple.go
Last active May 24, 2022 11:57
Simple text MUD skeleton
package main
import (
"encoding/json"
"fmt"
"os"
)
// Выходы
type ExitKind int
@x86128
x86128 / ipcounter.go
Created January 16, 2022 15:16
Solution of IP address counting task
// Solution for https://github.com/Ecwid/new-job/blob/master/IP-Addr-Counter.md
package main
import (
"archive/zip"
"bufio"
"fmt"
"log"
"time"
)
@x86128
x86128 / promtail_docker_logs.md
Created November 15, 2021 09:48 — forked from ruanbekker/promtail_docker_logs.md
Docker Container Logging using Promtail
@x86128
x86128 / passports.go
Last active April 12, 2022 14:37
FMS check outdated passports
package main
import (
"bufio"
"fmt"
"log"
"os"
"time"
)
@x86128
x86128 / commands.md
Last active June 16, 2021 07:58
GlusterFS cluster on Ubuntu 20.04 Focal

Assume two disks for gluster bricks is: sdc sdd

add repository

sudo add-apt-repository ppa:gluster/glusterfs-9

if direct internet connection is not available, do:

export http_proxy=http://proxy:port
export https_proxy=http://proxy:port
sudo -E add-apt-repository ppa:gluster/glusterfs-9