Skip to content

Instantly share code, notes, and snippets.

View ralexx's full-sized avatar

Rob Alexander ralexx

View GitHub Profile
@ralexx
ralexx / available_conn.sql
Created December 9, 2019 16:37
Postgresql available connections
-- https://dba.stackexchange.com/a/161761
SELECT
max_conn,
used,
res_for_super,
max_conn-used-res_for_super res_for_normal
FROM
(
SELECT
COUNT(*) used
@ralexx
ralexx / connection_status.sql
Created December 9, 2019 17:08
Status information on active/idle Postgresql connections
SELECT
datid,
datname,
pid,
backend_type,
application_name,
--xact_start,
query_start,
state_change,
--wait_event_type,
@ralexx
ralexx / mutt_mods.md
Created August 26, 2020 21:03
Allow mutt to write to mailbox

Upgrades break custom settings

Homebrew upgrades will overwrite the settings file linked to /usr/local/etc/Muttrc (e.g. /usr/local/Cellar/mutt/1.14.6/etc/Muttrc). Copying over it will restore customized settings. cp ~/repos/dotfiles/Muttrc /usr/local/etc/Muttrc

Set correct permissions

https://lists.debian.org/debian-user/2002/01/msg00172.html

  • The user does not matter but the group must be 'mail'.
  • Permissions do matter.
chown root:mail /usr/local/bin/mutt_dotlock
def recursive_defaultdict():
"""x = recursive_defaultdict()
x['key0']['key1'] = 'value' # etc."""
return defaultdict(recursive_defaultdict)
@ralexx
ralexx / tweak_samba.sh
Last active November 24, 2024 06:12
macOS samba tuning
#!/bin/bash
# https://www.reddit.com/r/MacOS/comments/18sjnwb/comment/kf9az6i/
# https://gist.github.com/jbfriedrich/49b186473486ac72c4fe194af01288be
sudo -s
cp /private/etc/nsmb.conf /private/etc/nsmb.conf.bak
sudo echo "[default]\nsigning_required=no\nstreams=yes\nnotify_off=yes\nport445=no_netbios\nunix extensions = no\nveto files=/._*/.DS_Store/\nprotocol_vers_map=4" >> /etc/nsmb.conf
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
exit
sudo dscacheutil -flushcache