Skip to content

Instantly share code, notes, and snippets.

View pulketo's full-sized avatar

Pulketo pulketo

View GitHub Profile
@pulketo
pulketo / gist:d1d64ee59919b01de494243396d8f499
Created August 23, 2021 20:41
vmware vsphere html5 client browser send Ctrl+Alt+F1 when you are using linux to vsphere web browser client
Basado en documentación en:
https://vdc-download.vmware.com/vmwb-repository/dcr-public/b7ae1097-9dc8-4323-9877-6e5380c54d17/48aca922-d7ac-455d-865d-50c9194de37a/HTML-Console-SDK-21.pdf
Ctrl+Alt+F1 es una tecla usada en las distribuciones de linux para cambiar de modo gráfico a modo consola, por ello cuando intentámos enviar esta combinación a una consola de vmware de html5, no nos es posible tan fácilmente, por ello, y como no se me ocurrió otra forma:
Abrir la consola javascript de firefox / chrome
y ejecutar los siguientes comandos:
-----
mywmks = WMKS.createWMKS("container", {});
mywmks.sendKeyCodes([17,18,112]) ; //Ctrl+Alt+F1
git clone https://github.com/jordansissel/keynav
con esta configuración para que no estámos locos o no usamos tanto vim:
teclas:
123
w
asd j
~/.keynavrc
------cut-here------
clear
ctrl+semicolon start
@pulketo
pulketo / gist:e667caaecdce677f4b4f6855b752dda7
Created July 23, 2021 04:51
get current active keyboard layout
sudo apt-get install git
mkdir -p `~/src`
cd `~/src`
git clone https://github.com/nonpop/xkblayout-state.git
cd xkblayout-state
make
#
./xkblayout-state print %s
#
src:https://stackoverflow.com/questions/21483050/get-current-active-keyboard-layoutlanguage-in-linux
@pulketo
pulketo / gist:b0fc67fcd42e1db021d090d60edb1bcc
Created July 1, 2021 20:29
etc fstab samba smb mount en linux
//10.x.y.z/Direcotorio\040con-espacios /dir-en-linux cifs credentials=/var/tmp/.smbcred,domain=DOMINIO,iocharset=utf8,sec=ntlm,vers=1.0 0 0
------
/var/tmp/.smbcred
-
username=mamartinez
password=xxxxxxxxx
------
@pulketo
pulketo / gist:45943bdf9ba07bdca043668e80cdd5cd
Created June 7, 2021 16:25
editar pdf en gimp imagemagick
convert -density 150 -antialias "doc.pdf" -resize 1024x -quality 100 "doc.png"
doc-0.png
doc-1.png
...
---
editamos en gimp etc y guardamos cada capa una hoja la primera hoja en la capa de hasta abajo y asi ya no será necesario -reverse y guardamos como mng
---
convert -reverse doc.mng doc-alterado.pdf
@pulketo
pulketo / gist:1904b84a13303d932741542036a856a3
Created May 25, 2021 00:58
Convertir archivo FDB a CSVs
https://www.rebasedata.com/ubuntu-read-fdb
curl -F files[]=@example.fdb https://www.rebasedata.com/api/v1/convert?outputFormat=csv -o output.zip
@pulketo
pulketo / gist:f83134bb302ddf67303ecfdd354d842b
Last active February 19, 2021 15:10
X forwarding RHEL
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
@pulketo
pulketo / gist:80480d5cca03c40364e863bffa8f1e94
Last active February 16, 2021 15:49
PHP documentation in the terminal
git clone https://github.com/rbakels/PHP-Documentation
alias pman="man -M ./PHP-Documentation/manpages"
#test with:
pman explode
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.
@pulketo
pulketo / dnormal.sh
Last active February 28, 2022 16:16
linux fb virtual screen (scroll screen)
#!/bin/bash
#Restore screen width to normal
DNAME=`xrandr | tail -n+2|head -n1| cut -d " " -f1`
WxH=`xrandr | grep \* | awk '{print $1}'`
W=`echo ${WxH}|cut -d "x" -f1`
H=`echo ${WxH}|cut -d "x" -f2`
xrandr --fb ${W}x${H} --output ${DNAME} --mode ${W}x${H} --panning ${W}x${H}