SSH
sshfs root@192.168.69.235 -p 61786 /punto-montaje rsync -az -e "ssh -p 61786" root@181.75.151.213:/var/www/sistema . rsync -az --exclude 'nnasunknown/.git' --exclude 'nnasunknown/.mozilla' --exclude 'nnasunknown/.cache' --exclude 'nnasunknown/.thumbnails' --exclude 'nnasunknown/Música' --exclude 'nnasunknown/Descargas' nnasunknown@192.168.69.26:/home/nnasunknown . ssh root@181.75.151.213 -p61786 sshfs kdeconnect@192.168.69.40:/storage /home/nnasunknown/.kde/share/apps/kdeconnect/a2e6ca391c4fabb0 -p 1739 -d -f -o IdentityFile=/home/nnasunknown/.kde/share/apps/kdeconnect/key.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null sshfs kdeconnect@192.168.69.40:/ /home/nnasunknown/.kde/share/apps/kdeconnect/a2e6ca391c4fabb0 -p 1739 -d -f -o IdentityFile=/home/nnasunknown/.kde/share/apps/kdeconnect/key.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/nul
Credenciales
ssh-keygen -b 10240 -t rsa -C "Equipo Hadit NnAsUnKnOwn" -f id_rsa-nnasunknown ssh-copy-id -i id_rsa-nnasunknown.pub root@tecgnus.cl ssh root@tecgnus.cl -i id_rsa-nnasunknown ssh-keygen -b 10240 -t rsa -C "Equipo Hadit NnAsUnKnOwn" -f id_rsa ssh-copy-id -i id_rsa.pub root@tecgnus.cl ssh root@tecgnus.cl -i id_rsa
Fuentes
- fc-list
- xfd
fc-list fc-list :fontformat=TrueType -f "%{family}\n" | sort -u xfd -fa 1"xft:monospace:size=8:antialias=true"
Editores
- nano
- vim
- jed
- emacs
- pico
- mped #curses for programming
- levee #curses based on vim
Gestor de repositorios apt
- aptitude
- apt
- dpkg
Desarrollo
make menuconfig
Navegadores
- dwb
- lynx
- w3m
File Managers
- mc #curses #Midnight Commander – a powerful file manager
- vifm #curses #un gestor de archivos basado en ncurses con atajos tipo vi
- nautilus
- spacefm
- kupfer
- synapse
- catfish
- pcmanfm
- gmrun
- dmenu
- ncdu #curses #disk usage viewe
Curses
- tina #text-based personal information manager
- alpine #Cliente de correo electrónico en modo texto, amigable para los novatos, pero potente
- mutt #Lector de correo en modo texto que soporta MIME, GPG, PGP y seguimiento de hilo
- abook #Agenda de direcciones en ncurses
- textdraw #Tool to draw/modify/move geometric figures & text for ASCII art
- tpp #text presentation program
- calcurse #text-based calendar and todo manager
- charm #terminal based blogs publishing application
- rtorrent #ncurses BitTorrent client based on LibTorrent from rakshasa
- aview #Un visor de imágenes y reproductor de vídeo en arte en código ASCII de alta calidad.
- vux #command-line Audio Player
- multitail #view multiple logfiles windowed on console
Backgrounders :
- disown
- nohup
- screen
- tmux
- bg
Cpu Gobernors :
- cpulimit
- cpufreqd
- ondemand
- cpufrequtils
- loadcpufreq
cpulimit -c 4 -l 50 -P /usr/lib/abrowser/abrowser
echo conservative | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Diseño y dibujo :
- librecad
- freecad
- gimp
- inkscape
Escritorios remotos
- remmina
- rdesktop
Electrónica :
- KiCad
*.{pro,net,sch,brd,lst} #kiCad Files
- gschem
- geda
- easyspice
- pcb
- oregano
- tkgate
- qucs
SoftPhone :
- linphone
- qutecom
- twinkle
- ekiga
- yate
- jitsi
Web Mail Client :
- roundcube4
- squirrelmail
*wk MTA :
- exim
- postfix
- sendmail
- thunderbird
Mensajeria Instantanea :
- pidgin
- finch #ncurses #pidgin
- weechat-curses #curses
- irssi #curses
- bitlbee #curses
- barnowl #curses
- thunderbird
Status & Menus Bars :
- dzen2
- dmenu
- xmobar
- tint2
Configuracion X Server
- wmctrl
- xlsfonts
- xlsatoms
- xwininfo
- xprop
- editres
- xrdb
- appres
- listres
xprop | grep STRUT
- xev
- xlsclients :
xlsclients -m 10 -l 2>&1 | grep -o -E '(0x[[:xdigit:]]{7})' | xargs -L1 -I ARG xprop -id ARG _NET_WM_PID | grep -E 'xcalc|$'
- cvt
- xvt
- gtf
- startx
- xrdb
xrdb -load $HOME/.Xresources
- xsetroot -solid gray &
- xinit
Comandos Bind Keys :
- xev
- xmodmap
- lshal
- showkey
GTK Testers
- awf-gtk3
- awf-gtk2
- lxappearance
WebApp, P2P, etc :
- yacy
- freenet
- ttrss
- Owncloud
- NextCloud
- SparkleShare
- Stacksync
- OpenStack
- nicotine
- opencart
- woocommerce
Reproductores :
- ncmpcpp #curses
- clementine
- vlc
- mpv
Redes
- speedometer $speedometer -rx wlan0 -tx wlan0
- iftop #curses
- iptraf #curses
- ifstatus
- mtr
- netstat -anltp
- nmap
nmap -v -sP 192.168.69.0/24
Wifi :
- iwlist
iwlist wlan0 scan
- iw
iw dev wlan0 scan
- wpa_cli
- wpa_gui
- wavemon
- wicd-curses
Virtualbox :
dpkg-reconfigure virtualbox-dkms dpkg-reconfigure virtualbox #raw2virtualbox: dd if=/dev/sdc of=/path/to/output/disk-image.iso VBoxManage convertfromraw /path/to/output/disk-image.iso /path/to/output/disk-image.vdi apt-get install linux-headers-$(uname -r) ls /lib/modules/$(uname -r)/kernel/drivers dpkg -i virtualbox-4.1_4.1.36-97684~Debian~wheezy_i386.deb vim /etc/default/virtualbox
Apt-get
To build a package from source, first install the build dependencies: sudo apt-get build-dep <package> Then use dpkg-buildpackage to create a .deb file. From APT and Dpkg Quick Reference Sheet: dpkg-buildpackage Builds a Debian package from a Debian source tree. You must be in the main directory of the source tree for this to work. Sample usage: dpkg-buildpackage -rfakeroot -uc -b Where -rfakeroot instructs it to use the fakeroot program to simulate root privileges (for ownership purposes), -uc stands for “Don’t cryptographically sign the changelog”, and -b stands for “Build the binary package only” In a terminal, cd into the directory containing the package source (e.g ~/code/hellanzb-0.13) and run the following command: dpkg-buildpackage -rfakeroot -uc -b If the build is successful, there will be a .deb file located in the parent directory (e.g ~/code/hellanzb_0.13-6.1_all.deb).
apt-get source <package> apt-get build-dep <package>
Comandos Grabar ISO :
wodim -eject -tao speed=2 dev=/dev/sr1 -v -data myiso.iso growisofs -dvd-compat -Z /dev/sr1=myiso.iso
Comandos File Openers :
- xdg-open
- gvfs-open
- kde-open
- exo-open
- run-mailcap
- mailcap
- update-mime
run-mailcap | see cat /etc/mailcap update-mime-database /usr/share/mime cat /etc/mime.types cat mimeapps.list
Programitas :
- wavemon
- speedometer $speedometer -rx wlan0 -tx wlan0
- wicd-curses #curses
- iftop #curses
- ifstatus
- mtr #curses
- htop #curses
- alsamixer
- dstat
- cvt
- xvt
- gtf
Monitores curses
- atop
- htop
- cbm
muestra el tráfico de red actual en colores
- bwm-ng
small and simple console-based bandwidth monitor
- dstat
herramienta estadística versátil de recursos. #its the replacement of vmstat, iostat, netstat and ifstat.
- iotop
simple top-like I/O monitor
- iostat
- netstat
- ifstat
- bmon
monitor de ancho de banda portátil y estimador de franja
- apachetop
Herramienta de monitorización de Apache en tiempo real
- saidar
curses-based program which displays live system statistics
- vnstat
console-based network traffic monitor
- ethstatus
console-based ethernet statistics monitor
Terminos Para Aprender :
- tls
- sassl
- ssl
- ldap
- heartbeat
- drbd
- rsync
- haproxy
- ldirectord
- qos
- nagios
Stream :
ffmpeg -r 40 -s 1024x768 -f x11grab -i :0.0 http://localhost:8090/webcam.ffm <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="320" height="240"> <param name="movie" value="archivo.swf" /> <param name="quality" value="high" /> <embed src="http://localhost:8090/webcam1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="32" height="32"></embed> </object> ffmpeg -i tbe.flv -ss 00:00:12 -t 00:00:4.300 -s 600x450 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=7 --loopcount > output.gif
VIM Commands :
:so $VIMRUNTIME/syntax/hitest.vim
- Reemplazar :
:1,$ s/original/otro/g :1,$ s/SESSION_USER/SESSION_USR/g :1,$ s/|\ \ /\t/g : Reemplazar pipes por tabs. <CTRL>+W : Cambia de foco :vs | :30sp : Split vertical para la ventana con el foco :sp | :30sp : Split horizontal para la ventana con foco :vertical resize 30 : determina el tamaño de la ventana con foco :res +10 | res -10 :mksession <file> : Graba session $ vim -p * $ vim -S <file> : Abre session grabada :TlistToggle : Script ctags
- Add & Remove TABS to selection
SHIFT+[ > | < ]
- El punto ( . ), repite la ultima operacion.
- v + CTRL+V (SELECCIONAR AREA A COMENTAR) + I (INSERTAR) + ESC ESC
Elimina Logs
find . -regextype posix-extended -regex '^.*\.(log\.[0-9]{1}|gz)$' -exec rm - rf {} \; find . -regextype posix-extended -regex '^.*\.([0-9]{1}|log\.[0-9]{1}|gz)$' -exec rm -rf {} \;
Busqueda, muestra archivo t :
find . -exec egrep -in -H 'mysqlConsulta' {} \;
Busca por expresion y ejecuta una accion :
find . -exec egrep -l 'nnasunknown' {} \; 2>&1 | grep -v -e directorio -e .git\/ | xargs -L1 -I ARG0 sed -i.bk "s/nnasunknown/juanin/g" ARG0 find . -exec egrep '(\["sistema"\]|\['sistema'\]|tecgnus)' {} \; find . -exec egrep -l '(\["sistema"\]|\['sistema'\])' {} \; | xargs -L1 -I ARG0 sed "s/\[[',\"]sistema[',\"]\]//g" ARG0 find . -exec egrep -l '(\["sistema"\]|\['sistema'\])' {} \; | xargs -L1 -I ARG0 cp ARG0 pruebas/ find . -exec egrep -l '(\["sistema"\]|\['sistema'\])' {} \; | xargs -L1 -I ARG0 sed -i.bk "s/\[[',\"]sistema[',\"]\]//g" ARG0 find . -name "mod_*.zip" -exec unzip -xo {} \; find . -exec grep -l \'sistema\' {} \; | xargs -L1 -I ARG0 sed "s/\['sistema'\]//g" ARG0 > ARG0 find . -exec grep -l new\ ClassConfiguracion {} \;
Encontrar solo archivos desde la posicion actual en una profundidad de 10 directorios con cualquier nombre y antiguedad mayor o igual a cuatro horas
find . -maxdepth 10 -type f -name '*' -mmin -240 -exec du -hk --max-depth=0 {} \; | awk '{print $2}' | more
Encontrar directorios y archivos desde la posicion actual en una profundidad de 10 directorios con cualquier nombre y antiguedad mayor o igual a cuatro horas
find . -maxdepth 10 -name '*' -mmin -240 -exec du -hk --max-depth=0 {} \; | awk '{print $1}'
enlaces simbolicos recursivos :
find ../mysql/bin -type f -name '*' -exec ln -s {} \; find . -name '*.php' -exec grep -l \'Orders\' {} \; | xargs -L1 -I ARG0 sed -i.bak "s/'Orders'/'Órdenes'/g" ARG0 sudo cat /var/log/auth* | grep Accepted | awk '{print $1 " " $2 "\t" $3 "\t" $11 "\t" $9 } nast -m
Tamaño de archivos ocultos
du -sk .[!.]* *| sort -n watch -n1 du -sch .[!.]* * \| sort -h \| pr -3 -t2
Buscar archivos con find
find . -wholename '*shorewall/masq' -exec cat {} \; find -type f -printf '%P\000' | egrep -iz '\.(avi|mpg|mov|flv|wmv|asf|mpeg|m4v|divx|mp4|mkv)$' | sort -z | xargs -0 ls -1 > sendemail -f chinoforeverr@hotmail.com -t nnasunknown@gmail.com -s smtp.live.com:587 -u Prueba1 -m "USB Attached" -xu chinoforeverr@hotmail.com -xp awakeningpath361 -o tls=yes openssl s_client -starttls smtp -crlf -connect smtp.live.com:587 perl -MMIME::Base64 -e 'print encode_base64("\000chinoforeverr\@hotmail.com\000awakeningpath361")' openssl s_client -connect smtp.live.com:587 -starttls smtp -crlf
Cambiar fondo pantalla GDM
xhost +SI:localuser:gdm sudo -u gdm dbus-launch gnome-control-center wget -r -q -O - "http://192.168.69.1:8004" | buffer -S 760 |sox -t flac - -t alsa default wget "http://LONG&BIZARRE-FILEURI" --output-document "La Danza de Los Mirlos.mp3"
Bash
sync && echo 3 > /proc/sys/vm/drop_caches rm -rf .*.{swn,swo,swp,swl,swm} ls -Sh | head -n 10 | xargs tar -cvf los10masFat.tgz ls *.{gz,php} echo w{i,e}on
Dividir archivos por cantidad de filas
wc -l alarchivo.da1 => si el archivo tiene más de 5000 registros dividirlo.
sed -e 's/,/\t/g' x.txt > ./x.txt
head -n 5000 x.txt > vi1.txt
tail -n+5001 x.txt | head -n 5000 > vi2.txt
tail -n+10002 x.txt | head -n 5000 > vi3.txt
tail -n+15003 x.txt | head -n 5000 > vi4.txt
tail -n+20004 x.txt | head -n 5000 > vi5.txt
tail -n+25005 x.txt | head -n 5000 > vi6.txt
tail -n+30006 x.txt | head -n 5000 > vi7.txt
tail -n+35007 x.txt | head -n 5000 > vi8.txt
tail -n+40008 x.txt | head -n 5000 > vi9.txt
tail -n+45009 x.txt | head -n 5000 > vi10.txt
tail -n+50010 x.txt | head -n 5000 > vi11.txt
tail -n+55011 x.txt | head -n 5000 > vi12.txt
Haskell :
envVar x = do var <- getEnv x return (var) homeDir = envVar "HOME" envPath = envVar "PATH"
Buscar archivos por tipo mime
find . -name '*' -exec file {} \; | grep -o -P '^.+: \w+ image' | cut -d \: -f1 >> ./images.txt cat images.txt | xargs -L1 -I ARG0 rsync -a --relative ARG0 ahorati/
Sed Como :
Borrar una línea
sed 'nºd' fichero sed '1d' fichero
Indicar un intervalo de líneas a borrar.
sed '3,5d' fichero
También podemos indicar que queremos borrar desde una determinada línea en adelante
sed '3,$d' fichero
Borrar líneas en blanco de un fichero
sed '/^$/d' fichero
Elimina comentarios #
sed '/^#/d' /etc/services
A la hora de borrar, también podemos especificar una cadena, de tal forma que el comando borrará todas las líneas que contengan esa cadena
cat fichero | sed '/^[ ]*$/d' > ficherodestino sed '/git/d' .bash_history >> .bash_history.sinGit
Otro de los usos interesantes es borrar los espacios al comienzo de cada línea
sed 's/^ *//g' fichero
O borrar los espacios al final de cada línea
sed 's/ *$//g' fichero
Sustituir una cadena por otra
sed 's/cadena1/cadena2/' fichero
Al ejecutar el comando anterior, se sustituye la primera cadena que encuentra por la segunda. Pero, si lo que queremos es sustituir todas las cadenas que encuentre, en cada una de las líneas, añadimos el parámetro g:
sed 's/cadena1/cadena2/g' fichero
Sustituir cadena1 por cadena2 en un número de línea concreto
sed '5 s/USUARIO/usuario/g' fichero
Tenemos un fichero con campos en los que el separador es el tabulador y queremos sustuir este caracter separador por otro caracter separador, como por ejemplo el punto y coma (;)
sed 's/\t/;/g' fichero
Mostrar lineas que comienzan con d y e, parametro -n muestra solo coincidencias
sed -n -e '/^[de]/p' texto1
Al mezclar dos expresiones imprimimos /p desde linea Vivimos hasta linea tecnologia
sed -n -e '/Vivimos/,/tecnología/p' texto1
Notification daemons
/usr/lib/i386-linux-gnu/notify-osd /usr/lib/notification-daemon/notification-daemon
Arduino UNO
avrdude -c arduino -p m328p -P /dev/ttyUSB1 -b 115200 -U flash:w:frser-duino.hex
Youtube-Dl
#| jq -r '.id + "\t" + .title' youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.title + "\thttps://youtube.com/watch?v=" + .id' youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.id' | sed 's_^_https://youtube.com/watch?v=_' youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.title + "\thttps://youtube.com/watch?v=" + .id' | dmenu -l 10 | awk -F $'\t' '{print $2} youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.title + "\thttps://youtube.com/watch?v=" + .id' | dmenu -l 10 | awk -F $'\t' '{print $2}' | xargs -L1 -I ARG0 mpv `youtube-dl -g "ARG0"` youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.title + "\thttps://youtube.com/watch?v=" + .id' | dmenu -l 10 | awk -F $'\t' '{print $2}' | xargs -L1 -I ARG0 youtube-dl -g "ARG0" | xargs -L1 -I ARG0 mpv ARG0 youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.title + "\thttps://youtube.com/watch?v=" + .id' | dmenu -l 10 | awk -F $'\t' '{print $2}' | xargs -L1 -I ARG0 youtube-dl -g "ARG0" | xargs -L1 -I ARG0 mpv ARG0 youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.title + "\thttps://youtube.com/watch?v=" + .id' | dmenu -l 10 | awk -F $'\t' '{print $2}' | xargs -L1 -I ARG0 youtube-dl -g "ARG0" | xargs -L1 -I ARG0 mpv ARG0 youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.title + "\thttps://youtube.com/watch?v=" + .id' | dmenu -l 10 | awk -F $'\t' '{print $2}' | xargs -L1 -I ARG0 youtube-dl -g "ARG0" | xargs -L1 -I ARG0 mpv ARG0 youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.title + "\thttps://youtube.com/watch?v=" + .id' | dmenu -i -nb $myBgColor -nf $myFgColor -sb $mySbgColor -l 10 | awk -F $'\t' '{print $2}' | xargs -L1 -I ARG0 youtube-dl -g "ARG0" | xargs -L1 -I ARG0 mpv ARG0 youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.title + "\thttps://youtube.com/watch?v=" + .id' | dmenu -i -nb $myBgColor -nf $myFgColor -sb $mySbgColor -l 10 | awk -F $'\t' '{print $2}' | xargs -L1 -I ARG0 youtube-dl -g "ARG0" | xargs -L1 -I ARG0 mpv ARG0 youtube-dl -j --flat-playlist "https://www.youtube.com/watch?v=4Cg2O4SsHQw&index=2&list=PL7HuF7ngaDLVozZqOdWqcxS6nNRJfq3iT" | jq -r '.title + "\thttps://youtube.com/watch?v=" + .id' | dmenu -i -fn "$myXftFont" -nb $myBgColor -nf $myFgColor -sb $mySbgColor -l 10 | awk -F $'\t' '{print $2}' | xargs -L1 -I ARG0 youtube-dl -g "ARG0" | xargs -L1 -I ARG0 mpv ARG0 youtube-dl -o - N6voHeEa3ig | mpv -cache 1024 - youtube-dl -o - "https://www.youtube.com/watch?v=N6voHeEa3ig" | mpv -
build VIM
apt-get install libpython3.4-dev libpython2.7-dev make clean && make distclean && make uninstall && ./configure --prefix=/usr/ --enable-fontset --enable-multibyte --with-x --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ --with-python3-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/ --enable-pythoninterp --enable-python3interp --enable-gui=no ./configure --prefix=/home/juanin/Descargas/PROGRAMAS/builded/vim/builded/ --enable-fontset --enable-multibyte --with-x --with-python-config-dir=/usr/lib/python2.7/config-i386-linux-gnu/ --with-python3-config-dir=/usr/lib/python3.4/config-3.4m-i386-linux-gnu/ --enable-pythoninterp --enable-python3interp make make install