Skip to content

Instantly share code, notes, and snippets.

@kconner
kconner / macOS Internals.md
Last active May 10, 2024 17:04
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

The PiSugar2 is a battery board for the Raspberry Pi Zero. It has an integrated RTC chip available over I2C, but there are no drivers included in the kernel with the latest release of the pwnagotchi (or Kali in general). It's a ZXW Shenzhen SD3078; there is surprisingly little information out there about this chip. I suspect it's newish.

The PiSugar folks expect you to install Pisugar Power Manager, which is a web service to get battery status and set the RTC. I prefer to use the standard hwclock utility, because I don't need the extra function in the web interface. There is driver support for this chip in kernels 5.1 or newer, so we can grab that and compile it as an out of tree module. You may be able to adapt these ins

#!/usr/bin/bash
echo "Checking the bus for any Nvidia cards.."
if lspci | grep NVIDIA
then
echo "Nvidia GPU detected!"
echo "Switching to Nvidia..."
if pacman -Qe | grep mesa-libgl
then
yes | pacman -S nvidia-libgl lib32-nvidia-libgl
@step21
step21 / gist:547e0c9b4bf070fb40972c1cc1ffefe4
Created September 14, 2016 15:52 — forked from taylor/gist:8701482603d44a7c0057
my laptop-mode config differences from working x230 to new x230
ac97-powersave.conf
auto-hibernate.conf
--- /etc/laptop-mode/conf.d/auto-hibernate.conf 2014-09-07 13:38:23.000000000 -0500
+++ auto-hibernate.conf 2013-09-25 21:09:36.603610468 -0500
@@ -8,21 +8,21 @@
# Auto-hibernation settings
# -------------------------
#
-#__COMMENT Using these settings, you can make laptop mode tools automatically put your
-#__COMMENT computer into hibernation when the battery level goes critically low.
#!/usr/bin/bash
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# You would have to create an xorg.conf file for your Nvidia setup #
# before using this script! It can be done by running: #
# #
# nvidia-xconfig -o /etc/X11/xorg.conf.nvidia #
# #
# Make sure your system has eGPU connected and a monitor plugged into the GPU. #
# The reason I've never automated this is that you have to have it all plugged #
#!/usr/bin/bash
xconfig="/etc/X11/xorg.conf"
if [ -e "$xconfig" ]
then
echo "Nvidia xconfig detected"
echo "Switching to mesa..."
sudo pacman -S lib32-mesa-libgl mesa-libgl
sudo rm $xconfig
else
@squarism
squarism / iterm2.md
Last active May 6, 2024 22:59
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@orschiro
orschiro / tlp
Created March 25, 2015 08:06
X230 Linux Configuration
# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.
TLP_ENABLE=1
# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
@jbenet
jbenet / Makefile
Last active August 29, 2015 14:16
boot-to-ipfs
vmname="IPFS"
iso=/ipfs/QmdTmSQtCz9D6vt2AbvQkYo3edFcTYoU7FDmDD7bPWDccA/ipfs.iso
define notfound
$(iso) not found
make sure the daemon is running and mounted:
ipfs daemon &
ipfs mount
endef
export notfound
@taylor
taylor / gist:8701482603d44a7c0057
Created September 19, 2014 18:39
my laptop-mode config differences from working x230 to new x230
ac97-powersave.conf
auto-hibernate.conf
--- /etc/laptop-mode/conf.d/auto-hibernate.conf 2014-09-07 13:38:23.000000000 -0500
+++ auto-hibernate.conf 2013-09-25 21:09:36.603610468 -0500
@@ -8,21 +8,21 @@
# Auto-hibernation settings
# -------------------------
#
-#__COMMENT Using these settings, you can make laptop mode tools automatically put your
-#__COMMENT computer into hibernation when the battery level goes critically low.