Skip to content

Instantly share code, notes, and snippets.

View ergoz's full-sized avatar
😈
let's rock

[riftlab] ErgoZ ergoz

😈
let's rock
View GitHub Profile
@ergoz
ergoz / Dockerfile
Created November 20, 2023 19:35 — forked from fedej/Dockerfile
gRPC-web with nginx proxy
FROM node:16.14.2-alpine3.15 as client-builder
RUN apk update
RUN apk add git protoc
RUN mkdir /grpc
WORKDIR /grpc
RUN git clone -b 1.3.1 https://github.com/grpc/grpc-web
WORKDIR /grpc/grpc-web/net/grpc/gateway/examples/helloworld
RUN npm install
RUN wget -O /usr/local/bin/protoc-gen-grpc-web https://github.com/grpc/grpc-web/releases/download/1.3.1/protoc-gen-grpc-web-1.3.1-linux-x86_64
@ergoz
ergoz / navicat_reset_trial.sh
Created October 20, 2023 18:16 — forked from tuxity/navicat_premium_reset_trial.sh
Reset Navicat Premium 15/16 remaining trial days
#!/bin/bash
set -e
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
regex="CFBundleShortVersionString = \"([^\.]+)"
[[ $file =~ $regex ]]
version=${BASH_REMATCH[1]}
@ergoz
ergoz / README.md
Created September 13, 2023 21:09 — forked from tomdaley92/README.md
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface

@ergoz
ergoz / urlshortener.lua
Created September 8, 2023 11:09 — forked from bingoohuang/urlshortener.lua
url shortener base on nginx lua and resty redis
local _M = {
_VERSION = '0.1'
}
local connect = function()
local redis = require "resty.redis"
local red = redis:new()
red:set_timeout(1000) -- 1 sec
local ok, err = red:connect("127.0.0.1", 6379)
if not ok then
@ergoz
ergoz / import
Created September 4, 2023 12:04 — forked from Pliner/import
Mikrotik antifilter.download update script
:do {
:do {
/file remove "/ipsum.rsc";
/file remove "/subnet.rsc";
} on-error={}
:put "Downloading ipsum.rsc...";
:do {
/tool fetch url="https://antifilter.download/list/ipsum.rsc" dst-path="/ipsum.rsc"
} on-error={
@ergoz
ergoz / postgres_queries_and_commands.sql
Created April 18, 2023 09:49 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ergoz
ergoz / schema2ldif.sh
Created April 12, 2023 14:47 — forked from markllama/schema2ldif.sh
Convert LDAP Schema to LDIF
#!/bin/bash
#
# Stolen from https://stuckinadoloop.wordpress.com/2011/04/14/script-to-convert-openldap-schema-files-to-ldif-format/
SCHEMAD=/etc/openldap/schema
SCHEMAS='dhcp.schema'
tmpd=`mktemp -d`
pushd ${tmpd} >>/dev/null
@ergoz
ergoz / Assembly Tutorial.md
Created April 11, 2023 16:29 — forked from MegaLoler/Assembly Tutorial.md
A tutorial for the Simple 8-bit Assembler Simulator in Javascript

Assembly Programming

Hello! This is a tutorial for the Simple 8-bit Assembler Simulator in Javascript.

CPU

The CPU has a few pieces of memory stored inside of it called registers. In this case, these registers hold a single byte (8 bits) of memory. So at any given time each of these 8-bit registers hold a single value from 0 to 255, or $00 to $FF in hexidecimal.

Registers

<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@ergoz
ergoz / Msg2Trello.py
Created March 26, 2023 12:28 — forked from fskuratov/Msg2Trello.py
Telegram bot, developed using Python, that seamlessly translates incoming messages or forwarded texts into tasks and subtasks with the help of the GPT-3.5 API. The tasks, along with their associated subtasks as checklists, are efficiently organized into specified boards and lists on Trello by utilizing the Trello API.
import logging
import openai
import re
from datetime import datetime, timedelta
from trello import TrelloClient
from telegram import Update
from telegram.ext import ApplicationBuilder, ContextTypes, CommandHandler, MessageHandler, filters
# Set up logging for easier debugging
logging.basicConfig(