Skip to content

Instantly share code, notes, and snippets.

View Vitexus's full-sized avatar
🤖
Coding as usual

Cybervitexus Vitexus

🤖
Coding as usual
View GitHub Profile
@ansulev
ansulev / install-java-temurin-debian-12.txt
Created December 15, 2023 12:56
Install Java 8 or 11 on Debian 12
mkdir -p /etc/apt/keyrings
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
apt update
apt install temurin-8-jdk
@code-boxx
code-boxx / 0-PHP-DAEMON.MD
Last active August 17, 2023 17:13
PHP Daemon

SIMPLE PHP DAEMON

https://code-boxx.com/simple-php-daemon/

LICENSE

Copyright by Code Boxx

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

@0x7d7b
0x7d7b / RPI_OTG.md
Last active September 19, 2022 22:03
Raspberry Pi Zero - Bridge Network Setup

The goal of this article is to explain how to install one or many Raspberry Pi 3 B+ devices connected with one to four Raspberry Pi Zero 1.3 devices each via USB OTG networking.

Preview

Each device - Pi and Zero - will be connected to the network 192.168.0.0/24. Each Zero will be connected via USB OTG to the Pi. That will establish a network between the two devices. On each Pi a network bridge will be configured to forward the traffic between the Pi ethernet port and the connected USB ports.

Their individual hostname/IP pattern will be:

10.lab | 192.168.0.10 (1st Pi)
20.lab | 192.168.0.20 (2nd Pi)
package main
import (
"context"
"fmt"
v1 "k8s.io/api/apps/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
ctrl "sigs.k8s.io/controller-runtime"
@stenito
stenito / publicip.php
Last active March 3, 2025 06:17
Get public IP address (or wan IP address) with php function
<?php
function getPublicIP() {
// create & initialize a curl session
$curl = curl_init();
// set our url with curl_setopt()
curl_setopt($curl, CURLOPT_URL, "http://httpbin.org/ip");
// return the transfer as a string, also with setopt()
@serhiikamolov
serhiikamolov / pre-commit
Last active November 25, 2022 18:44
Git pre-commit hook with phpcs, phpstan and phpunit
#!/usr/bin/env bash
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "\n${GREEN}Running pre-commit hook${NC}"
# Get list of the modified files
@radimih
radimih / main.yml
Created November 27, 2020 09:14
Ansible: stop systemd service if exists
- name: Disable and stoping service if exists
systemd:
service: "{ service name }"
enabled: no
state: stopped
register: result_systemd_stop
failed_when: "result_systemd_stop is failed and 'Could not find the requested service' not in result_systemd_stop.msg"
#!/bin/bash
# Put this shell script under /etc/letsencrypt/renewal-hooks/post to auto update plex SSL with Let's Encrypt.
HOSTNAME="$(hostname -f)"
openssl pkcs12 -export -out /var/lib/plexmediaserver/certificate.pfx -inkey /etc/letsencrypt/live/${HOSTNAME}/privkey.pem -in /etc/letsencrypt/live/${HOSTNAME}/cert.pem -certfile /etc/letsencrypt/live/${HOSTNAME}/chain.pem -passout pass:
chown plex:plex /var/lib/plexmediaserver/certificate.pfx
sleep 5
systemctl restart plexmediaserver.service
@dg
dg / patch-CVE-2020-15227.php
Last active January 2, 2025 00:18
CVE-2020-15227 nette/application RCE in-place patch
<?php
# In-place apply the CVE-2020-15227 nette/application patch
# This is a universal patcher for all affected versions.
# Run with `php patch-CVE-2020-15227.php`
# Inspiration: @spazef0rze
@bcherny
bcherny / designing-data-intensive-application-notes.md
Last active April 11, 2025 15:37
Notes: Designing Data-Intensive Applications

Notes on Martin Kleppmann's excellent Designing Data-Intensive Applications.

Chapter 1: Reliable, Scalable, and Maintainable Applications

  • Data Systems
    • Dimensions to consider when thinking about data systems: access patterns, performance characteristics, implementations.
    • Modern data systems often blur the lines between databases, caches, streams, etc.
  • Reliability
    • Systems should perform the expected function at a given level of performance, and be tolerant to faults and user mistakes
  • Fault: One component of a system deviating from its spec. Prefer tolerating faults over preventing them (except for things like security issues). Faults stem from hardware failures, software failures, and human error (in a study, config errors caused most outages).