Project

General

Profile

« Previous | Next » 

Revision e1f73faf

Added by dsorber over 8 years ago

Adding two misc scripts that have been sitting on my desktop for a while now. They may be useful later on, if I can remember they exist.

View differences:

software/misc/import-cert.sh
#!/bin/sh
#
# usage: import-cert.sh remote.host.name [port]
#
REMHOST=$1
REMPORT=${2:-443}
exec 6>&1
exec > $REMHOST
echo | openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "$REMHOST" -i $REMHOST
exec 1>&6 6>&-
software/misc/proc_speeds.sh
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
NUM_CPUS=$( cat /proc/cpuinfo | grep processor | wc -l )
echo -e $NUM_CPUS" CPUs detected\n\n"
# at /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq
for ((idx=0;idx<NUM_CPUS;idx++)); do
printf "\t%02d -- " "$idx";
cat /sys/devices/system/cpu/cpu$idx/cpufreq/cpuinfo_cur_freq
done

Also available in: Unified diff