Skip to content

Instantly share code, notes, and snippets.

@failable
failable / networkservice.sh
Created March 15, 2025 06:22 — forked from reorx/networkservice.sh
macOS: get current active network device name, interface, mac
#!/bin/bash
services=$(networksetup -listnetworkserviceorder | grep 'Hardware Port')
while read line; do
sname=$(echo $line | awk -F "(, )|(: )|[)]" '{print $2}')
sdev=$(echo $line | awk -F "(, )|(: )|[)]" '{print $4}')
#echo "Current service: $sname, $sdev, $currentservice"
if [ -n "$sdev" ]; then
ifout="$(ifconfig $sdev 2>/dev/null)"
@failable
failable / shell-command-with-aliasses.el
Created September 27, 2023 16:17 — forked from amno1/shell-command-with-aliases.el
Use Bash aliases in interactive shell-comands
;;; shell-command-with-aliasses.el --- Use Bash aliases in interactive shell-comands -*- lexical-binding: t; -*-
;; Copyright (C) 2023 Arthur Miller
;; Author: Arthur Miller <[email protected]>
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or