Skip to content

Instantly share code, notes, and snippets.

View alexandrebl's full-sized avatar
🛰️
Working from space

ABrandaoL alexandrebl

🛰️
Working from space
View GitHub Profile
@alexandrebl
alexandrebl / ld.reinstall.debian
Created August 1, 2020 17:43
ld reinstall on linux when not found
sudo apt-get install --reinstall binutils
@alexandrebl
alexandrebl / boot_assembly.asm
Last active July 31, 2020 03:56
boot assembly
org 7C00h
jmp short Start ;Jump over the data (the 'short' keyword makes the jmp instruction smaller)
Msg: db "Hello World! "
EndMsg:
Start: mov bx, 000Fh ;Page 0, colour attribute 15 (white) for the int 10 calls below
mov cx, 1 ;We will want to write 1 character
xor dx, dx ;Start at top left corner
@alexandrebl
alexandrebl / GenerateScriptsPostgres.cs
Created July 21, 2020 17:25
Generate Scripts Postgres
SELECT format(
'ALTER SCHEMA %I OWNER TO %I;',
schema_name,
current_user
)
FROM information_schema.schemata;
SELECT format(
'GRANT SELECT, INSERT, UPDATE, DELETE ON %I TO %I',
table_name,
@alexandrebl
alexandrebl / rabbitMQPublishConfirmationReturnMessage.cs
Created July 19, 2020 16:09
RabbitMQ Publish Confirmation and Return Message CSharp
using RabbitMQ.Client;
using System;
using System.Text;
using System.Threading;
namespace Publisher
{
class Program
{
static void Main(string[] args)
@alexandrebl
alexandrebl / woker-api-fisrt-dotnet-full.cs
Created July 13, 2020 01:17
Woker Api Fisrt in .Net Full
using Microsoft.Extensions.Hosting;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http;
namespace WebApplication2
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
@alexandrebl
alexandrebl / TimeZoneBrazil.cs
Created July 9, 2020 12:00
Get TimeZone Brazil CSharp
public static class TimeZoneBrazil
{
public static DateTime GetCurrentLocalDate()
{
long ticks;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
ticks = TimeZoneInfo
.FindSystemTimeZoneById("America/Sao_Paulo")
@alexandrebl
alexandrebl / RabbitMqMessagePersistence.cs
Created July 8, 2020 00:31
RabbitMq CSharp Message Persistence
using RabbitMQ.Client;
using System;
using System.Text;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
@alexandrebl
alexandrebl / GetTimeZoneName.cs
Created July 3, 2020 17:46
Get Time Zone Name CSharp
using System;
public class Program
{
public static void Main()
{
var tzis = TimeZoneInfo.GetSystemTimeZones();
foreach (var tzi in tzis)
{
@alexandrebl
alexandrebl / docker-compose.yaml
Last active January 4, 2025 01:51
Kafka And Zookeeper Docker Compose
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
networks:
- net
ports:
- 2181:2181
environment:
@alexandrebl
alexandrebl / rabbitmqDeadletter.cs
Last active June 23, 2020 15:31
RabbitMq Dead Letter
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Channels;