diff --git a/.bashrc b/.bashrc index affde643532a05eeff479f835cae8bdf87ac8e2c..680369dd904cad176dddec1954ec7019f41cce5f 100644 --- a/.bashrc +++ b/.bashrc @@ -8,9 +8,19 @@ fi # User specific aliases and functions # remove annoying global aliases -unalias l. ll vi -unalias ls +noalias() { + x=`type $1 2>&1 | grep " is aliased to "` && unalias $1 +} +# unalias l. ll ls vi +noalias l. +noalias ll +noalias ls +noalias vi +noalias egrep +noalias fgrep +noalias grep alias ..="tcsh -l" alias sux="sudo tcsh -l" +set -P diff --git a/.login b/.login index 32e1a126d04b517d7aca96deb00392f6eca9b074..2754442fe49f94b01195d8abdbd59cdc5ec7842f 100644 --- a/.login +++ b/.login @@ -7,7 +7,11 @@ set path=($HOME/bin $path) alias sux sudo tcsh -l alias S SLS -P -alias tsv ~/bin/csv --TAB +alias tsv ~/bin/csv --UTF8 --TAB +setenv EDITOR `which vi` + +setenv LC_ALL en_US.UTF-8 +setenv LESSCHARSET utf-8 if (-x ~/.login.local) then source ~/.login.local diff --git a/.screenrc b/.screenrc index b1d3568b2cd684b50cce48ee7712b25ada91bf2d..a5f4d83fb47b8060fa7418b138314abcba3c131b 100644 --- a/.screenrc +++ b/.screenrc @@ -1,2 +1,3 @@ # turn Red Hat's annoying missfeature off hardstatus off +utf8 on diff --git a/ipv6off.sh b/ipv6off.sh new file mode 100755 index 0000000000000000000000000000000000000000..82e24ef35ae21c6266c56c572c7b343ef7adc60c --- /dev/null +++ b/ipv6off.sh @@ -0,0 +1,2 @@ +#!/bin/sh +sysctl -a net.ipv6.conf 2>/dev/null | awk '/disable_ipv6/ { print $1"=1"}' | xargs sysctl diff --git a/ipv6on.sh b/ipv6on.sh new file mode 100755 index 0000000000000000000000000000000000000000..e725dd6530e2e37c9f94fc898b04f18022ad0a77 --- /dev/null +++ b/ipv6on.sh @@ -0,0 +1,2 @@ +#!/bin/sh +sysctl -a net.ipv6.conf 2>/dev/null | awk '/disable_ipv6/ { print $1"=0"}' | xargs sysctl diff --git a/ipv6status.sh b/ipv6status.sh new file mode 100755 index 0000000000000000000000000000000000000000..b9b362793e5bc33e451212229422a688ee93506a --- /dev/null +++ b/ipv6status.sh @@ -0,0 +1,2 @@ +#!/bin/sh +sysctl -a net.ipv6.conf 2>/dev/null | awk '/disable_ipv6/' diff --git a/show_fingerprints.pl b/show_fingerprints.pl new file mode 100755 index 0000000000000000000000000000000000000000..46c2afc417066a7704073a8fccb8a898c8e9d66f --- /dev/null +++ b/show_fingerprints.pl @@ -0,0 +1,65 @@ +#!/usr/bin/perl + +=head1 NAME + + show_fingerprints.pl + +=head1 DESCRIPTION + + display fingerprints of all public keys and keys in authorized_keys + +=cut + +use strict; + +my ($version, $has_E)= get_ssh_version(); +my $hash_algorithm= 'MD5'; + +my @files= <*.pub>; +# print "files: ", join (' ', @files), "\n"; +push (@files, <authorized_keys*>); + +printf ("%-20s %5s %-51s %-6s %s\n", qw(file size fingerprint type notes)); +foreach my $file (@files) +{ + my @cmd= qw(ssh-keygen -l); + push (@cmd, '-E', $hash_algorithm) if ($has_E); + push (@cmd, '-f', $file); + + my $res= `@cmd`; + my @lines= split ("\n", $res); + foreach my $line (@lines) + { + my ($size, $fp, $notes)= split (' ', $line, 3); + + my $type= 'unknown'; + if ($notes =~ m#(.+)\s+\((.+)\)#) { ($notes, $type)= ($1, $2) } + $fp= join(':', $hash_algorithm, $fp) unless ($has_E); + + printf ("%-20s %5d %-51s %-6s %s\n", $file, $size, $fp, $type, $notes); + } +} + +sub get_ssh_version +{ + my @cmd= qw(ssh-keygen --version); # apparently, there is way to display the version directly + my $res= `@cmd 2>&1`; + + my $version= 'unknown'; + my $has_E= 0; + foreach my $l (split ("\n", $res)) + { + # print "[$l]\n"; + + if ($l =~ ' -L Print the contents of a certificate.') { $has_E= 0; } + elsif ($l eq ' ssh-keygen -l [-v] [-E fingerprint_hash] [-f input_keyfile]') { $has_E= 1; } + } + + ($version, $has_E); +} + +=head1 TODO + +optionally display fingerprints using other hashing algorithms + +=cut