Skip to content

Instantly share code, notes, and snippets.

View Otterpohl's full-sized avatar
🐌

Tristan Otterpohl Otterpohl

🐌
  • London
  • 16:08 (UTC +01:00)
View GitHub Profile
@Otterpohl
Otterpohl / Set-MaxServerMemory.sql
Created May 13, 2022 16:26
Calculate and set the max memory allocation
DECLARE @OS_TotalMemory INT
,@OS_CPUCount INT
,@OS_Reserved INT
,@SQL_MAlloc INT
SELECT @OS_TotalMemory = CAST(total_physical_memory_kb AS INT) / 1024 / 1024 FROM sys.dm_os_sys_memory
SELECT @OS_CPUCount = cpu_count FROM sys.dm_os_sys_info
SELECT @OS_Reserved = 4
SELECT @SQL_MAlloc = ((@OS_TotalMemory - (@OS_CPUCount * 0.5) - @OS_Reserved) - (@OS_TotalMemory - (@OS_CPUCount * 0.5) - @OS_Reserved) % 2) * 1024
# Left side
defaults write com.apple.dock persistent-apps -array-add '{tile-type="spacer-tile";}'
killall Dock
# Right Side
defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'
killall Dock
kind: Pod
apiVersion: v1
metadata:
name: volume-debugger
spec:
volumes:
- name: volume-to-debug
persistentVolumeClaim:
claimName: <pvc to mount>
containers:
xattr -d com.apple.quarantine /path/to/file
@Otterpohl
Otterpohl / RemovePort.yaml
Created November 9, 2023 11:11
Prometheus relabel config to remove port number
relabel_configs:
- source_labels: [__address__]
target_label: instance
regex: "([^:]+).*"
replacement: '${1}'