Skip to content

Instantly share code, notes, and snippets.

View neilmock's full-sized avatar

Neil Mock neilmock

View GitHub Profile
@neilmock
neilmock / tmux-cheatsheet.markdown
Created June 14, 2022 15:42 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@neilmock
neilmock / python-setup-init.el
Created July 18, 2022 14:35 — forked from Nathan-Furnal/python-setup-init.el
Trimmed down python setup for Emacs. This is a basic `init.el` file for Python, you can pick the bits you like.
;;; init.el --- Fun stuff all around -*- lexical-binding: t; -*-
;;; Commentary:
;; This is a simple init.el which offers a Python configuration. Each package
;; usage is annotated with the how and why of its use. `use-package' is used to
;; manage the configuration as it provides lots of facilities to load modes,
;; define custom variables and key-maps, etc.
;;; Code:

You can inherit the environment variables from PID 1 by iterating over the list of null-terminated strings in /proc/1/environ, parsing the first characters up to the first = as the variable name, setting the remaining value as that variable, and exporting it.

The Code Snippet

This works with multiline environment variables, and environment variables with arbitrary values, like strings, including = or JSON blobs.

Paste this in your current terminal session to inherit the environment variables from PID 1: