From dc28f170be08c5d74e371862f37b90f721dac579 Mon Sep 17 00:00:00 2001 From: juanlf Date: Mon, 16 Jun 2025 20:42:50 +0000 Subject: [PATCH] Subir archivos a "/" --- label.ksh | 39 ++++++++++++++++++++++++ pcp.ksh | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ perl_script.pl | 19 ++++++++++++ sonda.pl | 15 ++++++++++ ventas.awk | 66 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 219 insertions(+) create mode 100644 label.ksh create mode 100644 pcp.ksh create mode 100644 perl_script.pl create mode 100644 sonda.pl create mode 100644 ventas.awk diff --git a/label.ksh b/label.ksh new file mode 100644 index 0000000..686e704 --- /dev/null +++ b/label.ksh @@ -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 " to cont: " + #read a + +done diff --git a/pcp.ksh b/pcp.ksh new file mode 100644 index 0000000..3b675f4 --- /dev/null +++ b/pcp.ksh @@ -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 diff --git a/perl_script.pl b/perl_script.pl new file mode 100644 index 0000000..126fb78 --- /dev/null +++ b/perl_script.pl @@ -0,0 +1,19 @@ +use 5.010; +use strict; +use warnings; + +say "What is your name? "; +my $name = ; +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 = ) { + chomp($linea); + # Incluir aquí debajo el código para procesar la línea + print $linea . "\n"; +} +close INFILE; \ No newline at end of file diff --git a/sonda.pl b/sonda.pl new file mode 100644 index 0000000..457069b --- /dev/null +++ b/sonda.pl @@ -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"; +} \ No newline at end of file diff --git a/ventas.awk b/ventas.awk new file mode 100644 index 0000000..a35fe77 --- /dev/null +++ b/ventas.awk @@ -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]