Skip to content

Instantly share code, notes, and snippets.

@yuksbg
yuksbg / proxmox-recreate-vm.sh
Created September 25, 2025 12:39
Proxmox Linked VM Recreate from template
#!/bin/bash
# Proxmox VM Recreation Script
# This script recreates VMs from a new template while preserving hostname and MAC addresses
# Fix locale issues
export LC_ALL=C
export LANG=C
# Configuration
@yuksbg
yuksbg / cleanup_registry.sh
Created May 26, 2025 08:48
This script helps **clean up old image tags** in your self hosted docker registry. It automatically keeps the `latest` tag and the last 4 non-latest tags (based on creation date), removing older ones.
#!/usr/bin/env bash
#
# cleanup_registry.sh
#
# Purpose:
# Script to clean up old tags from a container registry repository,
# keeping only the latest and the last 4 non-latest tags.
#
# Usage:
# - Make it executable: chmod +x cleanup_registry.sh
version: "3"
services:
kutt:
image: kutt/kutt
depends_on:
- postgres
- redis
command: ["./wait-for-it.sh", "app-db-production-20231014115640778500000001.cslw5nvms5h6.eu-central-1.rds.amazonaws.com:5432", "--", "npm", "start"]
ports:
#EXTM3U
#EXTINF:0,Dash6
https://ice55.securenetsystems.net/DASH6
package main
import "regexp"
import "log"
func toLatin(content string) string {
var translations = map[string]string{
"а":"a",
"б":"b",
@yuksbg
yuksbg / golang-fcm-xmpp-server.go
Created June 15, 2016 17:00
Quick and dirty example for FCM XMPP server which uses channels for comunications
package main
import (
"github.com/titan-x/gcm/ccs"
"log"
"time"
"encoding/json"
)
func sendMe(sendM chan string) {
#!/bin/bash
#Usage
#wget -O- https://gist.githubusercontent.com/yuksbg/77ad0f4ee0968fd6a3c7/raw/14dcf5ca3488df7bfc6d79df09367b626f4d4ab1/install-latest-mongo.sh | sh
echo "------------------------------------------"
echo "Install MongoDB on Ubuntu"
echo "------------------------------------------"
@yuksbg
yuksbg / remote-rsyslog.go
Last active November 18, 2015 09:09
Remote rsyslog "parser". Get preformated json and insert it into mongo db.
package main
import (
"encoding/json"
"fmt"
"github.com/manucorporat/try"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"net"
"os"
@yuksbg
yuksbg / singlethon.php
Created November 11, 2015 22:21
PHP Singlethon implementation
<?php
abstract class Singleton {
// protected static $INSTANCE;
/**
* Protected constructor to prevent creating a new instance of the
* @return void
*/
@yuksbg
yuksbg / android_gcm_example.php
Created December 17, 2014 09:37
ex. send android notification
$api_key = $_GET['API'];
$registrationIds = array( $_GET['id'] );
$msg = array
(
'message' => 'msg',
'title' => 'opt. title',
'vibrate' => 1,
'sound' => 1,
'is_sys' => '1/0'