Skip to content

Instantly share code, notes, and snippets.

View todoshcenko's full-sized avatar

Andrei Todoșcenco todoshcenko

View GitHub Profile
@todoshcenko
todoshcenko / fish-build-install.sh
Created May 21, 2022 12:05 — forked from Brandonshire/fish-build-install.sh
Install Fish Shell 3+ on Raspberry Pi
#!/bin/bash
# This is a quick installer
# script I made to build and install the latest version of
# fish on my Raspberry Pi.
#
# Use at your own risk as I have made no effort to make
# this install safe!
set -e

Keybase proof

I hereby claim:

  • I am todoshcenko on github.
  • I am todoshcenko (https://keybase.io/todoshcenko) on keybase.
  • I have a public key ASCn-3VhJV0MjJVpvimaooseGHnvsy2N_QrFkECyXukqggo

To claim this, I am signing this object:

#!/usr/bin/env bash
branch=$1
dependenciesDir=$2
for libDir in ${dependenciesDir}/*/ ; do
pushd ${libDir} > /dev/null
for remoteBranch in $(git ls-remote --heads origin | sed -r 's/\w+\s+//'); do
if [ "${remoteBranch}" == "refs/heads/${branch}" ]; then
git fetch -q origin ${branch}:${branch}
@todoshcenko
todoshcenko / Choosing a Socket Type.md
Last active July 13, 2023 09:23
chapter from "Linux Socket Programming by Example" from Warren Gay

Choosing a Socket Type

You already know that choosing a domain value for the socket(2) or socketpair(2) function chooses a protocol family to be used. For example, you know that

  • PF_LOCAL (which is the same as PF_UNIX) indicates that a local UNIX socket protocol family is being specified.
  • PF_INET indicates that the Internet family of protocols is used.

Consequently, you now have to learn about only two more input arguments.

The socket type argument in the socket(2) and socketpair(2) function calls indicates how a socket will interface with your program. But this is not the whole story, as this parameter also has implications for the protocol that is selected. (You'll understand this better as you progress through this chapter.)