Skip to content

Instantly share code, notes, and snippets.

@ychaouche
Last active September 11, 2024 15:17
Show Gist options
  • Save ychaouche/18ec2f37851977e953c741a474dd8aef to your computer and use it in GitHub Desktop.
Save ychaouche/18ec2f37851977e953c741a474dd8aef to your computer and use it in GitHub Desktop.
# -*- shell-script -*-
export INTERFACE="eth4"
export PATH="$PATH":~/SYNCHRO/bin/ # put the path to where net.ip.private is
export BOOTTIME=$(sys.boottime)
1. Download sys.boottime to a bin directory in your $PATH
2. download .bashrc_emacs in your $HOME
3. add (setenv "BASH_ENV" (expand-file-name "~/.bashrc_emacs")) to your init.el or any buffer (*scratch* is just fine) and evaluate it with C-x C-e
4. now try to invoke any shell command with M-!, for example M-! date RET.
In my case, emacs just froze.
;; add this to your init.el
(setenv "BASH_ENV" (expand-file-name "~/.bashrc_emacs"))
#!/bin/bash
last reboot | awk 'NR == 1 {print $5,$6,$7,$8}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment