Skip to content

Instantly share code, notes, and snippets.

View iuridiniz's full-sized avatar

Iuri Diniz iuridiniz

View GitHub Profile
@iuridiniz
iuridiniz / LameMP3Streamer.java
Last active March 11, 2025 19:10
The LameMP3Streamer class provides methods to encode raw audio data to MP3 * format using the LAME library
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Time;
@iuridiniz
iuridiniz / dump.py
Created January 13, 2023 14:58
Dump environment variables, system information and other useful information
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Dump environment variables, system information and other useful information"""
import os
import contextlib
import platform
import psutil
import requests
@iuridiniz
iuridiniz / import.py
Created December 1, 2022 20:16
import all modules from this directory (recursively) to register them
import importlib
import os.path
import pkgutil
def import_all_modules(path, package):
# import all modules from this directory (recursively) to register endpoints in api_blueprint
# print("++importing all modules from: " + path)
pkgs = []
for (_, module_name, ispkg) in pkgutil.iter_modules([path]):
# print(f"importing module {module_name!r} in path {path!r} (ispkg={ispkg})")
@iuridiniz
iuridiniz / README.md
Last active December 16, 2022 18:48
SQL FROM validate_json_schema 0.1.1 (https://github.com/gavinwahl/postgres-json-schema)
@iuridiniz
iuridiniz / install_ena_2_5_0.sh
Last active November 9, 2021 19:31
install_ena_2_5_0.sh
#!/bin/sh
# curl -k https://gist.githubusercontent.com/iuridiniz/1562fb3f708535d78995d66877727c9c/raw/install_ena_2_5_0.sh | sh
set -x -e
apt-get install -y \
linux-headers-`uname -r` \
wget \
curl \
build-essential \
@iuridiniz
iuridiniz / overclock.c
Last active April 7, 2021 11:23
overclock nvidia (reverse engineering)
/*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@iuridiniz
iuridiniz / slug.py
Created July 20, 2020 13:21
slug generator (from uuid)
from base64 import urlsafe_b64decode, urlsafe_b64encode
from uuid import UUID, uuid4
from binascii import Error as BinasciiError
def slug():
uuid_ = uuid4()
return uuid2slug(uuid_)
# https://stackoverflow.com/a/53543324/1522342
def uuid2slug(uuid_):
@iuridiniz
iuridiniz / IPRoute
Last active December 13, 2020 23:39
This script manages routes by adding or removing them. (For usage with haresources: http://www.linux-ha.org/wiki/Haresources)
#!/usr/bin/env python
#
# Description: This script manages routes by adding or removing them.
#
# Author: Iuri Diniz <iuri @ evolux dooot net dot br>
# License: GNU General Public License (GPL)
# Support: suporte at evolux dooot net dot br
# Copyright: (C) 2019 Evolux Sistemas LTDA.
#
# This script manages Routes
@iuridiniz
iuridiniz / Monitoring toosl.md
Last active December 14, 2020 01:48
Monitoring tools

List of linux monitoring tools

Top like tools

top

  • original tool

htop