Skip to content

Instantly share code, notes, and snippets.

@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 / nyu_hpc_sshfs.md
Last active April 5, 2023 14:52
Mount remote storage on one of NYU's High-Performance Computing (HPC) nodes via `sshfs`.

Mount Remote Storage on NYU's HPC 💻


Scope: Use sshfs to mount remote storage on one of NYU's High-Performance Computing (HPC) nodes.

NOTE: The "prince" cluster has been retired, and sshfs is not currently available on "greene".

Preflight checks ✔️✈️

You'll need these:

@marshki
marshki / mirror_mirror.sh
Last active December 3, 2021 20:35
One-way Rsync mirror of data from source to destination. Run as a crontab.
#!/usr/bin/env bash
#
# mirror_mirror
#
# One-way Rsync mirror of data from source to destination.
#
# Author: M. Krinitz <mjk235 [at] nyu [dot] edu>
# Date: 2020.04.20
# 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 / 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
@marshki
marshki / find_duplicates.sh
Last active April 28, 2020 21:43
Locate duplicate data and mv (rather than remove) in Bash.
#!/usr/bin/env bash
#
# find_duplicates
#
# Identify and move duplicate data to: /tmp for review.
#
# Author: M. Krinitz <mjk235 [at] nyu [dot] edu>
# Date: 2020.02.20
# License: MIT
@marshki
marshki / generate_stuff.sh
Last active October 24, 2020 15:35
Create (small) dummy data in Bash.
#!/usr/bin/env bash
#
# generate_stuff
#
# Create dummy data. Used as a sandbox for testing:
# https://gist.github.com/marshki/693ad8682cd14cc11f8ff4babeb47ca7
#
# Author: M. Krinitz <mjk235 [at] nyu [dot] edu>
# Date: 2020.03.01
# 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 / untar_progress_bar.sh
Last active January 6, 2021 18:14
"Dialog" progress bar to monitor the extraction of a "tar" archive.
#!/usr/bin/env bash
#
# Untar progress bar
script=`basename "$0"`
program="Tar & Feather"
# Install pre-reqs:
sudo apt-get --yes install dialog pv
@marshki
marshki / bash_simple_menu.sh
Last active January 7, 2021 00:47
Bash menu template.
#!/usr/bin/env bash
#
# Simple menu
# Pause prompt.
# Suspend processing of script; display message prompting user to press [Enter] key to continue.
# $1-> Message (optional)
function pause() {
local message="$@"