Skip to content

Instantly share code, notes, and snippets.

@grahamc
grahamc / emacs-init-as-a-package.nix
Created February 27, 2017 14:39
Package your user's emacs init.el etc. in to your nix emacs itself
{ pkgs ? import <nixpkgs> {} }:
let
emacsPackaging = pkgs.emacsPackagesNg;
my-mode = emacsPackaging.trivialBuild {
pname = "my-mode";
version = "1970-01-01";
src = pkgs.writeText "default.el" ''
(global-set-key (kbd "<end>") 'end-of-line)
(global-set-key (kbd "<home>") 'beginning-of-line)
Pyramid14Env = pkgs.buildEnv {
name = "pyramid14env";
ignoreCollisions = true;
paths = with pkgs; [
python27Full
python27Packages.buildout
python27Packages.virtualenv
python27Packages.recursivePthLoader
pyramid14Packages.pyramid
pyramid14Packages.waitress
@tonyc
tonyc / gist:1384523
Last active February 6, 2023 04:05
Using strace and lsof

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)