Skip to content

Instantly share code, notes, and snippets.

View carlos-algms's full-sized avatar
Constantly Caffeinated

Carlos Gomes carlos-algms

Constantly Caffeinated
View GitHub Profile

Install docker on Ubuntu / Debian / Raspbian

An script to automate docker installation instead of copy/pasting comands spread across docker documentation

run:

sh -c "$(curl -fsSL https://gist.githubusercontent.com/carlos-algms/707650eff4f1c9beb83f016bed3ec9a9/raw/install.sh)"
@carlos-algms
carlos-algms / Install Pacman on Git for Windows.md
Created November 1, 2021 22:36
Install Pacman on Git for Windows
  1. Install Git for Windows SDK somewhere else. You'll need more than 3 GB of free space for that.
  2. Copy ${git-sdk}/usr/bin/pacman.exe to ${git}/usr/bin
  3. Copy ${git-sdk}/etc/pacman.conf and ${git-sdk}/etc/pacman.d to ${git}/etc
  4. Copy ${git-sdk}/var to ${git}/

That's all. You can now open your Git Bash and run pacman -S python to install packages on your existing Git for Windows setup.

@carlos-algms
carlos-algms / spotify adb commands.md
Created June 4, 2021 09:42
Control Spotify via ADB commands

Control Spotify via ADB commands

Working:

Open a specific playlist in Spotify via ADB:

adb am start -a android.intent.action.VIEW spotify:playlist:4bfj9Go9YnSq7L4YeWTWeY:play
@carlos-algms
carlos-algms / README.md
Last active February 16, 2021 15:40
Convert video to webm format using ffmpeg

Convert video to webm format using ffmpeg

Docs: https://trac.ffmpeg.org/wiki/Encode/VP9

INPUT="video.mov"
OUTPUT="converted-video.webm"
CPUS=4                # Adjust the number of cores your CPU have
FRAMERATE=15          # Adjust for your needs
VARIABLE_BITRATE=100K # Adjust for your needs, can be represented as 1M, 1000k, etc.
@carlos-algms
carlos-algms / benchmark.sh
Last active March 13, 2024 14:42
Benchmark SSH ciphers transfer speed - Mac and Linux
#!/usr/bin/env bash
# Creates a 100Mb file send via SSH and test the transfer speed
perl -e 'print "\0" x 100000000' > test.txt && du -sh test.txt
# get a list of available ciphers on your machine
CIPHERS="$(ssh -Q cipher)"
for cipher in $CIPHERS; do
echo "$cipher"
@carlos-algms
carlos-algms / config.json
Last active October 19, 2020 10:14
Quokka config
{
"pro": false,
"plugins": ["jsdom-quokka-plugin"],
"node": "/Users/cgomes/.nvm/versions/node/v12.18.3/bin/node",
"ts": {
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"sourceMap": true,
"declaration": false,
@carlos-algms
carlos-algms / zshrc.sh
Created July 22, 2020 08:15
ZSH personal config
# Override PHP path priority
export PATH="$(brew --prefix php)/bin:$PATH"
ZSH_THEME="agnoster"
plugins=(git nvm npm npx yarn brew kubectl docker)
# Disable showing the username on local machine
DEFAULT_USER="MY_USER_NAME"
@carlos-algms
carlos-algms / aliases.sh
Created July 22, 2020 08:00
Node debug and inspect aliases
alias ts-node-brk='node --inspect-brk=7001 -r ts-node/register '
alias ts-nodemon='nodemon --exec "node -r ts-node/register"'
alias ts-nodemon-brk='nodemon --exec "node --inspect-brk=7000 -r ts-node/register"'
alias jest-inspect='node --inspect node_modules/.bin/jest --runInBand'
alias bnode='babel-node --extensions ".ts" --presets @babel/preset-typescript --plugins @babel/plugin-transform-modules-commonjs '
@carlos-algms
carlos-algms / README.md
Last active July 20, 2020 08:12
Kubernetes login to first available pod for the namespace

usage

Type kfp followed by the name of your namespace to loging and access the shell bash from a running instance in Kubernetes.

kfp production
@carlos-algms
carlos-algms / jsconfig.json
Created June 14, 2018 18:54
VSCode jsconfig.json enable type acquisitions for JavaScript
{
"compilerOptions": {
"target": "es6"
},
"typeAcquisition": {
"include": [
"chai",
"chai-as-promised",
"lodash",
"mocha",