This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # This command moves your zsh dotfiles (.zshrc, .zsh_history, etc.) | |
| # from the home directory to ~/.config/zsh. It's been verified to | |
| # work correctly if you are using zsh4humans. With other zsh configs | |
| # your mileage may vary. | |
| # | |
| # How to: | |
| # | |
| # 1. Close all terminals except one. | |
| # 2. Copy-paste this command into the only remaining terminal. | |
| () { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| # Download, extract and update Livepeer binary from Github to a pre-existing directory you set below | |
| # It assumes you have extracted the previous livpeer tar.gz in it and run livepeer from the same directory | |
| # Not intended to be run as root | |
| # | |
| # Expects bash, jq, curl, grep, sed, sha256sum and tar to be installed, usually available even on embedded systems | |
| # Windows Subsystem for Linux (WSL) or Cygwin should provide every utility on Windows | |
| # shellcheck disable=SC2015 | |
| set -euf -o pipefail | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | local fmt = string.format | |
| -- Iterator that splits a string o a given delimiter | |
| local function split(str, delim) | |
| delim = delim or "%s" | |
| return string.gmatch(str, fmt('[^%s]+', delim)) | |
| end | |
| -- Find the proper directory separator depending | |
| -- on lua installation or OS. | 
This is optional, in case you prefer your nick to be shown as something other than <matrix_nick>[m] on IRC, e.g. just <matrix_nick> (without the [m] suffix) or <libera_nick>.
Open a private chat with @appservice:libera.chat:
!nick <new_libera_nick>
Note: This does not change your Matrix nick!
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.
| Description | Syntax | 
|---|---|
| Get the length of a string | ${#VARNAME} | 
| Get a single character | ${VARNAME[index]} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| # | |
| # Send or receive data to/from another device on the network. | |
| PROGRAM=${0##*/} | |
| LOCAL_IP=192.168.1.100 | |
| PORT=6666 | |
| PASSWORD=topsecret | 
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ## TL;DR | |
| setopt extendedglob | |
| ls *(<tab> # to get help regarding globbing | |
| rm ../debianpackage(.) # remove files only | |
| ls -d *(/) # list directories only | |
| ls /etc/*(@) # list symlinks only | |
| ls -l *.(png|jpg|gif) # list pictures only | |
| ls *(*) # list executables only | |
| ls /etc/**/zsh # which directories contain 'zsh'? | 
NewerOlder