Skip to content

Instantly share code, notes, and snippets.

View con-f-use's full-sized avatar
💭
😱

con-f-use

💭
😱
  • A University, An IT Firm
  • Europe
View GitHub Profile
@gruber
gruber / inline2ref.rb
Created September 9, 2011 21:25 — forked from ttscoff/inline2ref.rb
Convert inline Markdown links to references
#!/usr/bin/env ruby
def e_sh(str)
str.to_s.gsub(/(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF\n])/n, '\\').gsub(/\n/, "'\n'").sub(/^$/, "''")
end
def find_headers(lines)
in_headers = false
lines.each_with_index {|line, i|
if line =~ /^\S[^\:]+\:( .*?)?$/
@chronossc
chronossc / devpi-server-article.md
Created November 25, 2013 04:00
Article/how to about how install devpy-server (not finished yet)

dev-pi install howto

This guide follow instructions in the devpi quickstart server guide. We will install in own user home using virtualenvs, than, will setup a nginx instance. Server used here is Ubuntu Server 12.04 LTS in one virtualbox instance.

Create devpi user

root ~ # useradd -m -U -s /bin/bash devpi
root ~ # passwd devpi
@lucabrunox
lucabrunox / autotools.nix
Last active December 2, 2021 18:16
Nix pill 12
pkgs: attrs:
with pkgs;
let defaultAttrs = {
builder = "${bash}/bin/bash";
args = [ ./builder.sh ];
setup = ./setup.sh;
baseInputs = [ gnutar gzip gnumake gcc binutils coreutils gawk gnused gnugrep patchelf findutils ];
buildInputs = [];
system = builtins.currentSystem;
};
@kennethlove
kennethlove / books.py
Last active December 5, 2018 00:26
Smarter book object.
class Book:
title = ''
pages = 0
def __init__(self, title='', pages=0):
self.title = title
self.pages = pages
def __add__(self, other):
"""Control adding two Books together or a Book and a number"""
@benley
benley / nix-profile.sh
Created January 6, 2015 07:57
tweaked nix login script
# Heavily cribbed from the equivalent NixOS login script.
# This should work better with multi-user nix setups.
export NIXPKGS_CONFIG="/etc/nix/nixpkgs-config.nix"
export NIX_OTHER_STORES="/run/nix/remote-stores/*/nix"
export NIX_USER_PROFILE_DIR="/nix/var/nix/profiles/per-user/$USER"
export NIX_PROFILES="/nix/var/nix/profiles/default $HOME/.nix-profile"
export NIX_PATH="/nix/var/nix/profiles/per-user/root/channels"
export PATH="$HOME/.nix-profile/bin:$HOME/.nix-profile/sbin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:$PATH"
@martijnvermaat
martijnvermaat / nixos.md
Last active November 14, 2024 04:15
Installation of NixOS with encrypted root
@nic0-lab
nic0-lab / gist:9ad496ef8ba0cc7bd19c4689499ef646
Created June 4, 2017 15:33
Config Vim as a Python IDE by Martin Brochhaus
" Sample .vimrc file by Martin Brochhaus
" Presented at PyCon APAC 2012
" ============================================
" Note to myself:
" DO NOT USE <C-z> FOR SAVING WHEN PRESENTING!
" ============================================
@lheckemann
lheckemann / 0-readme.md
Last active March 11, 2024 13:11
Expression for a buildEnv-based declarative user environment.

Expression for a buildEnv-based declarative user environment

This is one way of managing your user profile declaratively.

Alternatives include:

  • an attrset-based nix-env-based environment, installed using nix-env -ir rather than nix-env --set. LnL has an overlay which shows a way of doing this.
  • home-manager, which provides NixOS-like config for your $HOME

Note that this is incompatible with regular imperative use of nix-env, e.g. nix-env -iA nixpkgs.hello. It has the advantage of allowing the installation of multiple outputs of the same package much better than nix-env's builtin profile builder does.

@caadar
caadar / autologin-tty-nixos.org
Last active July 29, 2024 04:26
How to make a user autologin at the console on NixOS

Autologin a user at the console (NixOS)

Problem

NixOS provide services.mingetty.autologinUser option, but it can’t be used for the specific TTY.

Minimal working example

TTY1 and user “guest”:

# Import python packages which are installed in the nix store
# Note you NEED this if you install it via environment.systemPackages
# E.g environment.systemPackages = with pkgs; [ python27Packages.tensorflowWithCuda ]
# You DON'T NEED this if you do it like this:
# python-with-my-packages = pkgs.python27.withPackages (ps: with ps; [ tensorflowWithCuda]);
# environment.systemPackages = [ python-with-my-packages ]
import sys