This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 📄 Recomendaciones para Subir Archivos Grandes | |
Este documento explica las mejores prácticas para manejar archivos grandes (>100 MB) sin comprometer la seguridad, el rendimiento o la estabilidad de la plataforma protegida por PowerWAF. | |
--- | |
## ⚡ Por qué evitar `POST` directos muy grandes | |
- Cada petición HTTP grande consume RAM y CPU mientras se inspecciona. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install curl, host, nslookup and dig commands | |
apt-get install curl dnsutils -y | |
cd /tmp | |
wget https://s3.amazonaws.com/bitly-downloads/nsq/nsq-1.2.1.linux-amd64.go1.16.6.tar.gz | |
tar -xzf nsq-1.2* | |
cd nsq-1.2.1.linux-amd64.go1.16.6/bin | |
mkdir -p /opt/nsq | |
cp * /opt/nsq/ | |
# for testing purposes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Prometheus | |
Wants=network-online.target | |
After=network-online.target | |
[Service] | |
User=prometheus | |
Group=prometheus | |
Type=simple | |
ExecStart=/opt/prometheus \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fix Float64 precision for arithmetics in Go | |
// For go version >= 1.10 | |
func FixFloatPrecision(num float64, precision int) float64 { | |
pow := math.Pow10(precision) | |
return math.Round(num*pow) / pow | |
} | |
// If no float.Round (< go 1.10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Descargar imagen desde: | |
# Ubuntu | |
wget https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-arm64.img | |
# Debian for ARM-64 | |
wget https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-arm64.qcow2 | |
# Debian for AMD-64 | |
https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2 | |
2- subir a object storage en oci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With the next file: | |
Line 1 | |
Line 2 | |
Line 3 | |
Line 4 | |
Insert line BEFORE pattern | |
sed '/ine 4/ i Inserted line' file.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The command | |
cmd := exec.Command("ls", "-al") | |
stdout, _ := cmd.StdoutPipe() | |
scanner := bufio.NewScanner(stdout) | |
err = cmd.Start() | |
if err != nil { | |
log.Println("Error executing command: %s", err) | |
return err | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Phalcon\Cache\Backend\File as BackFile; | |
use Phalcon\Cache\Frontend\Data as FrontData; | |
// Cache the files for 10 minutes using a Data frontend | |
$frontCache = new FrontData(['lifetime' => 600 ]); | |
// Create the component that will cache 'Data' to a 'File' backend | |
// Set the cache file directory - important to keep the `/` at the end of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Abrir archivo para append */ | |
f, err := os.OpenFile("/tmp/recepcion.txt", os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0644) | |
if err != nil { | |
log.Println("Error opening file",err.Error()) | |
return | |
} | |
defer f.Close() | |
/* Escribir al archivo */ | |
_, err = fmt.Fprintln(f, string(buf)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$robots = Robots::find( [ | |
'conditions' => 'type = ?1', | |
'bind' => [ 1 => 'virtual' ] | |
] | |
); | |
if (empty($robots)) { echo "Not found" } | |
------------------- |
NewerOlder