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

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@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 / 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 / docker_cheatsheet.md
Last active February 2, 2023 12:26
Docker - Comandos Úteis

Docker - Comandos Úteis

Containers

  • Abrir um shell em um container em execução:
    • docker exec -t -i <container_id> <shell>

Limpeza

  • Excluir containers com status equivalente a Exited:
@jctosta
jctosta / setProxyEnv.sh
Created November 8, 2015 12:40
Script para configuração automática de proxy em sistemas Linux
# Terminal Settings (WGET, Apt e etc.)
export http_proxy=http://localhost:3128
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy=localhost,127.0.0.1,localaddress,.localdomain.com,10.*
# Configurações para proxy automático em ambientes Gnome
if hash gsettings 2>/dev/null; then
gsettings set org.gnome.system.proxy autoconfig-url '<pac_file_location>'
@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 / vscode-extensions.md
Last active July 14, 2022 07:02
Recomendação de Extensões - VSCode
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@jctosta
jctosta / check_location.js
Created August 6, 2014 17:31
Check Machine Location
#!/usr/bin/env node
var args = process.argv.slice(2);
//console.log('Started');
// String startsWith polyfill
if (!String.prototype.startsWith) {
Object.defineProperty(String.prototype, 'startsWith', {
enumerable: false,
@jctosta
jctosta / unsetProxyEnv.sh
Created November 8, 2015 12:42
Remove configurações de proxy em ambientes Linux
# Terminal Settings (WGET, Apt e etc.)
unset http_proxy
unset https_proxy
unset ftp_proxy
unset rsync_proxy
unset no_proxy
# Configurações para proxy automático em ambientes Gnome
if hash gsettings 2>/dev/null; then
gsettings set org.gnome.system.proxy mode 'none'