I hereby claim:
- I am neilmock on github.
- I am neilmockrev (https://keybase.io/neilmockrev) on keybase.
- I have a public key ASDxNgDNAbImg8c0Ts2oDNfTeNGsbLgY6ErwcyAVqW5dJQo
To claim this, I am signing this object:
-- Two dashes start a one-line comment. | |
--[[ | |
Adding two ['s and ]'s makes it a | |
multi-line comment. | |
--]] | |
---------------------------------------------------- | |
-- 1. Variables and flow control. | |
---------------------------------------------------- |
I hereby claim:
To claim this, I am signing this object:
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:
;;; 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: |
# sourcing this file will define a bash functions that | |
# tries to run subsequent calls to emacs with 24 bit color. | |
# | |
# It sets TERM=xterm-emacs-leg if | |
# - we've created a user-local terminfo record for xterm-emacs-leg, and | |
# - we're using iTerm2 or something has set COLORTERM=truecolor | |
# | |
# This will cause emacs to use 24 bit color only when it will work, | |
# inside or outside of tmux. I haven't found a way to auto-detect Blink.sh yet. | |
# |
black = '#282828'; | |
red = '#CC241D'; // red | |
green = '#98971A'; // green | |
yellow = '#D78821'; // yellow | |
blue = '#458588'; // blue | |
magenta = '#B16286'; // pink | |
cyan = '#689D6A'; // cyan | |
white = '#A89984'; // light gray | |
lightBlack = '#928374'; // medium gray | |
lightRed = '#FB4934'; // red |
var theme = { | |
color: [ | |
"#88b4e7", | |
"#88b4e7", | |
"#88b4e7", | |
"#88b4e7", | |
"#88b4e7", | |
"#88b4e7", | |
"#88b4e7", | |
"#88b4e7", |
// A small SSH daemon providing bash sessions | |
// | |
// Server: | |
// cd my/new/dir/ | |
// #generate server keypair | |
// ssh-keygen -t rsa | |
// go get -v . | |
// go run sshd.go | |
// | |
// Client: |