View gist:f83134bb302ddf67303ecfdd354d842b
yum install -y xorg-x11-xauth xorg-x11-fonts-\* xorg-x11-utils xorg-x11-apps | |
/etc/ssh/sshd_config: | |
X11Forwarding yes | |
X11UseLocalhost yes | |
ssh -XY user@host | |
echo $DISPLAY | |
xclock |
View gist:80480d5cca03c40364e863bffa8f1e94
git clone https://github.com/rbakels/PHP-Documentation | |
alias pman="man -M ./PHP-Documentation/manpages" | |
#test with: | |
pman explode |
View gist:4334e3713b4bf9aca0a8ee583e448f2d
problem: | |
# ./configure | |
... | |
... | |
# make | |
/bin/cc -o perl.o -c perl.c -D_DEBUG_ | |
perl.c:9:20: fatal error: EXTERN.h: No such file or directory | |
#include <EXTERN.h> | |
^ | |
compilation terminated. |
View gist:598b0ecb8e259ac4c5086685f7d58896
todo: convert to script | |
suponiendo que tienes una pantalla de 1024x600 y quieres simular una pantalla de 1600x1200 | |
xrandr --fb 1600x1200 --output LVDS-1 --mode 1024x600 --panning 1600x1200 |
View gist:b15078db8d410748b322f8768df4ab39
sudo apt-get install mouseemu | |
edit:/etc/default/mouseemu | |
showkey para obtener x | |
SCROLL="-scroll x" |
View gist:69972fec50810782e2e57ab14806bc76
----END CERTIFICATE----------BEGIN RSA PRIVATE KEY----- | |
After I split it I could start HaProxy and load it OK: | |
*-----END CERTIFICATE----- | |
-----BEGIN RSA PRIVATE KEY-----* |
View gist:658d163c8ed121f41ad58f86b74c04f4
sar | |
Cannot open /var/log/sa/saXX: No such file or directory | |
(and/or: "Please check if data collecting is enabled") | |
solution: | |
sudo service sysstat restart |
View gist:4a95cf86cffacaf26f224ee08ad77779
chage -I -1 -m 0 -M 99999 -E -1 username |
View 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 |
View gist:192fa5217143b0745045e35899f81f50
por ejemplo tenémos esos días como días buenos (16,17,18,19,2x) en un horario de 22:30 a 23:50 | |
la sexta columna de sar -p es IOwait. | |
*tomar en cuenta que el formato de hora de SAR varía de acuerdo al locale, así que si hay que forzar un locale: | |
LC_TIME=en_UK.utf8 sar ... | |
find /var/log/sa/202005/ -iname "sa16" -o -iname "sa17" -o -iname "sa18" -o -iname "sa19" -o -iname "sa2?" -exec sar -p -f {} \; |grep -e '^22:[3-5]' -e '^23:'| awk '{print $6}' | awk '{for(i=1;i<=NF;i++) {sum[i] += $i; sumsq[i] += ($i)^2}} END {for (i=1;i<=NF;i++) {printf "%f %f \n", sum[i]/NR, sqrt((sumsq[i]-sum[i]^2/NR)/NR)}}' | |
1.360417 1.324867 | |
Dándo como resultado promedio(avg)=~1.36 y SD=~1.32 | |
Por lo tanto todo lo que esté arriba de 1.36+1.32*2 o abajo de 1.36-1.32*2 se le consideraría estadísticamente anormal |
NewerOlder