Skip to content

Instantly share code, notes, and snippets.

View guerrerocarlos's full-sized avatar
:octocat:
On shoulders of giants.

Carlos Guerrero guerrerocarlos

:octocat:
On shoulders of giants.
View GitHub Profile
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
cd /tmp
@guerrerocarlos
guerrerocarlos / LAMBDA_Costs.md
Last active December 12, 2024 12:31
AWS Lambda Costs, vCPU vs RAM Performance source: https://github.com/guerrerocarlos/lambda-benchmarks/

AWS Lambda Experimental Performance Results

RAM cpuCount cpuSpeed cpuModel pi (ms) fibonacci (ms) integration (ms) matrix (ms) prime (ms)
256 2 2499 Intel(R) Xeon(R) Processor @ 2.50GHz 22130 11708 85480 128013 56331
512 2 2499 Intel(R) Xeon(R) Processor @ 2.50GHz 10634 6165 45881 66251 26562
768 2 2499 Intel(R) Xeon(R) Processor @ 2.50GHz 7339 3887 29744 42871 18862
1024 2 2499 Intel(R) Xeon(R) Processor @ 2.50GHz 5229 3094 22267 30497 13980
1280 2 2499 Intel(R) Xeon(R) Processor @ 2.50GHz 4143 2321 17794 24653 11256
1536 2 2499 Intel(R) Xeo
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -q)
docker volume prune -f
docker network prune -f
rm -rf .local/share/tutor/
tutor config save --interactive
tutor local launch
menu_item:main:Dropbox:nickel_open:library:dropbox
menu_item:main:Send to Kobo:nickel_browser:modal:https://send.djazz.se
menu_item:main:Solitaire:nickel_extras:solitaire
menu_item:main:Sudoku:nickel_extras:sudoku
menu_item:main:Dark Mode:nickel_setting:toggle:dark_mode
menu_item:browser:Quit:nickel_misc:home
menu_item:browser:Orientation:nickel_orientation:swap
menu_item:reader:Reading Stats:nickel_open:reading_life:stats
# -----------------------------------------------------------------------
# Home/Main Screen
@guerrerocarlos
guerrerocarlos / lambda_usage.sql
Created May 11, 2024 09:08
Stats about real RAM usage of lambda instances https://console.aws.amazon.com/cloudwatch/home
filter @type = "REPORT"
| stats max(@memorySize / 1000 / 1000) as provisonedMemoryMB,
min(@maxMemoryUsed / 1000 / 1000) as smallestMemoryRequestMB,
avg(@maxMemoryUsed / 1000 / 1000) as avgMemoryUsedMB,
max(@maxMemoryUsed / 1000 / 1000) as maxMemoryUsedMB,
provisonedMemoryMB - maxMemoryUsedMB as overProvisionedMB
@guerrerocarlos
guerrerocarlos / New_Macbook_setup.md
Last active February 26, 2024 17:01
Mac Setup Guide

Install Prezto

  1. Launch Zsh:

    zsh
  2. Clone the repository:

@guerrerocarlos
guerrerocarlos / RaspSyncthing.md
Last active February 14, 2024 20:47
How to setup Syncthing in a Raspberry Pi

Install syncthing:

sudo mkdir -p /etc/apt/keyrings
sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt-get update
sudo apt-get install syncthing
printf "Package: *\nPin: origin apt.syncthing.net\nPin-Priority: 990\n" | sudo tee /etc/apt/preferences.d/syncthing.pref
sudo apt-get install apt-transport-https
@guerrerocarlos
guerrerocarlos / RasPiCloudflareDNS.md
Last active February 11, 2024 11:12
How to setup DDclient on Raspberry Pi for use with Namecheap DynDNS
@guerrerocarlos
guerrerocarlos / plex_media_permissions_4_noobies.md
Created February 10, 2024 19:50 — forked from pjobson/plex_media_permissions_4_noobies.md
Plex Media Permissions for Linux Noobies

Plex Media Permissions for Linux Noobies

There is no problem with being a noobie and I do not use the term to sligtht or disparage anyone.

This is a way to setup your permissions for running Plex in Linux. Different folks may use different methods.

The permissions concepts provided here apply to OSX, but the users and groups are controlled and modified differently, so much of this will not work properly. I think the command is dscl, but that could be out of date.

There are many ways to setup your permissions scheme in Linux, this methodology describes a way to do it, not everyone will like it, but it works for me, so whatever.

function trimNewlinesAndSpaces(inputString: string | number) {
// Remove newlines and replace multiple spaces with a single space
if (typeof inputString === "string") {
return inputString.replace(/\n/g, '').replace(/ +/g, ' ').replace(/\,/g, '');
} else {
return "" + inputString
}
}