Skip to content

Instantly share code, notes, and snippets.

View owengriffin's full-sized avatar

Owen Griffin owengriffin

View GitHub Profile
@owengriffin
owengriffin / debian-sudo-man
Created January 21, 2011 20:54
Debian "sudo" man
-i The -i (simulate initial login) option runs the shell specified in
the passwd(5) entry of the user that the command is being run as.
The command name argument given to the shell begins with a ‘-’ to
tell the shell to run as a login shell. sudo attempts to change to
that user’s home directory before running the shell. It also ini‐
tializes the environment, leaving TERM unchanged, setting HOME,
SHELL, USER, LOGNAME, and PATH, and unsetting all other environment
variables. Note that because the shell to use is determined before
the sudoers file is parsed, a runas_default setting in sudoers will
@owengriffin
owengriffin / ubuntu-sudo-man
Created January 21, 2011 20:54
Ubuntu "sudo" man
The -i (simulate initial login) option runs the shell
specified in the passwd(5) entry of the target user as a
login shell. This means that login-specific resource files
such as .profile or .login will be read by the shell. If a
command is specified, it is passed to the shell for
execution. Otherwise, an interactive shell is executed.
sudo attempts to change to that user's home directory
before running the shell. It also initializes the
environment, leaving DISPLAY and TERM unchanged, setting
HOME, SHELL, USER, LOGNAME, and PATH, as well as the
@owengriffin
owengriffin / tags.rb
Created March 22, 2011 19:11
A nanoc3 helper to facilitate generating items tag clouds and pages for tags
module Nanoc3
class Site
def tags
collect_all_tags if @tags == nil
@tags
end
def collect_all_tags
@owengriffin
owengriffin / Rules
Created March 25, 2011 20:18
Gist data source for Nanoc3
compile '/gist/*' do
filter :kramdown
layout 'kind_gist'
end
@owengriffin
owengriffin / related_articles_help.rb
Created March 27, 2011 16:22
Nanoc helper to list articles related to the current item