Skip to content

Instantly share code, notes, and snippets.

View jctosta's full-sized avatar

Carlos Tosta jctosta

  • Rio de Janeiro, Brazil
View GitHub Profile
@jctosta
jctosta / limit_gpu_power.md
Created July 12, 2024 21:04
Nvidia GPU Power Limits for Linux System

You can use the following commands to limit the maximum power allowed to your NVIDIA GPU when using linux systems.

First, let's check how much power the GPU is allowed to draw and the current value:

nvidia-smi -q -d POWER

This should return an output similar to this one:

@jctosta
jctosta / docker-wsl2-memory-limits.md
Created June 14, 2021 21:23
You can limit docker-windows memory usage by adjusting some parameters in wsl2 configuration.

Limit WSL2 Memory Usage when using Docker for Windows

You can limit docker-windows memory usage by adjusting some parameters in wsl2 configuration.

First, close any instances of Docker Windows currently running and create a new file named .wslconfig in your user home directory, like C:\Users<username>:

[wsl2]
memory=4GB
processors=5
@jctosta
jctosta / lightning_mage_filter.xml
Last active May 29, 2021 17:44
Last Epoch Lightning Mage Filter
<?xml version="1.0" encoding="utf-8"?>
<ItemFilter xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<name>Lightning Mage</name>
<filterIcon>17</filterIcon>
<filterIconColor>1</filterIconColor>
<description />
<lastModifiedInVersion>0.8.2f</lastModifiedInVersion>
<lootFilterVersion>0</lootFilterVersion>
<rules>
<Rule>
@jctosta
jctosta / init_postgres_windows.md
Last active April 29, 2024 12:28
A simple guide on initializing the Windows version of Postgres using the zip file instead of msi installer
@jctosta
jctosta / GoogleSheets.gs
Created May 29, 2019 04:15
A google script to log web service data in a drive sheets
function deg2rad(deg) {
return deg * (Math.PI / 180);
}
function getDistanceFromLatLongInKm(lat1, lon1, lat2, lon2) {
var R = 6371; // Raio do Planeta Terra em KM
var dLat = deg2rad(lat2 - lat1);
var dLon = deg2rad(lon2 - lon1);
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
@jctosta
jctosta / vscode-extensions.md
Last active July 14, 2022 07:02
Recomendação de Extensões - VSCode
{
"canvas": {
"parcerias_principais": {
"title": "Parcerias Principais",
"color": "blue_canvas",
"cards": [
{ "label": "Loja de Noivas", "description": "" },
{ "label": "Lojas de Aniversário", "description": "" },
{ "label": "Animadores de Festa", "description": "" },
{ "label": "Empresas de Entrega", "description": "" }
@jctosta
jctosta / programming_tips.md
Created June 3, 2017 11:47
Programming Tips

Programming Tips (Dicas de Programação)

Linguagem C

Definir Locale para exibição de caractéres acentuados no console

Incluir a biblioteca locale.h no cabeçalho da página:

#include 
@jctosta
jctosta / wireless_doorbell_nodemcu.cpp
Created March 7, 2017 22:34
Wireless Doorbell with NodeMCU and IFTTT Maker Channel
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#define BUTTON 4
int buttonState = 0;
const char* ssid = "<wifi_ssid>";
const char* password = "<wifi_password>";
@jctosta
jctosta / nerdtech2.md
Last active July 24, 2017 13:05 — forked from peas/nerdtech2.md
Links que citamos no NerdTech #2