Skip to content

Instantly share code, notes, and snippets.

Avatar
🦾

Carlos D. Álvaro cdalvaro

🦾
View GitHub Profile
@cdalvaro
cdalvaro / free_ports.sh
Created Nov 13, 2021 — forked from hjbotha/free_ports.sh
Free ports 80 and 443 on Synology NAS
View free_ports.sh
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx
# Run this script as root
View zsh-cheatsheet.md

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get a single character ${VARNAME[index]}
Get the string from a specific index ${VARNAME[index,-1]}
@cdalvaro
cdalvaro / SyncTheme.py
Last active Feb 7, 2021 — forked from saagarjha/theme.py
iTerm2 Script to change the theme automatically based on the system appearance
View SyncTheme.py
#!/usr/bin/env python3
import iterm2
async def set_theme(connection, theme):
# Themes have space-delimited attributes, one of which will be light or dark.
parts = theme.split(" ")
if "dark" in parts:
preset = await iterm2.ColorPreset.async_get(connection, "GitHub Dark")
View keybase.md

Keybase proof

I hereby claim:

  • I am cdalvaro on github.
  • I am cdalvaro (https://keybase.io/cdalvaro) on keybase.
  • I have a public key whose fingerprint is 91DB 2FD1 CE5A 3545 9250 FEFC E0F9 B75C 3246 CEB5

To claim this, I am signing this object:

@cdalvaro
cdalvaro / gpg-with-key
Last active Feb 4, 2021 — forked from stansidel/gpg-with-key
Setting up GPG signature on macOS with Xcode
View gpg-with-key
/usr/local/bin/gpg --batch --pinentry-mode=loopback --passphrase-file ~/.gnupg/key.txt --no-tty "$@"