Skip to content

Instantly share code, notes, and snippets.

@marshki
marshki / mixer.sh
Created April 18, 2024 14:07
BigFix auto installer for GNU/Linux (Ubuntu OS), written in Bash.
#!/usr/bin/env bash
set -e
# Set 'Computer Name' to serial number.
# Download, unzip, install, and cleanup BigFix GNU/Linux.
#
# Author: M. Krinitz <mjk235 [at] nyu [dot] edu>
# Date: 2023-11-08
# License: MIT
@marshki
marshki / fixer.sh
Last active April 18, 2024 14:05
BigFix auto installer for macOS, written in Bash.
#!/usr/bin/env bash
set -e
# Set macOS 'Computer Name' to serial number.
# Download, unzip, install, and cleanup BigFix in macOS.
#
# Author: M. Krinitz <mjk235 [at] nyu [dot] edu>
# Date: 2023-11-08
# License: MIT
@marshki
marshki / bash_simple_loop.sh
Last active February 27, 2024 23:43
Bash loop for the forgetful.
#!/usr/bin/env bash
#
# Simple loop in Bash
while : ; do
printf "%s\n" "Do this!"
printf "%s\n" "Do that!"
printf "%s\n" "And this, too!"
read -rp "Do you wish to continue (yes/no)?: " reply
@marshki
marshki / smarty_pants.sh
Last active February 27, 2024 23:42
Parse SMART Monitor test results for bad sector count, drive info.
#!/usr/bin/env bash
#
# smarty_pants
#
# Parse SMART Monitor test results for bad sector count, drive info.
#
# Author: M. Krinitz <mjk235 [at] nyu [dot] edu>
# Date: 16-Jul-2021
# License: MIT
#
@marshki
marshki / sendmail_setup.md
Last active December 19, 2023 19:49
Setup Sendmail in GNU/Linux.

Setup Sendmail in GNU/Linux 📫

Scope: Set up a general-purpose internetwork routing facility that supports Simple Mail Transfer Protocol (SMTP).

Dependencies

Install these packages first, per your operating system (OS):

CentOS, Fedora Debian, Ubuntu
dnf install apt-get install
sendmail-cf sendmail-cf
@marshki
marshki / NYU_VPN_Linux.md
Last active October 18, 2023 21:58
Connect to NYU-NET via OpenConnect VPN client from a command-line interface (CLI), in GNU/Linux, and macOS.

Connect to NYU-NET via VPN in GNU/Linux--Debian, Fedora, Ubuntu--(and macOS) 🔐

Scope: Use OpenConnect VPN client to connect to NYU-NET, the university's wide-area network (WAN).

Preflight check ✔️✈️

You'll need one or more of the following packages:

  • openconnect
  • network-manager-openconnect
  • network-manager-openconnect-gnome
@marshki
marshki / faux_tree.sh
Last active August 10, 2023 17:08
Partially mimic the `tree` command via Bash in macOS, Synology Disk Station Manager (DSM), et al.
#!/usr/bin/env bash
#
# Faux "tree" function in macOS, Synology Disk Station Manager (DSM), et. al.
# Comparable in output to Steve Baker's "tree" utility:
# http://mama.indstate.edu/users/ice/tree/
#
# Add function to: /Users/foo/.profile, or: .bash_profile,
# then refresh the profile with: source .profile or: source .bash_profile
#
# Inspired by this thread: https://superuser.com/questions/359723/mac-os-x-equivalent-of-the-ubuntu-tree-command
@marshki
marshki / OpenConnect_install.sh
Last active August 9, 2023 14:58
To access NYU's LAN via VPN on Debian, Fedora, or Ubuntu (Gnome), you need one or more packages. This Bash snippet installs them.
#!/usr/bin/env bash
#
# OpenConnect_install
#
# Install pkgs. needed to use OpenConnect (https://www.infradead.org/openconnect/) client in:
# Debian GNU/Linux, Fedora, or Ubuntu (GNOME desktop).
#
# Author: M. Krinitz <mjk235 [at] nyu [dot] edu>
# Date: 2023.09.08
# License: MIT
@marshki
marshki / capacitOR.sh
Last active July 22, 2023 15:43
Bash snippet to emit warning if capacity on disk(s) is ninety percent (90%) or more.
#!/usr/bin/env bash
#
# capacitOR
#
# Emit warning if capacity on disk(s) is ninety percent (90%) or more.
#
# Author: M. Krinitz <mjk235 [at] nyu [dot] edu>
# Date: 22-Jul-2023
# License: MIT
@marshki
marshki / add_matlab_launcher.sh
Last active July 16, 2023 18:01
Add MATLAB icon launcher in Ubuntu.
#!/usr/bin/env bash
#
# add_matlab_launcher
#
# Author: M. Krinitz <mjk235 [at] nyu [dot] edu>
#
# Add a MATLAB icon launcher in Ubuntu.
# Date: 2023.07.14
# License: MIT