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) Linux no permite scripts suid; y si se pudiera, hacerlo sería | |
*demasiado* estúpido. ¿La razón? cualquier usuario del sistema ahora | |
puede reiniciar tu servicio. Si te comprometen el FTP, y obtienen un | |
shell como ftp, boom, adios. | |
2) El esquema con dos usuarios, www-data y root, con www-data en | |
sudoers. Claro que puedes utilizar las facilidades de «sudo» para | |
limitar qué comandos puede ejecutar www-data. De esta forma, puedes | |
tener una entrada como: |
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
#!/usr/bin/env python | |
import sys | |
credit = 200 | |
prices = [150, 24, 79, 50, 88, 345, 3] | |
n = len(prices) | |
k = 0 | |
sort = sorted(enumerate(prices), key=lambda x:x[1]) | |
r = n - 1 |
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
#!/usr/bin/awk -f | |
BEGIN { | |
state = "base"; | |
} | |
{ | |
length_of_line = length; | |
for (i = 1; i <= length_of_line + 1; i++) { |
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
#!/bin/bash | |
trap 'rm -rf "$tempdir"' EXIT | |
tempdir=$(mktemp -d) | |
cd "$tempdir" || exit 1 | |
printf '%s\n' \ | |
'(return 2>/dev/null); echo $?' \ | |
> bash_return |
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
Supón que el disco duro es un gran arreglo. Se vería de la siguiente forma: | |
[ ][ ][ ][ ]...[ ] | |
Tradicionalmente el disco duro (arreglo) se particiona. Es decir, se segmenta el arreglo en sub-arreglos | |
todo con la intención de organizar el uso del disco, o destinar cada parte a una aplicación diferente. | |
Entonces, las particiones son elementos *físicos* de tu disco duro. Dentro de cada partición se usa un | |
"sistema de archivos". Este sistema de archivos permite al sistema operativo hacer un uso óptimo del | |
arreglo de bytes, es decir, guardar bloques de datos de forma eficiente, permitir que los bloques |
NewerOlder