Skip to content

Instantly share code, notes, and snippets.

View henri's full-sized avatar
💭
hacking the mainframe

henri henri

💭
hacking the mainframe
View GitHub Profile
@henri
henri / ghostbuster
Created February 14, 2024 22:08 — forked from thunderpoot/ghostbuster
Mosh: You have N detached Mosh sessions on this server
#!/bin/bash
# You know that really annoying message that pops up...
# Mosh: You have 3 detached Mosh sessions on this server, with PIDs:
# - mosh [2294539]
# - mosh [1874313]
# - mosh [2294805]
# I often find myself copying this list of PIDs in order to kill them manually
git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"
git config --global credential.helper cache
Summary How to control (or Understand) your GIST page's files list order.
Notice not official documentation.
@henri
henri / clone-gists.py
Created August 3, 2021 23:12 — forked from SpotlightKid/clone-gists.py
Clone all gists of GitHub username given on the command line.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Clone all gists of GitHub user with given username.
Clones all gist repos into the current directory, using the gist id as the
directory name. If the directory already exists as a git repo, try to perform a
'git pull' in it.
"""
@henri
henri / mac-network-commands-cheat-sheet.md
Last active June 8, 2021 20:50 — forked from jjnilton/mac-network-commands-cheat-sheet.md
Mac Network Commands Cheat Sheet

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and stay salty.

Get an ip address for en0:

@henri
henri / disabling-macosx-notification-center.md
Created May 2, 2017 00:02 — forked from mikermcneil/disabling-macosx-notification-center.md
Disable/Enable Notification Center (MacOS X)

Toggle MacOS X Notification Center on or off

This gist is to remind me (and anyone else who it helps) how to quickly disable and re-enable Notification Center.

Set Up Bash Aliases

Installation

  1. Open your terminal (<⌘ + ␣ (spacebar)>, then type "terminal", then press <↩ (enter)>).
@henri
henri / restart_bluetooth.sh
Created March 22, 2017 02:43 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
#!/bin/sh
# Script by rtrouton
# Cleanup by Arjen van Bochoven (oct 2013)
# Get major OS version (uses uname -r and bash substitution)
# osvers is 10 for 10.6, 11 for 10.7, 12 for 10.8, etc.
osversionlong=$(uname -r)
osvers=${osversionlong/.*/}
# Checks to see if the OS on the Mac is >= 10.7