Skip to content

Instantly share code, notes, and snippets.

Binding and Unbinding to Active Directory from Mac OS via Command Line

  • Open the Terminal Application
  • Type in sudo -i and type in your Mac Administrator account password. sudo gives you root level or administrator level privileges.

To View current Active Directory Settings

dsconfigad -show

To Unbind a Computer from an Active Directory Domain

@papamoose
papamoose / gist:d22dec424d53c172a0bc39f2cf1f5ae0
Created November 3, 2017 16:24 — forked from kbarber/gist:6456420
Renewing a Puppet CA cert
Renew Puppet CA cert.
Not the perfect idea, but should alleviate the need to resign every cert.
What you need from existing puppet ssl directory:
ca/ca_crt.pem
ca/ca_key.pem
Create an openssl.cnf:
[ca]
@papamoose
papamoose / README.md
Created January 26, 2018 20:24 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@papamoose
papamoose / pg_stat_statements
Created February 7, 2018 23:57 — forked from troyk/pg_stat_statements
enable postgres pg_stat_statements
1) see re: increasing shmmax http://stackoverflow.com/a/10629164/1283020
2) add to postgresql.conf:
shared_preload_libraries = 'pg_stat_statements' # (change requires restart)
136 pg_stat_statements.max = 1000
137 pg_stat_statements.track = all
3) restart postgres
4) check it out in psql
@papamoose
papamoose / simp_le-howto.md
Created February 18, 2018 01:13 — forked from ykarikos/simp_le-howto.md
Howto start using Letsencrypt with simp_le

Howto start using Letsencrypt with simp_le

What I had:

What I wanted:

  • A Letsencrypt certificate for Apache, Postfix and Dovecot
  • Simple tool for managing certificates that does need root privileges
  • Automatic renewal
@papamoose
papamoose / lsof_funcs.py
Created May 7, 2018 16:56 — forked from lebedov/lsof_funcs.py
Python functions for finding open files and PIDs that have opened a file.
#!/usr/bin/env python
"""
Python functions for finding open files and PIDs that have opened a file.
"""
import numbers
import subprocess
try:
@papamoose
papamoose / python3_virtualenv.txt
Created July 12, 2018 17:36 — forked from wynemo/python3_virtualenv.txt
creating a python3 virtualenv environment
#install gcc git build-essential python3
$ sudo aptitude install gcc git build-essential python3
#from http://www.pip-installer.org/en/latest/installing.html
$ curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py
$ mkdir python3_prole
$ cd python3_prole/
$ python virtualenv.py -p /usr/bin/python3 env
$ python virtualenv.py --relocatable -p /usr/bin/python3 env
@papamoose
papamoose / _INSTALL.md
Last active October 1, 2019 16:38 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@papamoose
papamoose / kextidentifiers.py
Created August 7, 2019 16:24 — forked from erikng/kextidentifiers.py
kextidentifiers.py
#!/usr/bin/python
# For mojave only
# In order for this to work, you will need to go to System Preferences in Mojave -> Security & Privacy -> Privacy -> Full Disk Access and grant Terminal.app permissions
import sqlite3
conn = sqlite3.connect('/var/db/SystemPolicyConfiguration/KextPolicy')
c = conn.cursor()
query = 'SELECT * FROM kext_policy'
c.execute(query)
@papamoose
papamoose / tmux-cheatsheet.markdown
Created December 28, 2020 19:50 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname