# HG changeset patch # User Steve Losh # Date 1530033538 14400 # Node ID 9eee230725387e1930bb92b05c24835809cb7e28 # Parent a1d399ef7d5465bc1fa89f245527f93f6fcc6598 Remove some unused cruft diff -r a1d399ef7d54 -r 9eee23072538 .pythonrc.py --- a/.pythonrc.py Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -from see import see diff -r a1d399ef7d54 -r 9eee23072538 addcss.js --- a/addcss.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -javascript:(function(){sjlCss=document.createElement('link');sjlCss.type='text/css';sjlCss.rel='stylesheet';sjlCss.href='http://stevelosh.com/media/css/fixer.css';document.getElementsByTagName("head")[0].appendChild(sjlCss)}()); diff -r a1d399ef7d54 -r 9eee23072538 bcvi/bcvi --- a/bcvi/bcvi Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1563 +0,0 @@ -#!/usr/bin/perl -############################################################################## -# -# Script: bcvi -# -# The 'Back-Channel vim' tool works with SSH to allow commands which are run -# on an SSH server to invoke processes back on the originating SSH client -# machine. -# -# Use 'bcvi --help' for the documentation -# -# Copyright (c) 2007-2010 Grant McLean -# - -use strict; -use warnings; - -require 5.008; - -############################################################################## -# This package implements some common functionality required by both the -# client and the server. -# -# It also serves as the entry-point for the command-line script. -############################################################################## - -package App::BCVI; -BEGIN { - $App::BCVI::VERSION = '3.05'; -} - -use File::Spec; -use File::Path; -use Getopt::Long qw(); -use Encode qw(encode decode); -use IO::Socket::INET; - -my %class_map = ( - base => 'App::BCVI', - client => 'App::BCVI::Client', - server => 'App::BCVI::Server', - pod => 'App::BCVI::POD', -); - -my %response_message = ( - 100 => "Ready ($App::BCVI::VERSION)", - 200 => "Success", - 300 => "Response follows", - 900 => "Permission denied", - 910 => "Unrecognised command", -); - -my $LF = "\x0A"; - -my( - %options, %option_name, %commands, @aliases, @installables, - %plugin_loaded, @plugins, -); - -run(@ARGV) unless caller(); # Don't run anything if loaded via 'require' - -sub run { - App::BCVI->base_init(); - - App::BCVI->load_plugins(); - - App::BCVI->base_class()->process_command_line(@_); - - exit; -} - -sub version { return $App::BCVI::VERSION; } -sub base_class { return $class_map{base}; } -sub client_class { return $class_map{client}; } -sub server_class { return $class_map{server}; } -sub pod_class { return $class_map{pod}; } -sub map_class { $class_map{$_[1]} = $_[2]; } -sub sock { shift->{sock}; } - -sub installable_files { return @installables; } -sub message_from_code { $response_message{$_[1]}; } - -sub base_init { - my($class) = @_; - - $class->register_option( - name => 'help', - alias => '?', - dispatch_to => 'show_help', - summary => 'detailed help message', - description => <<'END_POD' -Display this documentation. -END_POD - ); - - $class->register_option( - name => 'add-aliases', - dispatch_to => 'add_aliases', - summary => 'install bcvi into shell startup files', - description => <<'END_POD' -Edit the bash startup script to add (or update) the required command aliases -for bcvi. -END_POD - ); - - $class->register_option( - name => 'listener', - alias => 'l', - dispatch_to => 'start_listener', - summary => 'start in listener mode', - description => <<'END_POD' -Start a background listener process. Also generates a new authentication key. -END_POD - ); - - $class->register_option( - name => 'install', - arg_name => '', - dispatch_to => 'install_to_hosts', - summary => 'copy bcvi to named hosts and install aliases', - description => <<'END_POD' -Copy the C script to the C<$HOME/bin> directory on the specified host -and then remotely invoke it with the C<--add-aliases> option. -END_POD - ); - - $class->register_option( - name => 'unpack-term', - dispatch_to => 'unpack_term', - summary => 'unpack the overloaded TERM variable', - description => <<'END_POD' -This option is intended for use from a F<.profile> script. It outputs a -snippet of shell script to be passed to C in the calling shell. -END_POD - ); - - $class->register_option( - name => 'wrap-ssh', - alias => 's', - dispatch_to => 'wrap_ssh', - summary => 'pass all args after -- to ssh', - description => <<'END_POD' -A wrapper around invoking ssh to connect to a specified host. Ensures the -environment is set up to pass the authentication key and other data to the -C client on the remote server. -END_POD - ); - - $class->register_option( - name => 'version', - alias => 'v', - dispatch_to => 'show_versions', - summary => 'display bcvi version number', - description => <<'END_POD' -When invoking a command use this option to indicate that the arguments are not -filenames and the translation of relative pathnames to absolute should be -skipped. -END_POD - ); - - $class->register_option( - name => 'no-path-xlate', - alias => 'n', - summary => 'skip translation of args from relative to absolute', - description => <<'END_POD' -Displays the version number of the bcvi client and if applicable, of the -listener process. -END_POD - ); - - $class->register_option( - name => 'port', - alias => 'p', - arg_spec => '=i', - arg_name => '', - summary => 'port number for listener/port-forward', - description => <<'END_POD' -When used with C<--listener>, this is the port the server process will listen -on. When used with C<--wrap-ssh> this is the port number on the remote machine -that will be forwarded back to the listener process. The default in both cases -is calculated using the user's numeric UID multiplied by 10 and added to 9. -The intent is to reduce the chance of collisions with other bcvi users. -END_POD - ); - - $class->register_option( - name => 'command', - alias => 'c', - arg_spec => '=s', - arg_name => '', - summary => 'command to send over back-channel', - description => <<'END_POD' -Use C as the command to send over the back-channel (default: vi). -Recognised commands are described in L below. -END_POD - ); - - $class->register_option( - name => 'reuse-auth', - summary => "don't generate a new auth key on listener startup", - description => <<'END_POD' -A new (random) authorisation key is generated when the listener process is -started - this will invalidate the keys in use by existing SSH sessions. -This option is for use when it is necessary to restart the listener process -without invalidating client keys. -END_POD - ); - - $class->register_option( - name => 'plugin-help', - arg_spec => '=s', - arg_name => '', - dispatch_to => 'plugin_help', - summary => "display documentation for ", - description => <<'END_POD' -The --help output includes a list of installed plugins. Use this option to -read the documentation for a named plugin. -END_POD - ); - - - $class->register_command( - name => 'vi', - description => <<'END_POD' -Invokes C on the remote file - after translating the host+path to -an scp URI. This is the default command if no C<--command> option is -specified. If multiple filenames are supplied, the first will be opened -in gvim and you should use C<:n> to load the 'next' file. -END_POD - ); - - $class->register_command( - name => 'viwait', - description => <<'END_POD' -This command works exactly the same as C above, except it waits for the -editor process to exit before bcvi exits on the remote machine. This is -primarily for use with C. Note: when used with C, the file -will not be updated on the remote machine until you exit the editor on your -workstation. -END_POD - ); - - $class->register_command( - name => 'scpd', - description => <<'END_POD' -Uses C to copy the specified files or directories to the calling user's -F<~/Desktop>.` -END_POD - ); - - - $class->add_home_bin(); - $class->register_aliases( - 'test -n "$(which bcvi)" && eval "$(bcvi --unpack-term)"', - 'test -n "${BCVI_CONF}" && alias vi="bcvi"', - 'test -n "${BCVI_CONF}" && alias suvi="EDITOR=\'bcvi -c viwait\' sudoedit"', - 'test -n "${BCVI_CONF}" && alias bcp="bcvi -c scpd"', - ); - - $class->pod_class->init(); - -} - - -sub register_option { - my $class = shift; - my $opt = { @_ }; - my $key = $opt->{name}; - - if(!defined $key or !length $key) { - die "Can't register option without 'name'"; - } - - my($package, $filename, $line) = caller(); - $opt->{provider} = "$package at $filename line $line"; - my $taken = $options{$key}; - if($taken && !$opt->{force_override}) { - warn "option '--$key' already registered by $taken->{provider}\n"; - } - if($opt->{alias}) { - foreach my $a (map { s/^-+//; $_ } split /\|/, $opt->{alias}) { - if($option_name{$a} && !$opt->{force_override}) { - if($taken = $options{$option_name{$a}}) { - warn "alias '$a' already registered for option " - . "'--$taken->{name}' by $taken->{provider}\n"; - } - } - $option_name{$a} = $key; - } - } - $options{$key} = $opt; -} - - -sub register_command { - my $class = shift; - my $cmd = { @_ }; - my $key = $cmd->{name}; - - if(!defined $key or !length $key) { - die "Can't register command without 'name'"; - } - - $cmd->{dispatch_to} ||= "execute_$key"; - - my($package, $filename, $line) = caller(); - $cmd->{provider} = "$package at $filename line $line"; - warn "option '$key' already registered by $commands{$key}->{provider}\n" - if $commands{$key} && !$cmd->{force_override}; - $commands{$key} = $cmd; -} - - -sub each_option { - my($class, $sub) = @_; - - $sub->($options{$_}) foreach sort keys %options; -} - - -sub each_command { - my($class, $sub) = @_; - - $sub->($commands{$_}) foreach sort keys %commands; -} - - -sub command_handler { - my($class, $name) = @_; - - return unless defined $name; - return "execute_commands_pod" if $name eq 'commands_pod'; - my $spec = $commands{$name} or return; - return $spec->{dispatch_to}; -} - - -sub add_home_bin { - my $class = shift; - my $home_bin = $class->home_directory . '/bin'; - $class->register_aliases( - qq{echo \$PATH | grep -q $home_bin || PATH="$home_bin/\$PATH"}, - ); -} - - -sub register_aliases { - my $class = shift; - push @aliases, @_; -} - - -sub register_installable { - my $class = shift; - my($package, $filename, $line) = caller(); - push @installables, $filename; -} - - -sub shell_aliases { - my($self) = @_; - - return - "## START-BCVI\n" - . join("\n", map { " $_" } @aliases) - . "\n## END-BCVI\n"; -} - - -sub load_plugins { - my($class) = @_; - - my $dir = $class->conf_directory(); - foreach my $file (sort glob("$dir/*.pm")) { - $class->load_plugin_file($file); - } -} - - -sub load_plugin_file { - my($class, $file) = @_; - - my @parts = File::Spec->splitdir($file); - my $key = pop @parts; - return if $plugin_loaded{$key}; - - eval { require $file; }; - if($@) { - die qq{Error loading plugin "$file"\n$@\n} - } - - $plugin_loaded{$key} = $file; -} - - -sub hook_client_class { - my($class) = @_; - - my($calling_class, $calling_file) = caller(); - my $client_class = $class->client_class(); - $class->map_class(client => $calling_class); - - no strict 'refs'; - unshift @{"${calling_class}::ISA"}, $client_class; - push @plugins, { class => $calling_class, file => $calling_file }; - return 1; -} - - -sub hook_server_class { - my($class) = @_; - - my($calling_class, $calling_file) = caller(); - my $server_class = $class->server_class(); - $class->map_class(server => $calling_class); - - no strict 'refs'; - unshift @{"${calling_class}::ISA"}, $server_class; - push @plugins, { class => $calling_class, file => $calling_file }; - return 1; -} - - -sub process_command_line { - my($class, @args) = @_; - - my $opt = $class->option_defaults(); - my @cfg = $class->getopt_config(); - - local(@ARGV) = @args; - Getopt::Long::GetOptions($opt, @cfg) or $class->die_synopsis(); - - my $handler = $opt->{listener} - ? $class->server_class - : $class->client_class; - - $handler->new(_options => $opt)->dispatch(@ARGV); -} - - -sub option_defaults { - return { }; -} - - -sub getopt_config { - my($class) = @_; - - my @spec; - $class->each_option(sub { - my($o) = @_; - my $def = $o->{name}; - $def .= "|$o->{alias}" if defined $o->{alias}; - $def .= $o->{arg_spec} if defined $o->{arg_spec}; - push @spec, $def; - }); - return @spec -} - - -sub die_synopsis { - my($class, $message) = @_; - - warn "$message\n" if $message; - $class->pod_class->synopsis(); - exit(1); -} - - -sub new { - my $class = shift; - - return bless { @_ }, $class; -} - - -sub dispatch { - my($self, @args) = @_; - - if(my $method = $self->dispatch_option) { - $self->$method(@args); - exit; - } - elsif(!$self->opt('command') and !@args) { - $self->die_synopsis(); - } - - $self->send_command(@args); -} - - -sub opt { - my($self, $key) = @_; - - return $self->{_options}->{$key}; -} - - -sub set_opt { - my($self, $key, $value) = @_; - - return $self->{_options}->{$key} = $value; -} - - -sub dispatch_option { - my($self) = @_; - - my @set; - $self->each_option(sub { - my($o) = @_; - push @set, $o if $o->{dispatch_to} && defined $self->opt($o->{name}); - }); - return unless @set; - if(@set > 1) { - @set = map { "--$_->{name}" } @set; - my $last = pop @set; - $self->die_synopsis( - "Which did you want: " . join(', ', @set) . " or $last?" - ); - } - return $set[0]->{dispatch_to}; -} - - -sub default_port { - return( ($< * 10 + 9) % 65536 ); -} - - -sub listen_address { - return 'localhost'; -}; - - -sub default_command { - return 'vi'; -} - - -sub read_file { - my($self, $path) = @_; - - return unless -e $path; - return if -d $path; - my $data = do { - open my $fh, '<', $path or die "open($path): $!\n"; - local($/) = undef; - <$fh>; - }; - return $data; -} - - -sub home_directory { - return (getpwuid($>))[7]; -} - - -sub conf_directory { - my($self) = @_; - - my $conf_dir = File::Spec->catdir($self->home_directory(), '.config', 'bcvi'); - File::Path::mkpath($conf_dir) unless -d $conf_dir; - return $conf_dir; -} - - -sub auth_key_filename { - return File::Spec->catfile(shift->conf_directory(), 'listener_key'); -} - - -sub listener_port_filename { - return File::Spec->catfile(shift->conf_directory(), 'listener_port'); -} - - -sub get_listener_auth_key { - my($self) = @_; - - my $auth_file = $self->auth_key_filename(); - my $auth_key = $self->read_file($auth_file) - or die "Auth key file does not exist: $auth_file"; - chomp($auth_key); - return $auth_key; -} - - -sub list_plugins { - my($self) = @_; - - my @plugins; - foreach my $name (sort keys %plugin_loaded) { - my $path = $plugin_loaded{$name}; - $name =~ s{[.]pm$}{}; - if(my $title = $self->pod_class->extract_title($path)) { - push @plugins, "$name - $title"; - } - else { - push @plugins, "$name - no documentation"; - } - } - return @plugins; -} - - -sub plugin_help { - my($self) = @_; - - my $plugin = $self->opt('plugin-help'); - if(my $path = $plugin_loaded{"${plugin}.pm"}) { - $self->pod_class->show_plugin_help($path); - } - else { - die "Can't find plugin: '$plugin'\n"; - } -} - - -############################################################################## -# The App::BCVI::Client class implements the command-line UI and the client -# side of the BCVI protocol. You can use inheritance to customise the -# behaviour of this class. -############################################################################## - -package App::BCVI::Client; -BEGIN { - $App::BCVI::Client::VERSION = '3.05'; -} - -BEGIN { @App::BCVI::Client::ISA = qw( App::BCVI ); } - - -sub get_connection_details { - my($self) = @_; - - if(not $ENV{BCVI_CONF}) { - die "The \$BCVI_CONF environment variable has not been set\n"; - } - my($alias, $gateway, $port, $auth_key) = split(/:/, $ENV{BCVI_CONF}); - $self->{host_alias} = $alias; - $self->{gateway_address} = $gateway; - $self->{port} = $port; - $self->{auth_key} = $auth_key; -} - - -sub host_alias { return shift->{host_alias}; } -sub gateway_address { return shift->{gateway_address}; } -sub port { return shift->{port}; } -sub auth_key { return shift->{auth_key}; } -sub server_version { return shift->{server_version}; } -sub response_code { return shift->{response_code}; } -sub response_message { return shift->{response_message}; } -sub response { return shift->{response}; } - - -sub send_command { - my($self, @files) = @_; - - my $command = $self->opt('command') || $self->default_command(); - - my $sock = $self->connect_to_listener(); - - $sock->write( - "Auth-Key: " . $self->auth_key . $LF . - "Host-Alias: " . $self->host_alias . $LF . - "Command: " . $command . $LF - ) or die "Error sending command through backchannel: $!"; - - $self->send_body(\@files); - return if $self->check_response() =~ /^(?:200|300)$/; - die $self->response_message . "\n"; -} - - -sub send_body { - my($self, $files) = @_; - - my $translate_paths = ! $self->opt('no-path-xlate'); - - my $body = join '', map { - $_ = File::Spec->rel2abs($_) if $translate_paths; - "$_$LF"; - } @$files; - - $self->sock->write( - 'Content-Length: ' . length($body) . $LF . - $LF . - $body - ) or die "Error sending command through backchannel: $!"; -} - - -sub check_response { - my($self) = @_; - - my $response = $self->sock->getline() or die "Server hung up\n"; - if(my($code, $message) = $response =~ m{^(\d\d\d) (.*)$}) { - ($self->{response_code}, $self->{response_message}) = ($code, $message); - $self->read_response() if $code eq '300'; - return $code; - } - die "Unexpected response: '$response'\n"; -} - - -sub read_response { - my($self) = @_; - - my $sock = $self->sock(); - my $resp = {}; - while(my($line) = $sock->getline() || '') { - chomp($line); - last if $line eq ''; - $line = Encode::decode('utf8', $line); - if(my($name, $value) = $line =~ m{^(\S+)\s*:\s*(.*)$}) { - $name =~ s/-/_/; - $resp->{lc($name)} = $value; - } - } - $self->{response} = $resp; - - my $bytes = $resp->{content_length} || return;; - - my $buf = ''; - while(my $count = $sock->read($buf, $bytes, length($buf))) { - $bytes -= $count; - last if $bytes < 1; - } - $resp->{body} = $buf; -} - - -sub connect_to_listener { - my($self) = @_; - - $self->get_connection_details(); - - my $peer = $self->gateway_address . ':' . $self->port; - my $sock = IO::Socket::INET->new( - PeerAddr => $peer, - ) or die "Can't connect to '$peer': $!\n"; - - binmode($sock); - my $welcome = $sock->getline() or die "No listener?\n"; - if($welcome =~ /^100 Ready \(([^)]+)\)/) { - $self->{server_version} = $1; - } - $self->{sock} = $sock; -} - - -sub show_versions { - my($self) = @_; - - print "bcvi client: $App::BCVI::VERSION\n"; - - if($ENV{BCVI_CONF}) { - $self->connect_to_listener(); - print "bcvi server: $App::BCVI::VERSION\n"; - } -} - - -sub show_help { - my($self) = @_; - - $self->pod_class->full_pod($self); -} - - -sub commands_pod { - my($self) = @_; - - eval { - $self->set_opt(command => 'commands_pod'); - $self->send_command(); - }; - if($@) { - $@ = ''; - return; - } - return $self->response->{body}; -} - - -sub wrap_ssh { - my($self, @args_in) = @_; - - if(my($target, @args_out) = $self->parse_ssh_args(@args_in)) { - $self->execute_wrapped_ssh($target, @args_out); - } - else { - warn "bcvi: unable to extract hostname from ssh command line\n"; - $self->execute_ssh(@args_in); - } -} - - -sub parse_ssh_args { - my($self, @args_in) = @_; - - my %need_arg = map { $_ => 1} split //, 'bcDeFiLlmOopRS'; - - my(@args_out, @hosts, $user); - while(@args_in) { - $_ = shift @args_in; - if(/^-l(.*)$/) { # extract username if specified with -l - $user = $1 ? $1 : $args_in[0]; - } - if(/^-(.)(.*)$/) { - push @args_out, $_; - push @args_out, shift @args_in - if $need_arg{$1} && !length($2) && @args_in; - } - else { - push @args_out, $_; - push @hosts, $_; - } - } - return unless @hosts == 1; - my($target) = @hosts; - if($user and $target !~ /@/) { - $target = $user . '@' . $target; - } - return($target, @args_out); -} - - -sub execute_wrapped_ssh { - my($self, $target, @args) = @_; - - my $remote_port = $self->opt('port') || $self->default_port(); - my $local_port = $self->listener_port(); - $ENV{TERM} = "$ENV{TERM}\n" - . "BCVI_CONF=${target}:localhost:$remote_port:" - . $self->get_listener_auth_key(); - unshift @args, "-R $remote_port:localhost:$local_port"; - $self->execute_ssh(@args); -} - - -sub execute_ssh { - my($self, @args) = @_; - - system 'ssh', @args; -} - - -sub listener_port { - my($self) = @_; - - my $port = $self->read_file($self->listener_port_filename()) - or return $self->default_port(); - chomp($port); - return $port; -} - - -sub unpack_term { - my($self) = @_; - - my @parts = split /\x0D?\x0A/, $ENV{TERM} || ''; - return unless @parts > 1; - print "TERM=$parts[0]\n"; - shift @parts; - foreach (@parts) { - print if s{^(\w+)=(.*)$}{export $1="$2"\n}; - } -} - - -sub install_to_hosts { - my($self, @args) = @_; - - die "You must list one or more target hostnames\n" unless @args; - - $self->install_to_host($_) foreach @args; -} - - -sub install_to_host { - my($self, $host) = @_; - - $self->install_bin_directory($host); - $self->install_bcvi_script($host); - $self->install_plugins($host); - $self->install_remote_aliases($host); -} - - -sub install_bin_directory { - my($self, $host) = @_; - - if(system("ssh $host test -d ./bin") != 0) { - print "Creating ~/bin directory on $host\n"; - system("ssh $host mkdir ./bin") == 0 - or die "** mkdir failed on $host"; - } -} - - -sub install_bcvi_script { - my($self, $host) = @_; - - print "Copying bcvi to remote bin directory on $host\n"; - my $output = `scp $0 $host:bin/bcvi 2>&1`; - if($? != 0) { - die "** failed to copy bcvi to remote bin directory on $host\n" - . $output; - } -} - - -sub install_plugins { - my($self, $host) = @_; - - return unless @installables; - if(system("ssh $host test -d ./.config/bcvi") != 0) { - print "Creating plugins directory on $host\n"; - system("ssh $host mkdir -p ./.config/bcvi") == 0 - or die "** mkdir failed on $host"; - } - print "Copying plugin files to $host\n"; - my $output = `scp @installables $host:.config/bcvi 2>&1`; - if($? != 0) { - die "** failed to copy bcvi to remote plugins directory on $host\n" - . $output; - } -} - - -sub install_remote_aliases { - my($self, $host) = @_; - - system("ssh $host bin/bcvi --add-aliases") == 0 - or die "** failed to install aliases on $host"; -} - - -sub add_aliases { - my($self) = @_; - - my $bcvi_commands = $self->shell_aliases(); - - $self->update_existing_aliases($bcvi_commands) - or $self->aliases_initial_install($bcvi_commands); -} - - -sub update_existing_aliases { - my($self, $bcvi_commands) = @_; - - foreach my $file ( $self->candidate_rc_files() ) { - my($script) = $self->read_file($file) or next; - if(index($script, $bcvi_commands) > -1) { - print "Found bcvi commands in $file\n"; - return 1; - } - if($script =~ s{^## START-BCVI.*^## END-BCVI\r?\n}{$bcvi_commands}sm) { - open my $fh, '>', $file or die "open($file): $!"; - print $fh $script; - close($fh); - print "Updated bcvi commands in $file\n"; - return 1; - } - if($script =~ m{^[^#]*\bbcvi\b}m) { - print "Adhoc bcvi commands found in $file\n" - . "*** Manual update may be required. ***\n" - . "*** Consider deleting commands and re-adding. ***\n"; - return 1; - } - } - return; # No existing aliases found -} - - -sub aliases_initial_install { - my($self, $bcvi_commands) = @_; - - my $target = $self->preferred_rc_file(); - - open my $fh, '>>', $target or die "open(>>$target): $!"; - print $fh "\n$bcvi_commands\n"; - close($fh); - print "Added bcvi commands to $target\n"; -} - - -sub candidate_rc_files { - my($self) = @_; - my $home = $self->home_directory(); - return( - "$home/.bashrc_local", - "$home/.bashrc", - "$home/.bash_profile_local", - "$home/.bash_profile", - "$home/.profile", - "$home/.common-configs/bashrc", - ); -} - - -sub preferred_rc_file { - my($self) = @_; - - # Add to .bashrc_local if it is referenced from .bashrc - - my $home = $self->home_directory(); - my $bashrc = "$home/.bashrc"; - my $bashrc_local = "$home/.bashrc_local"; - - my $script = $self->read_file($bashrc) || ''; - - return $script =~ m{/[.]bashrc_local\b} - ? $bashrc_local - : $bashrc; -} - - -############################################################################## -# The App::BCVI::Server class implements the server ('listener') side of the -# BCVI protocol. You can use inheritance to customise the behaviour of this -# class. -############################################################################## - -package App::BCVI::Server; -BEGIN { - $App::BCVI::Server::VERSION = '3.05'; -} - -BEGIN { @App::BCVI::Server::ISA = qw( App::BCVI ); } - -use Digest::MD5 qw(md5_hex); -use Errno qw(); - - -sub start_listener { - my($self) = @_; - - $self->kill_current_listener(); - $self->save_pid(); - $self->generate_auth_key(); - $self->create_listener_socket(); - $self->accept_loop(); - die "bcvi listener accept loop terminated unexpectedly\n"; -} - - -sub auth_key { shift->{auth_key}; } -sub client_sock { shift->{client}; } -sub request { shift->{request}; } -sub calling_host { shift->{request}->{host_alias}; } - - -sub kill_current_listener { - my($self) = @_; - - my($pid) = $self->read_file($self->pid_file) or return; - foreach my $i (1..5) { - if(kill 0, $pid) { - kill($i > 2 ? 9 : 1, $pid); - } - elsif($!{ESRCH}) { # no such process - return; - } - elsif($!{EPERM}) { # pid file was probably stale - return; - } - sleep 1; - } -} - - -sub save_pid { - my($self) = @_; - - my $pid_file = $self->pid_file; - open my $fh, '>', $pid_file or die "open(>$pid_file): $!"; - print $fh "$$\n"; -} - - -sub save_port { - my($self, $port) = @_; - - my $port_file = $self->listener_port_filename; - open my $fh, '>', $port_file or die "open(>$port_file): $!"; - print $fh "$port\n"; -} - - -sub pid_file { - return File::Spec->catfile(shift->conf_directory(), 'listener_pid'); -} - - -sub generate_auth_key { - my($self) = @_; - - if($self->opt('reuse-auth')) { - $self->{auth_key} = $self->get_listener_auth_key(); - return; - } - - my $data = "$self" . $$ . time() . rand(); - $self->{auth_key} = md5_hex($data); - - my $auth_file = $self->auth_key_filename(); - open my $fh, '>', $auth_file or die "open(>$auth_file): $!"; - print $fh $self->{auth_key}, "\n"; -} - - -sub create_listener_socket { - my($self) = @_; - - my $port = $self->opt('port') || $self->default_port(); - $self->save_port($port); - my $local_addr = $self->listen_address . ':' . $port; - $self->{sock} = IO::Socket::INET->new( - LocalAddr => $local_addr, - ReuseAddr => 1, - Proto => 'tcp', - Listen => 5, - Blocking => 1, - ) or die "Error creating listener for port '$local_addr': $!"; -} - - -sub accept_loop { - my($self) = @_; - - $SIG{CHLD} = 'IGNORE'; # let Perl reap the zombies - - my $sock = $self->sock(); - while(1) { - my $new = $sock->accept(); - next if $!{EINTR}; - if(fork()) { # In parent - close $new; - } - else { # In child - close $sock; - $self->{sock} = $new; - $self->dispatch_request(); - exit(0); - } - } -} - - -sub dispatch_request { - my($self) = @_; - - $self->send_response(100); - my $req = $self->collect_headers(); - $self->validate_auth_key($req->{auth_key}) - or $self->exit_response(900); - my $method = $self->command_handler($req->{command}) - or $self->exit_response(910); - $self->$method(); - $self->send_response(200); -} - - -sub validate_auth_key { - my($self, $key) = @_; - - return 1 if $key && $key eq $self->auth_key; - my $alias = $self->calling_host(); - warn "Invalid Auth-Key in request from $alias\n" if -t 2; - return; -} - - -sub send_response { - my($self, $code) = @_; - - my $message = $self->message_from_code($code) || 'Invalid response code'; - $message = Encode::encode('utf8', $message); - $self->sock->write(qq{$code $message\x0A}); -} - - -sub exit_response { - my($self, $code) = @_; - - $self->send_response($code); - exit(0); -} - - -sub collect_headers { - my($self) = @_; - - my $sock = $self->sock(); - my $req = {}; - while(my($line) = $sock->getline() || '') { - chomp($line); - last if $line eq ''; - $line = Encode::decode('utf8', $line); - if(my($name, $value) = $line =~ m{^(\S+)\s*:\s*(.*)$}) { - $name =~ s/-/_/; - $req->{lc($name)} = $value; - } - } - $self->{request} = $req; -} - - -sub read_request_body { - my($self) = @_; - - my $bytes = $self->request->{content_length}; - my $sock = $self->sock(); - my $buf = ''; - while(my $count = $sock->read($buf, $bytes, length($buf))) { - $bytes -= $count; - last if $bytes < 1; - } - return $buf; -} - - -sub get_filenames { - my($self) = @_; - - return split /\x0a/, Encode::decode('utf8', $self->read_request_body()); -} - - -sub execute_commands_pod { - my($self) = @_; - - $self->send_response(300); - my $pod = $self->pod_class->command_detail(); - $pod = Encode::encode('utf8', $pod); - $self->sock->write( - 'Content-Type: text/pod' . $LF . - 'Content-Length: ' . length($pod) . $LF . - $LF . - $pod - ) or die "Error sending response body: $!"; -} - - -sub execute_vi { - my($self) = @_; - - my $alias = $self->calling_host(); - my @files = map { "scp://$alias/$_" } $self->get_filenames(); - system('mvim', '--', @files); -} - - -sub execute_viwait { - my($self) = @_; - - my $alias = $self->calling_host(); - my @files = map { "scp://$alias/$_" } $self->get_filenames(); - system('mvim', '-f', '--', @files); -} - - -sub execute_scpd { - my($self) = @_; - - my $dest = File::Spec->catdir($self->home_directory(), 'Desktop'); - - my $alias = $self->calling_host(); - my @files = map { "$alias:$_" } $self->get_filenames(); - - system('scp', '-q', '-r', '--', @files, $dest); -} - - -############################################################################## -# The App::BCVI::POD class implements POD extraction and formatting on -# platforms where POD::Text is available. -############################################################################## - -package App::BCVI::POD; -BEGIN { - $App::BCVI::POD::VERSION = '3.05'; -} - -use Pod::Text; - -my $pod_skeleton; - - -sub init { - my($class) = @_; - - $pod_skeleton = do { - local($/) = undef; - ; - }; - close(DATA); -} - - -sub full_pod { - my($class, $app) = @_; - - my $commands_pod; - if($app && $app->can('commands_pod')) { - $commands_pod = $app->commands_pod(); - } - $commands_pod ||= $class->command_detail(); - my $plugins_pod = $class->plugins_pod($app); - - my $pager = $class->pager(); - my $pod = $pod_skeleton; - $pod =~ s{^=for BCVI_OPTIONS_SUMMARY\s*\n}{ $class->option_summary()}me; - $pod =~ s{^=for BCVI_OPTIONS\s*\n}{ $class->option_detail() }me; - $pod =~ s{^=for BCVI_COMMANDS\s*\n}{ $commands_pod }me; - $pod =~ s{^=for BCVI_PLUGINS\s*\n}{ $plugins_pod }me; - if(Pod::Text->isa('Pod::Simple')) { - my $parser = Pod::Text->new (sentence => 1, width => 78); - $parser->output_fh($pager); - $parser->parse_string_document($pod); - } - else { - open my $pod_fh, '<', \$pod or die "open(\$pod): $!"; - my $parser = Pod::Text->new (sentence => 1, width => 78); - $parser->parse_from_filehandle($pod_fh, $pager); - } -} - - -sub synopsis { - my($class) = @_; - - my $pod = $pod_skeleton; - $pod =~ s{\A.*?^=head1 SYNOPSIS\s*?\n}{Usage:}ms; - $pod =~ s{^=.*\z}{}ms; - $pod .= $class->option_summary(); - - print $pod; -} - - -sub option_summary { - my($class) = @_; - - my $w = 12; - my @lines; - App::BCVI->base_class->each_option(sub { - my($o) = @_; - my $short = "--$o->{name}"; - $short .= "|-$o->{alias}" if $o->{alias}; - $short .= " $o->{arg_name}" if $o->{arg_name}; - push @lines, [ $short, $o->{summary} ]; - $w = length($short) if length($short) > $w; - }); - - return join('', map { sprintf(" %-*s %s\n", $w, @$_) } @lines) . "\n"; -} - - -sub option_detail { - my($class) = @_; - - my @lines = "=over 4\n"; - App::BCVI->base_class->each_option(sub { - my($o) = @_; - my $pod = "\n=item B<--$o->{name}>"; - $pod .= " (alias: -$o->{alias})" if $o->{alias}; - $pod .= " $o->{arg_name}" if $o->{arg_name}; - $pod .= "\n\n$o->{description}\n"; - push @lines, $pod; - }); - push @lines, "\n=back\n\n"; - - return join '', @lines; -} - - -sub command_detail { - my($class) = @_; - - my @lines = "=over 4\n"; - App::BCVI->base_class->each_command(sub { - my($c) = @_; - my $pod = "\n=item B<$c->{name}>"; - $pod .= "\n\n$c->{description}\n"; - push @lines, $pod; - }); - push @lines, "\n=back\n\n"; - - return join '', @lines; -} - - -sub plugins_pod { - my($class, $app) = @_; - - if(my @plugin_list = $app->list_plugins()) { - my $s = @plugin_list == 1 ? '' : 's'; - return join("\n\n", - "You have the following plugin$s installed:", - @plugin_list, - "Use C<< bcvi --plugin-help plugin-name >> for detailed info.", - ) . "\n\n"; - } - - return "You have no plugins installed.\n\n"; -} - - -sub extract_title { - my($class, $path) = @_; - - open my $fh, '<', $path or return; - my $name_section = 0; - while(<$fh>) { - chomp; - if(/^=head1\s+NAME$/) { - $name_section++; - } - elsif($name_section and /\S/) { - s{^.+?\s-\s}{}; - return $_; - } - } - return; -} - - -sub show_plugin_help { - my($class, $path) = @_; - - my $pager = $class->pager(); - if(Pod::Text->isa('Pod::Simple')) { - my $parser = Pod::Text->new (sentence => 1, width => 78); - $parser->output_fh($pager); - $parser->parse_file($path); - } - else { - open my $pod_fh, '<', $path or die "open($path): $!"; - my $parser = Pod::Text->new (sentence => 1, width => 78); - $parser->parse_from_filehandle($pod_fh, $pager); - } -} - - -sub pager { - my @commands = $ENV{PAGER} ? ( $ENV{PAGER} ) : qw(pager less more); - foreach my $file (@commands) { - foreach my $dir ( File::Spec->path() ) { - my $exe_path = File::Spec->catfile($dir, $file); - if(-x $exe_path) { - open my $fh, '|-', $exe_path or next; - return $fh; - } - } - } - return \*STDOUT; -} - - -1; - -__DATA__ - -=head1 NAME - -bcvi - Back-channel vi, a shell utility to proxy commands back over ssh - -=head1 SYNOPSIS - - bcvi [options] [] - - Options: - -=for BCVI_OPTIONS_SUMMARY - -=head1 DESCRIPTION - -This utility works with SSH to allow commands issued on the SSH server host to -be 'proxied' back to the SSH client host. For example: - -=over 4 - -=item * - -user F establishes an SSH connection from her workstation to a server -named F and runs the command C - -=item * - -bcvi tunnels the details back to sally's workstation which then invokes the -command C - -=item * - -the result is that sally gets a responsive GUI editor running on her local -machine, but editing a file on the remote machine - -=back - -See C<< perldoc App::BCVI >> for more examples and background information. - -=head1 OPTIONS - -=for BCVI_OPTIONS - -=head1 COMMANDS - -The following commands can be passed back to the listener process. - -=for BCVI_COMMANDS - -=head1 USING BCVI - -You'll need to start a listener process on your workstation (perhaps from -your window manager session startup). - - bcvi -l & - -To install the bcvi client to a remote machine: - - bcvi --install - -To ssh to a server with tunnelling enabled: - - bcvi --wrap-ssh -- hostname - -To enable bcvi on all ssh connections: - - alias ssh="bcvi --wrap-ssh --" - -On a target server, you'll need to unpack the overloaded TERM variable: - - test -n "$(which bcvi)" && eval "$(bcvi --unpack-term)" - -To use vi over the back-channel: - - bcvi filename - -The installation to a remote server should set up aliases, e.g.: - - test -n "${BCVI_CONF}" && alias vi="bcvi" - test -n "${BCVI_CONF}" && alias bcp="bcvi -c scpd" - -=head1 PLUGINS - -=for BCVI_PLUGINS - -=head1 COPYRIGHT - -Copyright 2007-2010 Grant McLean Egrantm@cpan.orgE - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -=cut - - diff -r a1d399ef7d54 -r 9eee23072538 dotcss/amara.readthedocs.org.css --- a/dotcss/amara.readthedocs.org.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -readthedocs.org.css \ No newline at end of file diff -r a1d399ef7d54 -r 9eee23072538 dotcss/bank.simple.com.css --- a/dotcss/bank.simple.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -#payment-goals-message { display: none !important; } -span.trade { display: none !important; } -#sts-flag { background: #EBA000 !important; text-shadow: 0px 2px 0px black;} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/bitbucket.org.css --- a/dotcss/bitbucket.org.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -#invite-repo-box {display: none;} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/bugzilla.pculture.org.css --- a/dotcss/bugzilla.pculture.org.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -.bz_comment_text { font-family: Menlo; } -.bz_group_visibility_section { display: none; } -table.edit_form { display: none; } diff -r a1d399ef7d54 -r 9eee23072538 dotcss/debuggex.com.css --- a/dotcss/debuggex.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -h2 { display: none; } -div.centered-text { display: none; } -div { display: none; } -div.topcontainer { display: block; } -div.topcontainer div { display: block; } -div.nfa { display: block; } -div.ui-slider { display: block; } diff -r a1d399ef7d54 -r 9eee23072538 dotcss/default.css --- a/dotcss/default.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - -*:focus { - outline: 4px solid red !important; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/dpaste.com.css --- a/dotcss/dpaste.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -pre { - font-family: Menlo; - font-size: 12px; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/gist.github.com.css --- a/dotcss/gist.github.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - -.line-data, .file-data pre, .line-number { - font-family: Menlo; - line-height: 1.4; - font-size: 12px; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/github.banksimple.com.css --- a/dotcss/github.banksimple.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -code { font-family: Menlo !important; } diff -r a1d399ef7d54 -r 9eee23072538 dotcss/github.com.css --- a/dotcss/github.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -.native-clones { display: none; } -.tree-browser td.content { font-family: Menlo; font-size: 12px; line-height: 18px; } -span.mini-icon.directory { margin-top: 2px; } -/* div.news span.mini-icon { display: none; } */ -/* div.news div.alert { padding-left: 0; } */ -/* ul.repo_list li .mini-icon { display: none; } */ -/* #dashboard ul.repo_list li a { padding-left: 10px; } */ -a.feed.tooltipped.leftwards { display: none; } -.pagehead .tip { display: none; } -/* #dashboard div.news { display: none; } */ -div.filter-bar { overflow-x: hidden; } -p.url-description { display: none; } -span.js-clippy { display: none !important; } -div.repository-lang-stats-graph { display: none; } -div.recently-touched-branches-wrapper { display: none; } -p.last-commit { display: none; } -pre, code, tt { font-family: Menlo; } -.header a.notification-indicator { display: none; } -.header .divider-vertical { display: none; } -.header .header-logo-blacktocat { margin-right: 7px; } diff -r a1d399ef7d54 -r 9eee23072538 dotcss/goodreads.com.css --- a/dotcss/goodreads.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -#featured_polls, #quote_of_the_day { - display: none; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/google.com.css --- a/dotcss/google.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -button.gbil { - display: none; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/jenkins.banksimple.com.css --- a/dotcss/jenkins.banksimple.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -#main-panel pre { - font: normal 14px Menlo !important; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/khanacademy.org.css --- a/dotcss/khanacademy.org.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -.video_comments { margin-top: 20px; } -.comments_container .comment { margin-bottom: 20px; } diff -r a1d399ef7d54 -r 9eee23072538 dotcss/linkedin.com.css --- a/dotcss/linkedin.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -#network-stat-widget, -#jobsForYou, -#groupsForYou, -#companiesForYou, -#pymk, -#today-news-wrapper, -.guided-setup, -.linkedin-sponsor -{ - display: none; -} - -.member-photo, .feed-photo { - margin-left: 10px !important; - border: 1px solid black !important; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/news.ycombinator.com.css --- a/dotcss/news.ycombinator.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ - diff -r a1d399ef7d54 -r 9eee23072538 dotcss/okcupid.com.css --- a/dotcss/okcupid.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -#loveisblindday { display: none; } -#likeonfacebook { display: none; } -#masthead_wrapper { display: none !important; } -#movie_match_promo { display: none !important; } -#sponsoredmatchrow_link { display: none !important; } diff -r a1d399ef7d54 -r 9eee23072538 dotcss/readthedocs.org.css --- a/dotcss/readthedocs.org.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -span.pre { - padding: 1px 4px; - border: 1px solid #ccc; - border-radius: 2px; - background: #f5f5f5; - font-family: Menlo, Monaco, monospaced; - font-size: 14px; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/refheap.com.css --- a/dotcss/refheap.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -pre { - font-family: Menlo; - font-size: 14px; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/secure.flickr.com.css --- a/dotcss/secure.flickr.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -flickr.com.css \ No newline at end of file diff -r a1d399ef7d54 -r 9eee23072538 dotcss/unisubs.example.com.css --- a/dotcss/unisubs.example.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -body > div.note { - display: none; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/unisubs.sifterapp.com.css --- a/dotcss/unisubs.sifterapp.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -table.grouped tr.group td { - padding: 6px 0px 4px 7px !important; -} -tr.issue td { - padding: 8px 8px 6px 0px !important; -} -tr.issue td.subject span.assignee { - /* display: none; */ -} -tr.issue td { - border-bottom: 1px solid #eee !important; -} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/vimeo.com.css --- a/dotcss/vimeo.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ - -#likes_extras, .related_collections, #brozar { display: none !important;} diff -r a1d399ef7d54 -r 9eee23072538 dotcss/weather.com.css diff -r a1d399ef7d54 -r 9eee23072538 dotcss/youtube.com.css --- a/dotcss/youtube.com.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -#video-sidebar { display: none; } -#masthead-expanded-lists-container { display: none; } -.branded-page-related-channels { display: none; } diff -r a1d399ef7d54 -r 9eee23072538 dotjs/500px.com.js diff -r a1d399ef7d54 -r 9eee23072538 dotjs/bugzilla.pculture.org.js diff -r a1d399ef7d54 -r 9eee23072538 dotjs/democratandchronicle.com.js --- a/dotjs/democratandchronicle.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -$('.fb_recommend, .aside center, .aside table, #taboola-leftcolumn-div').remove(); -$('#dir_widget_wrapper, #conveyorbottom, .ody-ob-taboola-wrapper').remove(); -$('.footer-partners, .footer-gannett, .footer-bottom').remove(); - diff -r a1d399ef7d54 -r 9eee23072538 dotjs/dev.universalsubtitles.org.js --- a/dotjs/dev.universalsubtitles.org.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -$('#menu_name > a').attr('href', '#'); -$('div#menu_name > a').click(function() { - $('div#menu').toggle(); -}); diff -r a1d399ef7d54 -r 9eee23072538 dotjs/encrypted.google.com.js --- a/dotjs/encrypted.google.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -google.com.js \ No newline at end of file diff -r a1d399ef7d54 -r 9eee23072538 dotjs/flickr.com.js --- a/dotjs/flickr.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -$(function() { - $('.spaceball').remove(); -}) diff -r a1d399ef7d54 -r 9eee23072538 dotjs/getprismatic.com.js --- a/dotjs/getprismatic.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -var banned_sites = ['Bits', 'Forbes.com']; -var banned_tags = ['Venture Capital', 'Social', 'Startups']; -var banned_words = ['Node']; - -var scrubber = function(){ - $('.article').each(function(index, object){ - var hideit = false; - - var publisher = $(object).find('.publisher').find('.interest').text(); - - var title = $(object).find('.title').find('.external').text(); - - //loop through interests against our banned tags - $(object).find('.meta').find('.interest').each(function(i, rawinterest){ - - var interest = $(rawinterest).text(); - - $(banned_tags).each(function(index, object){ - if(object.toLowerCase() == interest.toLowerCase()){ - hideit = true; - } - }); - - }); - - //loop through our sites checking if it matches the publisher - $(banned_sites).each(function(index, object){ - if(object.toLowerCase() == publisher.toLowerCase()){ - hideit = true; - } - }); - - //check title against banned_words - $(banned_words).each(function(index, object){ - if(title.toLowerCase().indexOf(object.toLowerCase()) != -1){ - hideit = true; - } - }); - - //hide the article if deemed garbage - if(hideit == true){ - $(object).hide(); - } - - }); -} - -setInterval(scrubber, 2000); diff -r a1d399ef7d54 -r 9eee23072538 dotjs/github.com.js diff -r a1d399ef7d54 -r 9eee23072538 dotjs/google.com.js --- a/dotjs/google.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -/* - * jQuery Hotkeys Plugin - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * - * Based upon the plugin by Tzury Bar Yochay: - * http://github.com/tzuryby/hotkeys - * - * Original idea by: - * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ -*/ -(function(jQuery){ - jQuery.hotkeys = { - version: "0.8", - - specialKeys: { - 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", - 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", - 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", - 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", - 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", - 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", - 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta" - }, - - shiftNums: { - "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", - "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", - ".": ">", "/": "?", "\\": "|" - } - }; - function keyHandler( handleObj ) { - // Only care when a possible input has been specified - if ( typeof handleObj.data !== "string" ) { - return; - } - - var origHandler = handleObj.handler, - keys = handleObj.data.toLowerCase().split(" "); - - handleObj.handler = function( event ) { - // Don't fire in text-accepting inputs that we didn't directly bind to - if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || - event.target.type === "text") ) { - return; - } - - // Keypress represents characters, not special keys - var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ], - character = String.fromCharCode( event.which ).toLowerCase(), - key, modif = "", possible = {}; - - // check combinations (alt|ctrl|shift+anything) - if ( event.altKey && special !== "alt" ) { - modif += "alt+"; - } - - if ( event.ctrlKey && special !== "ctrl" ) { - modif += "ctrl+"; - } - - // TODO: Need to make sure this works consistently across platforms - if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { - modif += "meta+"; - } - - if ( event.shiftKey && special !== "shift" ) { - modif += "shift+"; - } - - if ( special ) { - possible[ modif + special ] = true; - - } else { - possible[ modif + character ] = true; - possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true; - - // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" - if ( modif === "shift+" ) { - possible[ jQuery.hotkeys.shiftNums[ character ] ] = true; - } - } - - for ( var i = 0, l = keys.length; i < l; i++ ) { - if ( possible[ keys[i] ] ) { - return origHandler.apply( this, arguments ); - } - } - }; - } - jQuery.each([ "keydown", "keyup", "keypress" ], function() { - jQuery.event.special[ this ] = { add: keyHandler }; - }); -})($); - -$(function() { - $results = $('#res h3.r a.l'); - - if ($results.length) { - for (var i=0; i < 9; i++) { - var $r = $results.eq(i); - - $r.prepend('' + (i + 1) + ''); - $('span.keyshortcut', $r) - .css('color', '#ffffff') - .css('background', '#1122CC') - .css('font-weight', 'bold') - .css('font-size', '12px') - .css('padding', '1px 3px') - .css('border-radius', '2px') - .css('margin-right', '5px') - .css('z-index', '9999') - } - - $d = $(document); - - $d.bind('keydown', '1', function(e) { go(e); }); - $d.bind('keydown', '2', function(e) { go(e); }); - $d.bind('keydown', '3', function(e) { go(e); }); - $d.bind('keydown', '4', function(e) { go(e); }); - $d.bind('keydown', '5', function(e) { go(e); }); - $d.bind('keydown', '6', function(e) { go(e); }); - $d.bind('keydown', '7', function(e) { go(e); }); - $d.bind('keydown', '8', function(e) { go(e); }); - $d.bind('keydown', '9', function(e) { go(e); }); - - var go = function(e) { - var num = parseInt(e.data, 0) - 1; - document.location = $results.eq(num).attr('href'); - }; - } -}); - -$(function() { - var css = ".vspib, .vspb, .vspi {display: none;} #vspb {display: none;}"; - if (typeof GM_addStyle != "undefined") { - GM_addStyle(css); - } else if (typeof PRO_addStyle != "undefined") { - PRO_addStyle(css); - } else if (typeof addStyle != "undefined") { - addStyle(css); - } else { - var heads = document.getElementsByTagName("head"); - if (heads.length > 0) { - var node = document.createElement("style"); - node.type = "text/css"; - node.appendChild(document.createTextNode(css)); - heads[0].appendChild(node); - } - } -})(); diff -r a1d399ef7d54 -r 9eee23072538 dotjs/jenkins.banksimple.com.js --- a/dotjs/jenkins.banksimple.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -var css = '* { -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; -ms-transition: none !important; transition: none !important; }' -var head = document.head || document.getElementsByTagName('head')[0] -var style = document.createElement('style'); - -style.type = 'text/css'; -if (style.styleSheet){ -style.styleSheet.cssText = css; -} else { -style.appendChild(document.createTextNode(css)); -} - -head.appendChild(style); diff -r a1d399ef7d54 -r 9eee23072538 dotjs/nytimes.com.js --- a/dotjs/nytimes.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -$('.socialMediaModule').remove(); - -$('#wsodMarkets').remove(); -$('#classifiedsWidget').remove(); -$('.cColumn #cColumnTopSpanRegion').remove(); -$('#recommendedFooter').remove(); -$('#mostPopWidget').remove(); diff -r a1d399ef7d54 -r 9eee23072538 dotjs/readability.com.js --- a/dotjs/readability.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -$(function() { - var css = "#rdb-article-content pre { word-wrap: normal !important; white-space: pre !important; background-color: #F0F1EE !important; border: 1px solid #D4D4D2 !important; padding: 10px; margin: 20px; }"; - - if (typeof GM_addStyle != "undefined") { - GM_addStyle(css); - } else if (typeof PRO_addStyle != "undefined") { - PRO_addStyle(css); - } else if (typeof addStyle != "undefined") { - addStyle(css); - } else { - var heads = document.getElementsByTagName("head"); - if (heads.length > 0) { - var node = document.createElement("style"); - node.type = "text/css"; - node.appendChild(document.createTextNode(css)); - heads[0].appendChild(node); - } - } -}()); diff -r a1d399ef7d54 -r 9eee23072538 dotjs/reddit.com.js --- a/dotjs/reddit.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -$('#url-field div button').remove(); diff -r a1d399ef7d54 -r 9eee23072538 dotjs/secure.flickr.com.js --- a/dotjs/secure.flickr.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -flickr.com.js \ No newline at end of file diff -r a1d399ef7d54 -r 9eee23072538 dotjs/staging.universalsubtitles.org --- a/dotjs/staging.universalsubtitles.org Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -dev.universalsubtitles.org.js \ No newline at end of file diff -r a1d399ef7d54 -r 9eee23072538 dotjs/unisubs.example.com.js --- a/dotjs/unisubs.example.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -dev.universalsubtitles.org.js \ No newline at end of file diff -r a1d399ef7d54 -r 9eee23072538 dotjs/unisubs.sifterapp.com.js --- a/dotjs/unisubs.sifterapp.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -$(function() { - $('ul.state li.priority').each(function(idx, el) { - $(el).closest('.issue').find('h2').append( - '' + $(el).text() + ''); - $(el).remove(); - }); - - $('div.comment').each(function (idx, el) { - var id = $(el).attr('id'); - var link = 'permalink'; - $(el).find('.timestamp').append(link); - }); -}); - diff -r a1d399ef7d54 -r 9eee23072538 dotjs/youtube.com.js --- a/dotjs/youtube.com.js Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -//$('#comments-view').remove(); -$('#ticker').remove(); diff -r a1d399ef7d54 -r 9eee23072538 ipython/profile_default/ipython_config.py --- a/ipython/profile_default/ipython_config.py Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,603 +0,0 @@ -# Configuration file for ipython. - -#------------------------------------------------------------------------------ -# Configurable configuration -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# InteractiveShellApp configuration -#------------------------------------------------------------------------------ - -# A Mixin for applications that start InteractiveShell instances. -# -# Provides configurables for loading extensions and executing files as part of -# configuring a Shell environment. -# -# The following methods should be called by the :meth:`initialize` method of the -# subclass: -# -# - :meth:`init_path` -# - :meth:`init_shell` (to be implemented by the subclass) -# - :meth:`init_gui_pylab` -# - :meth:`init_extensions` -# - :meth:`init_code` - -# Configure matplotlib for interactive use with the default matplotlib backend. -# c.InteractiveShellApp.matplotlib = None - -# Reraise exceptions encountered loading IPython extensions? -# c.InteractiveShellApp.reraise_ipython_extension_failures = False - -# A file to be run -# c.InteractiveShellApp.file_to_run = '' - -# Run the module as a script. -# c.InteractiveShellApp.module_to_run = '' - -# Run the file referenced by the PYTHONSTARTUP environment variable at IPython -# startup. -# c.InteractiveShellApp.exec_PYTHONSTARTUP = True - -# dotted module name of an IPython extension to load. -# c.InteractiveShellApp.extra_extension = '' - -# Execute the given command string. -# c.InteractiveShellApp.code_to_run = '' - -# lines of code to run at IPython startup. -# c.InteractiveShellApp.exec_lines = traitlets.Undefined - -# List of files to run at IPython startup. -# c.InteractiveShellApp.exec_files = traitlets.Undefined - -# Pre-load matplotlib and numpy for interactive use, selecting a particular -# matplotlib backend and loop integration. -# c.InteractiveShellApp.pylab = None - -# Enable GUI event loop integration with any of ('glut', 'gtk', 'gtk3', 'osx', -# 'pyglet', 'qt', 'qt5', 'tk', 'wx'). -# c.InteractiveShellApp.gui = None - -# Should variables loaded at startup (by startup files, exec_lines, etc.) be -# hidden from tools like %who? -# c.InteractiveShellApp.hide_initial_ns = True - -# A list of dotted module names of IPython extensions to load. -# c.InteractiveShellApp.extensions = traitlets.Undefined - -# If true, IPython will populate the user namespace with numpy, pylab, etc. and -# an ``import *`` is done from numpy and pylab, when using pylab mode. -# -# When False, pylab mode should not import any names into the user namespace. -# c.InteractiveShellApp.pylab_import_all = True - -#------------------------------------------------------------------------------ -# SingletonConfigurable configuration -#------------------------------------------------------------------------------ - -# A configurable that only allows one instance. -# -# This class is for classes that should only have one instance of itself or -# *any* subclass. To create and retrieve such a class use the -# :meth:`SingletonConfigurable.instance` method. - -#------------------------------------------------------------------------------ -# Application configuration -#------------------------------------------------------------------------------ - -# This is an application. - -# The Logging format template -# c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s' - -# Set the log level by value or name. -# c.Application.log_level = 30 - -# The date format used by logging formatters for %(asctime)s -# c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S' - -#------------------------------------------------------------------------------ -# BaseIPythonApplication configuration -#------------------------------------------------------------------------------ - -# IPython: an enhanced interactive Python shell. - -# The IPython profile to use. -# c.BaseIPythonApplication.profile = 'default' - -# Path to an extra config file to load. -# -# If specified, load this config file in addition to any other IPython config. -# c.BaseIPythonApplication.extra_config_file = '' - -# The name of the IPython directory. This directory is used for logging -# configuration (through profiles), history storage, etc. The default is usually -# $HOME/.ipython. This option can also be specified through the environment -# variable IPYTHONDIR. -# c.BaseIPythonApplication.ipython_dir = '' - -# Whether to overwrite existing config files when copying -# c.BaseIPythonApplication.overwrite = False - -# Whether to create profile dir if it doesn't exist -# c.BaseIPythonApplication.auto_create = False - -# Create a massive crash report when IPython encounters what may be an internal -# error. The default is to append a short message to the usual traceback -# c.BaseIPythonApplication.verbose_crash = False - -# Whether to install the default config files into the profile dir. If a new -# profile is being created, and IPython contains config files for that profile, -# then they will be staged into the new directory. Otherwise, default config -# files will be automatically generated. -# c.BaseIPythonApplication.copy_config_files = False - -#------------------------------------------------------------------------------ -# TerminalIPythonApp configuration -#------------------------------------------------------------------------------ - -# Start IPython quickly by skipping the loading of config files. -# c.TerminalIPythonApp.quick = False - -# If a command or file is given via the command-line, e.g. 'ipython foo.py', -# start an interactive shell after executing the file or command. -# c.TerminalIPythonApp.force_interact = False - -# Whether to display a banner upon starting IPython. -# c.TerminalIPythonApp.display_banner = True - -#------------------------------------------------------------------------------ -# InteractiveShell configuration -#------------------------------------------------------------------------------ - -# An enhanced, interactive shell for Python. - -# -# c.InteractiveShell.xmode = 'Context' - -# Make IPython automatically call any callable object even if you didn't type -# explicit parentheses. For example, 'str 43' becomes 'str(43)' automatically. -# The value can be '0' to disable the feature, '1' for 'smart' autocall, where -# it is not applied if there are no more arguments on the line, and '2' for -# 'full' autocall, where all callable objects are automatically called (even if -# no arguments are present). -# c.InteractiveShell.autocall = 0 - -# -# c.InteractiveShell.history_length = 10000 - -# Deprecated, use PromptManager.in2_template -# c.InteractiveShell.prompt_in2 = ' .\\D.: ' - -# The name of the logfile to use. -# c.InteractiveShell.logfile = '' - -# Automatically call the pdb debugger after every exception. -# c.InteractiveShell.pdb = False - -# -# c.InteractiveShell.quiet = False - -# A list of ast.NodeTransformer subclass instances, which will be applied to -# user input before code is run. -# c.InteractiveShell.ast_transformers = traitlets.Undefined - -# -# c.InteractiveShell.separate_in = '\n' - -# -# c.InteractiveShell.readline_remove_delims = '-/~' - -# **Deprecated** -# -# Enable deep (recursive) reloading by default. IPython can use the deep_reload -# module which reloads changes in modules recursively (it replaces the reload() -# function, so you don't need to change anything to use it). `deep_reload` -# forces a full reload of modules whose code may have changed, which the default -# reload() function does not. When deep_reload is off, IPython will use the -# normal reload(), but deep_reload will still be available as dreload(). -# c.InteractiveShell.deep_reload = False - -# Deprecated, use PromptManager.in_template -# c.InteractiveShell.prompt_in1 = 'In [\\#]: ' - -# Save multi-line entries as one entry in readline history -# c.InteractiveShell.multiline_history = True - -# Start logging to the default log file in overwrite mode. Use `logappend` to -# specify a log file to **append** logs to. -# c.InteractiveShell.logstart = False - -# 'all', 'last', 'last_expr' or 'none', specifying which nodes should be run -# interactively (displaying output from expressions). -# c.InteractiveShell.ast_node_interactivity = 'last_expr' - -# Don't call post-execute functions that have failed in the past. -# c.InteractiveShell.disable_failing_post_execute = False - -# Start logging to the given file in append mode. Use `logfile` to specify a log -# file to **overwrite** logs to. -# c.InteractiveShell.logappend = '' - -# Deprecated, use PromptManager.justify -# c.InteractiveShell.prompts_pad_left = True - -# -# c.InteractiveShell.wildcards_case_sensitive = True - -# -# c.InteractiveShell.separate_out2 = '' - -# Enable magic commands to be called without the leading %. -# c.InteractiveShell.automagic = True - -# The number of saved history entries to be loaded into the readline buffer at -# startup. -# c.InteractiveShell.history_load_length = 1000 - -# -# c.InteractiveShell.ipython_dir = '' - -# Show rewritten input, e.g. for autocall. -# c.InteractiveShell.show_rewritten_input = True - -# The part of the banner to be printed after the profile -# c.InteractiveShell.banner2 = '' - -# Set the color scheme (NoColor, Linux, or LightBG). -# c.InteractiveShell.colors = 'LightBG' - -# The part of the banner to be printed before the profile -# c.InteractiveShell.banner1 = 'Python 3.4.3 (default, Aug 11 2015, 08:57:25) \nType "copyright", "credits" or "license" for more information.\n\nIPython 4.0.0 -- An enhanced Interactive Python.\n? -> Introduction and overview of IPython\'s features.\n%quickref -> Quick reference.\nhelp -> Python\'s own help system.\nobject? -> Details about \'object\', use \'object??\' for extra details.\n' - -# Use colors for displaying information about objects. Because this information -# is passed through a pager (like 'less'), and some pagers get confused with -# color codes, this capability can be turned off. -# c.InteractiveShell.color_info = True - -# -# c.InteractiveShell.readline_use = True - -# Autoindent IPython code entered interactively. -# c.InteractiveShell.autoindent = True - -# -# c.InteractiveShell.debug = False - -# If True, anything that would be passed to the pager will be displayed as -# regular output instead. -# c.InteractiveShell.display_page = False - -# Set the size of the output cache. The default is 1000, you can change it -# permanently in your config file. Setting it to 0 completely disables the -# caching system, and the minimum value accepted is 20 (if you provide a value -# less than 20, it is reset to 0 and a warning is issued). This limit is -# defined because otherwise you'll spend more time re-flushing a too small cache -# than working -# c.InteractiveShell.cache_size = 1000 - -# -# c.InteractiveShell.separate_out = '' - -# -# c.InteractiveShell.readline_parse_and_bind = traitlets.Undefined - -# -# c.InteractiveShell.object_info_string_level = 0 - -# Deprecated, use PromptManager.out_template -# c.InteractiveShell.prompt_out = 'Out[\\#]: ' - -#------------------------------------------------------------------------------ -# TerminalInteractiveShell configuration -#------------------------------------------------------------------------------ - -# auto editing of files with syntax errors. -# c.TerminalInteractiveShell.autoedit_syntax = False - -# Enable auto setting the terminal title. -# c.TerminalInteractiveShell.term_title = False - -# Set to confirm when you try to exit IPython with an EOF (Control-D in Unix, -# Control-Z/Enter in Windows). By typing 'exit' or 'quit', you can force a -# direct exit without any confirmation. -c.TerminalInteractiveShell.confirm_exit = False - -# The shell program to be used for paging. -# c.TerminalInteractiveShell.pager = 'less' - -# Set the editor used by IPython (default to $EDITOR/vi/notepad). -# c.TerminalInteractiveShell.editor = 'vim' - -# Number of lines of your screen, used to control printing of very long strings. -# Strings longer than this number of lines will be sent through a pager instead -# of directly printed. The default value for this is 0, which means IPython -# will auto-detect your screen size every time it needs to print certain -# potentially long strings (this doesn't change the behavior of the 'print' -# keyword, it's only triggered internally). If for some reason this isn't -# working well (it needs curses support), specify it yourself. Otherwise don't -# change the default. -# c.TerminalInteractiveShell.screen_length = 0 - -#------------------------------------------------------------------------------ -# PromptManager configuration -#------------------------------------------------------------------------------ - -# This is the primary interface for producing IPython's prompts. - -# If True (default), each prompt will be right-aligned with the preceding one. -# c.PromptManager.justify = True - -# -# c.PromptManager.color_scheme = 'Linux' - -# Output prompt. '\#' will be transformed to the prompt number -# c.PromptManager.out_template = 'Out[\\#]: ' - -# Continuation prompt. -# c.PromptManager.in2_template = ' .\\D.: ' - -# Input prompt. '\#' will be transformed to the prompt number -# c.PromptManager.in_template = 'In [\\#]: ' - -#------------------------------------------------------------------------------ -# HistoryAccessorBase configuration -#------------------------------------------------------------------------------ - -# An abstract class for History Accessors - -#------------------------------------------------------------------------------ -# HistoryAccessor configuration -#------------------------------------------------------------------------------ - -# Access the history database without adding to it. -# -# This is intended for use by standalone history tools. IPython shells use -# HistoryManager, below, which is a subclass of this. - -# Path to file to use for SQLite history database. -# -# By default, IPython will put the history database in the IPython profile -# directory. If you would rather share one history among profiles, you can set -# this value in each, so that they are consistent. -# -# Due to an issue with fcntl, SQLite is known to misbehave on some NFS mounts. -# If you see IPython hanging, try setting this to something on a local disk, -# e.g:: -# -# ipython --HistoryManager.hist_file=/tmp/ipython_hist.sqlite -# c.HistoryAccessor.hist_file = '' - -# Options for configuring the SQLite connection -# -# These options are passed as keyword args to sqlite3.connect when establishing -# database conenctions. -# c.HistoryAccessor.connection_options = traitlets.Undefined - -# enable the SQLite history -# -# set enabled=False to disable the SQLite history, in which case there will be -# no stored history, no SQLite connection, and no background saving thread. -# This may be necessary in some threaded environments where IPython is embedded. -# c.HistoryAccessor.enabled = True - -#------------------------------------------------------------------------------ -# HistoryManager configuration -#------------------------------------------------------------------------------ - -# A class to organize all history-related functionality in one place. - -# Should the history database include output? (default: no) -# c.HistoryManager.db_log_output = False - -# Write to database every x commands (higher values save disk access & power). -# Values of 1 or less effectively disable caching. -# c.HistoryManager.db_cache_size = 0 - -#------------------------------------------------------------------------------ -# LoggingConfigurable configuration -#------------------------------------------------------------------------------ - -# A parent class for Configurables that log. -# -# Subclasses have a log trait, and the default behavior is to get the logger -# from the currently running Application. - -#------------------------------------------------------------------------------ -# ProfileDir configuration -#------------------------------------------------------------------------------ - -# An object to manage the profile directory and its resources. -# -# The profile directory is used by all IPython applications, to manage -# configuration, logging and security. -# -# This object knows how to find, create and manage these directories. This -# should be used by any code that wants to handle profiles. - -# Set the profile location directly. This overrides the logic used by the -# `profile` option. -# c.ProfileDir.location = '' - -#------------------------------------------------------------------------------ -# BaseFormatter configuration -#------------------------------------------------------------------------------ - -# A base formatter class that is configurable. -# -# This formatter should usually be used as the base class of all formatters. It -# is a traited :class:`Configurable` class and includes an extensible API for -# users to determine how their objects are formatted. The following logic is -# used to find a function to format an given object. -# -# 1. The object is introspected to see if it has a method with the name -# :attr:`print_method`. If is does, that object is passed to that method -# for formatting. -# 2. If no print method is found, three internal dictionaries are consulted -# to find print method: :attr:`singleton_printers`, :attr:`type_printers` -# and :attr:`deferred_printers`. -# -# Users should use these dictionaries to register functions that will be used to -# compute the format data for their objects (if those objects don't have the -# special print methods). The easiest way of using these dictionaries is through -# the :meth:`for_type` and :meth:`for_type_by_name` methods. -# -# If no function/callable is found to compute the format data, ``None`` is -# returned and this format type is not used. - -# -# c.BaseFormatter.type_printers = traitlets.Undefined - -# -# c.BaseFormatter.enabled = True - -# -# c.BaseFormatter.singleton_printers = traitlets.Undefined - -# -# c.BaseFormatter.deferred_printers = traitlets.Undefined - -#------------------------------------------------------------------------------ -# PlainTextFormatter configuration -#------------------------------------------------------------------------------ - -# The default pretty-printer. -# -# This uses :mod:`IPython.lib.pretty` to compute the format data of the object. -# If the object cannot be pretty printed, :func:`repr` is used. See the -# documentation of :mod:`IPython.lib.pretty` for details on how to write pretty -# printers. Here is a simple example:: -# -# def dtype_pprinter(obj, p, cycle): -# if cycle: -# return p.text('dtype(...)') -# if hasattr(obj, 'fields'): -# if obj.fields is None: -# p.text(repr(obj)) -# else: -# p.begin_group(7, 'dtype([') -# for i, field in enumerate(obj.descr): -# if i > 0: -# p.text(',') -# p.breakable() -# p.pretty(field) -# p.end_group(7, '])') - -# Truncate large collections (lists, dicts, tuples, sets) to this size. -# -# Set to 0 to disable truncation. -# c.PlainTextFormatter.max_seq_length = 1000 - -# -# c.PlainTextFormatter.verbose = False - -# -# c.PlainTextFormatter.float_precision = '' - -# -# c.PlainTextFormatter.max_width = 79 - -# -# c.PlainTextFormatter.pprint = True - -# -# c.PlainTextFormatter.newline = '\n' - -#------------------------------------------------------------------------------ -# Completer configuration -#------------------------------------------------------------------------------ - -# Activate greedy completion -# -# This will enable completion on elements of lists, results of function calls, -# etc., but can be unsafe because the code is actually evaluated on TAB. -# c.Completer.greedy = False - -#------------------------------------------------------------------------------ -# IPCompleter configuration -#------------------------------------------------------------------------------ - -# Extension of the completer class with IPython-specific features - -# Instruct the completer to omit private method names -# -# Specifically, when completing on ``object.``. -# -# When 2 [default]: all names that start with '_' will be excluded. -# -# When 1: all 'magic' names (``__foo__``) will be excluded. -# -# When 0: nothing will be excluded. -# c.IPCompleter.omit__names = 2 - -# Instruct the completer to use __all__ for the completion -# -# Specifically, when completing on ``object.``. -# -# When True: only those names in obj.__all__ will be included. -# -# When False [default]: the __all__ attribute is ignored -# c.IPCompleter.limit_to__all__ = False - -# Whether to merge completion results into a single list -# -# If False, only the completion results from the first non-empty completer will -# be returned. -# c.IPCompleter.merge_completions = True - -#------------------------------------------------------------------------------ -# Magics configuration -#------------------------------------------------------------------------------ - -# Base class for implementing magic functions. -# -# Shell functions which can be reached as %function_name. All magic functions -# should accept a string, which they can parse for their own needs. This can -# make some functions easier to type, eg `%cd ../` vs. `%cd("../")` -# -# Classes providing magic functions need to subclass this class, and they MUST: -# -# - Use the method decorators `@line_magic` and `@cell_magic` to decorate -# individual methods as magic functions, AND -# -# - Use the class decorator `@magics_class` to ensure that the magic -# methods are properly registered at the instance level upon instance -# initialization. -# -# See :mod:`magic_functions` for examples of actual implementation classes. - -#------------------------------------------------------------------------------ -# ScriptMagics configuration -#------------------------------------------------------------------------------ - -# Magics for talking to scripts -# -# This defines a base `%%script` cell magic for running a cell with a program in -# a subprocess, and registers a few top-level magics that call %%script with -# common interpreters. - -# Extra script cell magics to define -# -# This generates simple wrappers of `%%script foo` as `%%foo`. -# -# If you want to add script magics that aren't on your path, specify them in -# script_paths -# c.ScriptMagics.script_magics = traitlets.Undefined - -# Dict mapping short 'ruby' names to full paths, such as '/opt/secret/bin/ruby' -# -# Only necessary for items in script_magics where the default path will not find -# the right interpreter. -# c.ScriptMagics.script_paths = traitlets.Undefined - -#------------------------------------------------------------------------------ -# StoreMagics configuration -#------------------------------------------------------------------------------ - -# Lightweight persistence for python variables. -# -# Provides the %store magic. - -# If True, any %store-d variables will be automatically restored when IPython -# starts. -# c.StoreMagics.autorestore = False diff -r a1d399ef7d54 -r 9eee23072538 ipython/profile_default/startup/README --- a/ipython/profile_default/startup/README Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -This is the IPython startup directory - -.py and .ipy files in this directory will be run *prior* to any code or files specified -via the exec_lines or exec_files configurables whenever you load this profile. - -Files will be run in lexicographical order, so you can control the execution order of files -with a prefix, e.g.:: - - 00-first.py - 50-middle.py - 99-last.ipy diff -r a1d399ef7d54 -r 9eee23072538 marked-sjl.css --- a/marked-sjl.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,311 +0,0 @@ -/* - This document has been created with Marked.app , Copyright 2011 Brett Terpstra - Please leave this notice in place, along with any additional credits below. - --------------------------------------------------------------- - Title: SJL - Author: Steve Losh - Description: -*/ - -body { - font: normal 1em/1.4em Palatino, serif; -} - -html>body { - font-size:14px -} - -h1 { - font-family: HoeflerText-Regular,"Hoefler Text", serif; - font-weight: normal; - color:#000; - font-size:200%; - line-height:120%; -} -h2 { - font-family: HoeflerText-Regular,"Hoefler Text", serif; - font-weight: normal; - color: #000; - font-size: 170%; -} -h3 { - color:#111; - font-size:150%; -} -h4 { - color:#111; - font-size:120%; -} -h5 { - color:#111; - font-size:100%; - font-weight: bold; -} -h6 { - font-size:100%; - font-weight: bold; -} - -body,p,td,div { - color: #050505; - font-family: Palatino, serif; - word-wrap: break-word; -} - -a { - -webkit-transition:color .2s ease-in-out; - color:#0d6ea1; - text-decoration:none -} - -a:hover { - color:#3593d9 -} - -blockquote p { - font-size:110%; - font-style:italic; - line-height:1.6em; -} - -.footnote { - color:#0d6ea1; - font-size:.8em; - vertical-align:super -} - -#wrapper img { - max-width:100%; - height:auto -} - -dd { - margin-bottom:1em -} - -li > p:first-child { - margin:0 -} - -ul ul,ul ol { - margin-bottom:.4em -} - -caption,col,colgroup,table,tbody,td,tfoot,th,thead,tr { - border-spacing:0 -} - -table { - border:1px solid rgba(0,0,0,0.25); - border-collapse:collapse; - display:table; - empty-cells:hide; - margin:-1px 0 23px; - padding:0; - table-layout:fixed -} - -caption { - display:table-caption; - font-weight:700 -} - -col { - display:table-column -} - -colgroup { - display:table-column-group -} - -code, tt, pre { - font-family: Menlo; - font-size: 14px; - text-align: left; - white-space: nowrap; - border: 1px solix #ccc; - color: #0000ff; -} - -pre > code { - margin: 0; - padding: 0; - white-space: pre; - border: none; -} - -pre { - border: 1px solid #ccc; - font-size:110%; - line-height: 22px; - overflow: auto; - padding: 2px 10px; - border-radius: 3px; - margin: 20px 0; -} - -pre code, pre tt { - border: none; -} - -tbody { - display:table-row-group -} - -tfoot { - display:table-footer-group -} - -thead { - display:table-header-group -} - -td,th { - display:table-cell -} - -tr { - display:table-row -} - -table th,table td { - font-size:1.1em; - line-height:23px; - padding:0 1em -} - -table thead { - background:rgba(0,0,0,0.15); - border:1px solid rgba(0,0,0,0.15); - border-bottom:1px solid rgba(0,0,0,0.2) -} - -table tbody { - background:rgba(0,0,0,0.05) -} - -table tfoot { - background:rgba(0,0,0,0.15); - border:1px solid rgba(0,0,0,0.15); - border-top:1px solid rgba(0,0,0,0.2) -} - -figure { - display:inline-block; - margin-bottom:1.2em; - position:relative; - margin:1em 0 -} - -figcaption { - font-style:italic; - text-align:center; - background:rgba(0,0,0,.9); - color:rgba(255,255,255,1); - position:absolute; - left:0; - bottom:-24px; - width:98%; - padding:1%; - -webkit-transition:all .2s ease-in-out; -} - -figure:hover>figcaption { - /* background:rgba(0,0,0,1) */ -} - -/* important rules for keeping line-height from being affected by sub */ -sup,sub,a.footnote { - font-size:1.4ex; - height:0; - line-height:1; - position:relative; -} - -sup { - vertical-align:super; -} - -sub { - vertical-align: sub; - top: -1px; -} - -p,h5 { - font-size:1.1429em; - line-height:1.3125em; - margin:1.3125em 0 -} - -dt,th { - font-weight:700 -} - -table tr:nth-child(odd),table th:nth-child(odd),table td:nth-child(odd) { - background:rgba(255,255,255,0.06) -} - -table tr:nth-child(even),table td:nth-child(even) { - background:rgba(0,0,0,0.06) -} - -@media print { - /* print only styles. Keep it clean */ - body { - overflow:auto - } - img, pre, blockquote, table, figure, p { - page-break-inside: avoid - } - .footnotes { page-break-before: always } - - #wrapper { - background:#fff; - color:#303030; - font-size:85%; - padding:10px; - position:relative; - text-indent:0 - } -} - -@media screen { - /* Screen-only styles, including inverted styles */ - .inverted #wrapper,.inverted { - background:rgba(37, 42, 42, 1) - } - .inverted hr { - border-color: rgba(51, 63, 64, 1) !important; - } - .inverted p,.inverted td,.inverted li,.inverted h1,.inverted h2,.inverted h3,.inverted h4,.inverted h5,.inverted h6,.inverted pre,.inverted code,.inverted th,.inverted .math,.inverted caption,.inverted dd,.inverted dt - { - color:#eee!important - } - .inverted table tr:nth-child(odd), .inverted table th:nth-child(odd), .inverted table td:nth-child(odd) { - background: none; - } - .inverted a - { - color:rgba(172, 209, 213, 1); - } - - #wrapper - { - padding:20px - } - - /* styles for more colorful selection highlights */ - ::selection { background:rgba(157, 193, 200,.5)} - h1::selection { background-color:rgba(45, 156, 208, .3)} - h2::selection { background-color:rgba(90, 182, 224, .3)} - h3::selection, - h4::selection, - h5::selection, - h6::selection,li::selection,ol::selection { background-color:rgba(133, 201, 232, .3)} - code::selection { background-color:rgba(0,0,0,.7);color:#eee} - code span::selection {background-color:rgba(0,0,0,.7) !important;color:#eee !important} - a::selection { background-color:rgba(255, 230, 102,.2)} - .inverted a::selection { background-color:rgba(255, 230, 102,.6)} - td::selection,th::selection,caption::selection { background-color: rgba(180, 237, 95, .5);} -} - diff -r a1d399ef7d54 -r 9eee23072538 pentadactylrc --- a/pentadactylrc Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -"1.0b3 (created: 2010/11/06 12:31:35) - -highlight Hint font-size: 14px; background: rgba(210,1,133,0.8) !important; border: 2px solid rgb(165,1,105); padding: 4px; border-radius: 3px; font-weight: bold; margin-left: -25px; color: white; font-family: Helvetica; line-height:1em; -highlight HintActive background: rgba(145,197,43,0.8) !important; -highlight HintElem background: rgba(255, 209, 20, 0.7) !important; -highlight StatusLine -moz-appearance: none !important; font-weight: bold; background: transparent !important; border: 0px !important; min-height: 22px !important; text-shadow: none !important; font: normal 14px/1 'Menlo' !important; padding: 3px 0px 3px 5px !important; -highlight CmdLine padding: 1px !important; font: normal 14px 'Menlo' !important; -highlight CmdOutput font: normal 13px 'Menlo' !important; -highlight CompItem font: normal 13px 'Menlo' !important; - -highlight Find background: #d6c149; color: #000; - -set runtimepath=/Users/sjl/.pentadactyl -set editor='/usr/local/bin/mvim -f + ' -" "set followhints=1 -set showtabline=multitab -set showstatuslinks=command - -" FASTER PLEASE -nmap -builtin -silent j 4j -nmap -builtin -silent k 4k - -" Go to the second input field. -" Useful for skipping over search fields, etc. -nmap -builtin gI 2gi - -" I never use marks, but always use quickmarks. -nmap -builtin "'" go -nmap -builtin '"' gn - -" Switch tabs with parens -nmap -builtin ) :tn -nmap -builtin ( :tp - -" Finally I can overwrite the stupid fucking Firebug toggling correctly. -" nmap -builtin -" nmap -builtin - -" Console toggle -nmap -builtin -imap -builtin - -" Inspect element toggle -nmap -builtin -imap -builtin - -" Shift is hard. -nmap -builtin ; : - -" YES YES YES REMOVE THE IDIOCY -nmap -builtin - -" Highlight all search matches, not just the first. -set hlfind - -" Clear search highlighting and normal highlighting. -nmap -builtin , :noh - -" Shut up. -javascript dactyl.beep = function() { return false; } - -" Okay DDG let's see if I can stand you. -" nope set defsearch=duckduckgo - -" Train myself to use t instead of cmd-t -nmap -builtin - -" Apparently the d key broke at some point. What the Christ? -nmap -builtin d :tabclose - -" Kill me -style -name ublick * #nav-bar * { visibility: visible; } diff -r a1d399ef7d54 -r 9eee23072538 slate --- a/slate Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -config defaultToCurrentScreen true - -alias hyper ctrl;shift;alt;cmd - -alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY -alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY -alias righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY - -alias thirdleft move screenOriginX;screenOriginY screenSizeX/3;screenSizeY -alias thirdmid move screenOriginX+screenSizeX/3;screenOriginY screenSizeX/3;screenSizeY -alias thirdright move screenOriginX+2*screenSizeX/3;screenOriginY screenSizeX/3;screenSizeY - -alias bigleft move screenOriginX;screenOriginY 2*screenSizeX/3;screenSizeY -alias bigmid move screenOriginX+screenSizeX/6;screenOriginY 2*screenSizeX/3;screenSizeY -alias bigright move screenOriginX+screenSizeX/3;screenOriginY 2*screenSizeX/3;screenSizeY - -bind pad1:${hyper} ${bigleft} -bind pad2:${hyper} ${bigmid} -bind pad3:${hyper} ${bigright} -bind pad4:${hyper} ${lefthalf} -bind pad5:${hyper} ${full} -bind pad6:${hyper} ${righthalf} -bind pad7:${hyper} ${thirdleft} -bind pad8:${hyper} ${thirdmid} -bind pad9:${hyper} ${thirdright} - -bind ;:${hyper} throw next -bind delete:${hyper} relaunch diff -r a1d399ef7d54 -r 9eee23072538 urlview --- a/urlview Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -COMMAND open %s diff -r a1d399ef7d54 -r 9eee23072538 userContent.css --- a/userContent.css Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -body.sjl-unstyled { - width: 800px; margin: 50px auto 200px; - font-family: Georgia; - font-size: 16px; - line-height: 1.4; -} -body.sjl-unstyled pre,code { - font-family: menlo !important; - font-size: 14px; - line-height: 1.4; -} -body.sjl-unstyled code { - background: #eee; - padding: 1px 4px; -} -body.sjl-unstyled pre { - padding: 15px; - overflow-x: scroll; -} -body.sjl-unstyled h3 { text-decoration: none; } -body.sjl-unstyled h4 { text-decoration: none; } diff -r a1d399ef7d54 -r 9eee23072538 vimperatorrc --- a/vimperatorrc Mon Jun 25 16:56:02 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -" gotta go fast -nnoremap j 6j -nnoremap k 6k - -" remove gui cruft -set gui=nonavigation,tabs - -" my eyes are bad -highlight CmdLine font: normal 15px 'Menlo' !important; background: white !important; padding: 0px 10px 0px 0px; -highlight CmdLine>* font: normal 15px 'Menlo' !important; -highlight StatusLine font: normal 15px 'Menlo' !important; padding: 2px 10px 2px 0px; - -highlight CmdOutput font: normal 13px 'Menlo' !important; -highlight CompItem font: normal 13px 'Menlo' !important; -highlight CompTitle font: normal 13px 'Menlo' !important; - -" I never use marks, but always use quickmarks. -nnoremap "'" go -nnoremap '"' gn - -" Switch tabs with parens -nnoremap ) :tn -nnoremap ( :tp - -" YES YES YES REMOVE THE IDIOCY -nnoremap - -" Clear search highlighting and normal highlighting. -nnoremap , :noh - -" unfuck ublock -style -name ublick * #nav-bar * { visibility: visible; } - -" unfuck completions for ff49 -js services.services.autoCompleteSearch.class_="@mozilla.org/autocomplete/search;1?name=unifiedcomplete" - -normal