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
@vilicvane
vilicvane / wsl-host.ps1
Last active December 3, 2022 06:25
Access Windows host from WSL 2
# Access host ports from WSL 2.
# https://gist.github.com/vilic/0edcb3bec10339a3b633bc9305faa8b5
# Make sure WSL gets initialized.
bash.exe -c exit
# Record host name for /etc/hosts that points to host IP.
$HOST_NAME = "host.wsl";
# Ports listened on host localhost to forward, you don't need to add the port if it listens all addresses.
@buroz
buroz / main.go
Last active March 2, 2025 20:32
Golang SOAP Request Example
package main
import (
"bytes"
"crypto/tls"
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
"strings"
@thatisuday
thatisuday / release.yml
Last active August 9, 2024 15:45
A sample GitHub workflow file to generate and publish cross-platform builds for Go (Golang).
# workflow name
name: release
# on events
on:
release:
types:
- created
# jobs
#!/bin/bash
set -u
##############################################################################
# DEPRECATION NOTE
#
# This script is outdated. Use it at your own risk.
# First, it has a bug related to the option -o (basically, it does nothing).
# Second, there is a new github repo with a new version, with no known bugs
# and with improved features:
@danielcharrua
danielcharrua / remove_emoji.php
Created April 2, 2020 11:23
Remove emoji from PHP string.
/**
* This function removes emoji from string
* Used to filter Twilio SMS/MMS for emoji characters and send messages using GSM instead of UCS-2
*
* Usage remove_emoji('Lorem ipsum 🥊dolor 🤒sit amet, consectetur adipiscing 🍂 elit. 🌰🍁🌿🌾🌼🌻');
*/
function remove_emoji($text){
return preg_replace('/[\x{1F3F4}](?:\x{E0067}\x{E0062}\x{E0077}\x{E006C}\x{E0073}\x{E007F})|[\x{1F3F4}](?:\x{E0067}\x{E0062}\x{E0073}\x{E0063}\x{E0074}\x{E007F})|[\x{1F3F4}](?:\x{E0067}\x{E0062}\x{E0065}\x{E006E}\x{E0067}\x{E007F})|[\x{1F3F4}](?:\x{200D}\x{2620}\x{FE0F})|[\x{1F3F3}](?:\x{FE0F}\x{200D}\x{1F308})|[\x{0023}\x{002A}\x{0030}\x{0031}\x{0032}\x{0033}\x{0034}\x{0035}\x{0036}\x{0037}\x{0038}\x{0039}](?:\x{FE0F}\x{20E3})|[\x{1F441}](?:\x{FE0F}\x{200D}\x{1F5E8}\x{FE0F})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F467}\x{200D}\x{1F467})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F467}\x{200D}\x{1F466})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F467})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F466}\x{200D}\x{1F466})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F466})|[\
@kokes
kokes / cz.txt
Last active April 29, 2020 10:49
czech domains *potentially* affected by this CAA problem https://letsencrypt.org/caaproblem/
This file has been truncated, but you can view the full file.
*.0.devklarka.cz
*.05.cz
*.0e.cz
*.0oo.cz
*.1.devklarka.cz
*.10.devklarka.cz
*.1001hry.cz
*.100letvyroci.cz
*.100py.cz
*.11.devklarka.cz
@bgulla
bgulla / Jenkinsfile
Created January 13, 2020 16:07
Multi-architecture Jenkins Docker Builds with Docker manifest support
pipeline {
environment {
registryCredential = 'harbor-lol-jenk-robot'
DOCKER_IMAGE = sh 'echo ${JOB_NAME} | sed "s/gitea-larkspur//g" | sed "s/master//g"'
registry = "" /*be sure to include trailing slash*/
docker_image_name = "bgulla/rtl-tcp"
docker_img = "${registry}${docker_image_name}"
/* */
push_to_local_registry = true
@lukaskaplan
lukaskaplan / ansible-fxb-deb10.yml
Created January 10, 2020 17:08
Ansible - Instalace flexibee server 2019.3.1.3 na debian 10
- name: Playbook pro instalaci Flexibee na deb 10
hosts: vboxflexi
tasks:
- name: Ping
ping:
- name: Instalace potrebnych baliku
apt:
pkg:
- python-apt
@aw
aw / explain.md
Last active July 29, 2024 12:02
[SOLVED] Proxmox VE and cloud-init snippets etc

Proxmox VE 6.x release includes a feature to add custom cloud-init configs. Unfortunately there is poor documentation, so I had to figure this out by adding pieces of information together.

The custom cloud-init files (user-data, meta-data, network-config)

The cloud-init files need to be stored in a snippet. This is not very well documented:

  1. Go to Storage View -> Storage -> Add -> Directory
  2. Give it an ID such as snippets, and specify any path on your host such as /snippets
  3. Under Content choose Snippets and de-select Disk image (optional)
  4. Upload (scp/rsync/whatever) your user-data, meta-data, network-config files to your proxmox server in /snippets/snippets/ (the directory should be there if you followed steps 1-3)
@CHERTS
CHERTS / zabbix_sender.sh
Created November 15, 2019 11:36
Zabbix-sender on bash
#!/bin/ash
help="Usage: zabbix_sender.sh <-z zabbix server> [-p server port] [-s host name] <-k key name> <-o key value>"
while getopts "z:p:s:k:o:h" c; do
case $c in
z)z=${OPTARG};;
p)p=${OPTARG};;
s)s=${OPTARG};;
k)k=${OPTARG};;
o)o=${OPTARG};;
h)echo $help;exit 0;;