Subir archivos a "/"

This commit is contained in:
2025-06-16 20:42:50 +00:00
commit dc28f170be
5 changed files with 219 additions and 0 deletions

39
label.ksh Normal file
View File

@ -0,0 +1,39 @@
#!/bin/ksh
#----------------------
# format_label
# Automatic labeling of previously unlabeled disks
# 2006.08.31 ken.wachtler
#----------------------
# Enter a list of disks, as format's banner would report them
Disks="
c2t50060163446024C0d0
c2t50060163446024C0d1
c2t50060163446024C0d2
c2t50060163446024C0d3
c2t50060163446024C0d4
c2t50060163446024C0d5
c2t50060163446024C0d6
c2t50060163446024C0d7
c2t50060163446024C0d8
c2t50060163446024C0d9
c2t50060163446024C0d10
c2t50060163446024C0d11
c2t50060163446024C0d12
c2t50060163446024C0d13
c2t50060163446024C0d14
c2t50060163446024C0d15
"
for d in $Disks ; do
# write label
printf "label\nyes\nquit\n" | format -d $d
# check label
printf "\n\n${d}\n\n"
prtvtoc /dev/dsk/${d}s0 | egrep '^P |^ '
#echo "<cr> to cont: "
#read a
done

80
pcp.ksh Normal file
View File

@ -0,0 +1,80 @@
#!/usr/bin/ksh
#
# PCP (PID con Port)
# v1.10 08/10/2010 Sam Nelson sam @ unix.ms
#
# If you have a Solaris 8, 9 or 10 box and you can't
# install lsof, try this. It maps PIDS to ports and vice versa.
# It also shows you which peers are connected on which port.
# Wildcards are accepted for -p and -P options.
#
# Many thanks Daniel Trinkle trinkle @ cs.purdue.edu
# for the help, much appreciated.
i=0
while getopts :p:P:a opt
do
case "${opt}" in
p ) port="${OPTARG}";i=3;;
P ) pid="${OPTARG}";i=3;;
a ) all=all;i=2;;
esac
done
if [ $OPTIND != $i ]
then
echo >&2 "usage: $0 [-p PORT] [-P PID] [-a] (Wildcards OK) "
exit 1
fi
shift `expr $OPTIND - 1`
if [ "$port" ]
then
# Enter the port number, get the PID
#
port=${OPTARG}
echo "PID\tProcess Name and Port"
echo "_________________________________________________________"
for proc in `ptree -a | awk '/ptree/ {next} {print $1};'`
do
result=`pfiles $proc 2> /dev/null| egrep "port: $port$"`
if [ ! -z "$result" ]
then
program=`ps -fo comm= -p $proc`
echo "$proc\t$program\t$port\n$result"
echo "_________________________________________________________"
fi
done
elif [ "$pid" ]
then
# Enter the PID, get the port
#
pid=$OPTARG
# Print out the information
echo "PID\tProcess Name and Port"
echo "_________________________________________________________"
for proc in `ptree -a | awk '/ptree/ {next} $1 ~ /^'"$pid"'$/ {print $1};'`
do
result=`pfiles $proc 2> /dev/null| egrep port:`
if [ ! -z "$result" ]
then
program=`ps -fo comm= -p $proc`
echo "$proc\t$program\n$result"
echo "_________________________________________________________"
fi
done
elif [ $all ]
then
# Show all PIDs, Ports and Peers
#
echo "PID\tProcess Name and Port"
echo "_________________________________________________________"
for proc in `ptree -a | sort -n | awk '/ptree/ {next} {print $1};'`
do
out=`pfiles $proc 2>/dev/null| egrep "port:"`
if [ ! -z "$out" ]
then
name=`ps -fo comm= -p $proc`
echo "$proc\t$name\n$out"
echo "_________________________________________________________"
fi
done
fi
exit 0

19
perl_script.pl Normal file
View File

@ -0,0 +1,19 @@
use 5.010;
use strict;
use warnings;
say "What is your name? ";
my $name = <STDIN>;
chomp $name;
say "Hello $name, how are you?";
# Leer un fichero de texto
my $filename = 'C:\Users\Juan\12051601_merged.tcx';
open INFILE,$filename;
my $linea;
while ( $linea = <INFILE>) {
chomp($linea);
# Incluir aquí debajo el código para procesar la línea
print $linea . "\n";
}
close INFILE;

15
sonda.pl Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/perl
use LWP::UserAgent;
my $ua = LWP::UserAgent->new(
ssl_opts => { verify_hostname => 0 }
);
my $req = HTTP::Request->new(GET => 'https://concentra.bbva.com/sonda_BBVA.log');
my $res = $ua->request($req);
if ($res->is_success) {
print $res->as_string;
}
else {
print "Failed: ", $res->status_line, "\n";
}

66
ventas.awk Normal file
View File

@ -0,0 +1,66 @@
#!/usr/bin/nawk -f
BEGIN {
file="/export/oracle/scripts/oper_ult_min.txt"
if (ARGC == 2) {hoy=ARGV[1]}
else {"date +%Y%m%d" | getline hoy; }
while ((getline < file) > 0)
{
if ($0 ~ "^"hoy) {
split($0,cad,";");
sum_vpm+=cad[2];
sum_tventa+=cad[3];
sum_tsia+=cad[4];
hora=substr(cad[1],9,2);
min=substr(cad[1],11,2);
hhmm=hora":"min;
a_vpm[hora]+=cad[2];
a_tventa[hora]+=cad[3];
a_tsia[hora]+=cad[4];
a_tsermepa[hora]=a_tventa[hora]-a_tsia[hora];
a_count[hora]+=1;
count+=1;
if (mayor_vpm[hora]<cad[2]){mayor_vpm[hora]=cad[2]; hora_mayor_vpm[hora]=hhmm}
if (mayor_tventa[hora]<cad[3]){mayor_tventa[hora]=cad[3]; hora_mayor_tventa[hora]=hhmm}
if (mayor_tsia[hora]<cad[4]){mayor_tsia[hora]=cad[4]; hora_mayor_tsia[hora]=hhmm}
if (mayor_tsermepa[hora]<cad[3]-cad[4]){mayor_tsermepa[hora]=cad[3]-cad[4]; hora_mayor_tsermepa[hora]=hhmm}
}
}
close file
{
print "\n[Resumen Ventas -",hoy"]\n"
print (" --------------------------------------------------------------------------------------------------------------------------- ");
print (" | V E N T A S | T. C O M P L E T O | T. S I A | T. S E R M E P A |");
print (" -----------------------------------------------------------------------------------------------------------------------------------|");
print ("| Tramo | Total Med | Max Hora | Med | Peor Hora | Med | Peor Hora | Med | Peor Hora |");
print ("| ----- | ------ ---- | ----- ----- | --------- | --------- ----- | --------- | --------- ----- | --------- | --------- ----- |");
for (i=0;i<=23;i++ ) {
if (i<10) { i="0"i }
if (a_count[i]<1) {
a_count[i]=1;
a_vpm[i]=0; a_tventa[i]=0; a_tsia[i]=0;
mayor_tventa[i]=0; mayor_vpm[i]=0; mayor_tsia[i]=0; mayor_tsermepa[i]=0;
hora_mayor_tventa[i]="--:--"; hora_mayor_vpm[i]="--:--"; hora_mayor_tsermepa[i]="--:--"; hora_mayor_tsia[i]="--:--";
}
printf ("| %2s-%02d | %6s %3d | %5d %5s | %6d ms | %6d ms %5s | %6d ms | %6d ms %5s | %6d ms | %6d ms %5s |\n",
i,i+1,a_vpm[i],a_vpm[i]/a_count[i],mayor_vpm[i],hora_mayor_vpm[i],
a_tventa[i]/a_count[i],mayor_tventa[i], hora_mayor_tventa[i],
a_tsia[i]/a_count[i],mayor_tsia[i], hora_mayor_tsia[i],
a_tsermepa[i]/a_count[i],mayor_tsermepa[i], hora_mayor_tsermepa[i])
}
print (" ----------------------------------------------------------------------------------------------------------------------------------- ");
printf "\n"
printf " Total: %4s ventas procesadas en %d segundos (%d minutos)\n",
sum_vpm,sum_tventa/1000,sum_tventa/1000/60
printf " Media: %4d ventas por minuto, %d ms aprox. por venta\n\n",
sum_vpm/count,sum_tventa/count
}
}