Skip to content

Instantly share code, notes, and snippets.

View ingmarioalberto's full-sized avatar

SysAdminMarioAlberto ingmarioalberto

View GitHub Profile
60 horas - ultimo viernes y sabado examen
http://diplomado.gnuin0.info
on-premise: datacenter que se encuentra en las empresas
Sistema operativo: Software que gestiona la omunicacion entre una
persona y un sistema. Conj. de progs que trabajan coord para admin de
manera optima los recursos físicos de una computadora.
Como bootea una PC BIOS->MBR->GRUB->Kernel->Init>Runlevel
Hints:
- El profesor indica que es mejor no tener swap
- Al instalar oracle en el apartado de Servers -> System Administration Tools, por default no viene ninguno seleccionado, por lo que hay que manualmente agregar: oracle-rdbms-server-12cR1
Profesor: Conde
https://loquecallamoslosdba.wordpress.com/
RTO Recovery Time Objective: tiempo en el cual yo espero recuperarme
RPO Recovery Point Objective: tiempo que transcurre entre el momento del desastre y el último punto de restauración.
Banco RPO ~= 0
que tanto puedo perder
@ingmarioalberto
ingmarioalberto / gist:d8481feefd7f1a860d11a935dcf08c8d
Created April 22, 2022 03:14
Instalación Jenkins-Gitlab RHEL7
*Instalación en google cloud, imágen con Centos 7 on 20GB HD, 3.75GB RAM, 1vCPU
sudo yum -y update
sudo yum install -y curl policycoreutils-python openssh-server wget
sudo firewall-cmd --zone=public --permanent --add-service=http
success
sudo firewall-cmd --zone=public --permanent --add-service=https
success
sudo firewall-cmd --zone=public --permanent --list-all
target: default
icmp-block-inversion: no
@ingmarioalberto
ingmarioalberto / haproxy2apache
Created May 6, 2022 15:44 — forked from travishegner/haproxy2apache
A quick bash one liner to convert haproxy logs to something like apache logs so that logstalgia can read them
ssh USER@IP tail -f /var/log/haproxy-traffic.log | stdbuf -o0 awk '{print $9" "$6" - - "$7" "$18" "$19" "$20" "$11" "$12}' | sed -u "s/:[0-9]\{4,5\}//g" | sed -u "s/\(:[0-6][0-9]\)\.[0-9]\{3\}/\\1 -400/g" | logstalgia --sync --paddle-mode vhost
@ingmarioalberto
ingmarioalberto / gist:9862dffd111cd32e1a354df42e6804c1
Last active July 1, 2022 16:17
Date & Time in dmesg (human)
dmesg_human () { $(type -P dmesg) "$@" | perl -w -e 'use strict;
my ($uptime) = do { local @ARGV="/proc/uptime";<>}; ($uptime) = ($uptime =~ /^(\d+)\./);
foreach my $line (<>) {
printf( ($line=~/^\[\s*(\d+)\.\d+\](.+)/) ? ( "[%s]%s\n", scalar localtime(time - $uptime + $1), $2 ) : $line )
}'; }
// https://stackoverflow.com/questions/13890789/convert-dmesg-timestamp-to-custom-date-format
// cred: https://stackoverflow.com/users/636849/lucas-cimon
@ingmarioalberto
ingmarioalberto / gist:2320fda7a91987721fc34e9a4f2fa2dd
Created July 1, 2022 16:21
Download google driver within the terminal #bash #wget
#ID=google document reference id
FILEID="ID"; wget "https://drive.google.com/uc?export=download&id=${FILEID}&confirm=yes"
#credits: https://stackoverflow.com/questions/37453841/download-a-file-from-google-drive-using-wget#comment127131320_39087286
@ingmarioalberto
ingmarioalberto / gist:3cf05baaa010e63760745f01218511a5
Created July 8, 2022 14:16
acordeones: visudo sudo config file
root ALL=(ALL:ALL) ALL
| | | | |
| | | | +-Command or All commands (without password?
| | | | add NOPASSWD: before keyword)
| | | +------Run cmd as Group or All groups
| | +----------Run cmd as User or All users
| +---------------Host or All hosts
+--------------------sys user or "sys %group" or "user aliases" to apply rule
User_Alias ~= groups (first letter must be uppercase)
OVA / OVF import vmware 6.5: Stuck on validating / validando ?
R= Make sure you are not logged in on the vcenter with the IP address, use FQDN instead.
@ingmarioalberto
ingmarioalberto / gist:807d723274c72c1015050564f4b45206
Created July 20, 2022 21:10
shrink a virtualbox disk guest to free space on host
1. Verify it is a Dynamic Disk || convert it to dynamic
2. zerotise empty space:
windows guest: (tested)
2.1 download sdelete.exe (https://docs.microsoft.com/en-us/sysinternals/downloads/sdelete)
2.2 as administrator, run: sdelete.exe c: -z
linux guest: (untested)
2.1 install zerofree
2.2 reboot into recovery mode
2.3 drop to root shell
2.4 zerofree -v /dev/sdXY
@ingmarioalberto
ingmarioalberto / lvgen.sh
Last active August 21, 2022 02:59
generate lvm and add to etc/fstab
#!/bin/bash
die () {
if [ -z "$1" ]
then
echo "something went very wrong..."
else
echo "NOK:${1}"
fi
exit 1
}