Herramientas de usuario

Herramientas del sitio


wiki2:linux_tools

¡Esta es una revisión vieja del documento!


Linux Tools

KeyLogger

$ logkeys --start -d /dev/input/event6 -m /home/alfred/Desktop/logkeys-master/keymaps/es_ES.map
--no-daemon
--no-func-keys
--output file

Enable, disable, and check the Ubuntu firewall

sudo ufw enable
sudo ufw disable
sudo ufw status

Limit downloading

sudo apt-get -y install wondershaper
sudo wondershaper <interface name> <down speed> <up speed>
sudo wondershaper eth0 512 512
sudo wondershaper clear <interface name>

Wondershaper seems to work on x10, so to limit to 512Kbps and 50Kbps would be:

sudo apt-get install trickle
sudo trickle -d 120 -u 32

Screen

screen ./unix-shell-script-to-be-executed parameters
screen -ls
screen -X -S [session # you want to kill] quit

Rclone

https://rclone.org/

cp rclone /usr/bin/
chown root:root /usr/bin/rclone
chmod 755 /usr/bin/rclone
mkdir -p /usr/local/share/man/man1
cp rclone.1 /usr/local/share/man/man1/
mandb 

An example for filtering: rclone sync path0 path1 -vv –filter-from filter_file.txt

- .git/
- .gitignore
- tmp/**
- .svn/
- dist/*.tar
- dist/*.zip
- .idea/
- __pycache__/
- **.pyc
+ **/migrations/__init__.py
- **/migrations/**
+ **/static/**
- static/**
+ *

entr - Run a command when a file changes

$ ls | entr sass main.scss > ../main.css | echo "compile"

:!: I do not know why, but sass main.scss > ../main.css ; echo “compile” does not work.

MiniUPnP

Este paquete te permite llamar a los comandos UPnP de tu router y abrir puertos desde la máquina local:

upnpc -a <ip> <puerto> <puerto_router> <protocolo(TCP|UDP)>
upnpc -a 192.168.1.130 8000 8000 UPD

nmap ─ Para comprobar puertos abiertos

nmap -Pn -p 51414 95.169.230.182

Comprueba el puerto 51414 de 95.169.230.182.

Hay la posibilidad de lanzarlo via web desde: http://nmap.online-domain-tools.com/

Configure a DNS server

To install it add the bind9 package. All its configuration for the names is placed on the /etc/bind path.

You need to change the next file /etc/default/bind9 to accept IP v4:

# run resolvconf?
RESOLVCONF=no
# startup options for the server
OPTIONS="-4 -u bind"

Add those IP's allowed to query DNS into the main config:

allow-query { localhost;192.168.1.0/24; };

:!: Examples will configure test.test, wiki.test.test…

After this, if we wanted to add an url name we should create a zone (into the config for zones):

zone "test.test" { 
     type master; 
     file "/etc/bind/db.test"; 
     allow-update { none; }; 
     allow-query {any; };
}; 

And in the file /etc/bind/db.test:

$TTL	86400
@	IN	SOA	dns.test. root.test.test. (
			     3		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@ IN NS dns.test.
wiki IN A 192.168.1.250
auth IN A 192.168.1.251

After this we can restart the service bind9.

Before restarting it we can execute some checks:

  • named-checkconf
  • named-checkzone test.test db.test

More doc:

wiki2/linux_tools.1585239351.txt.gz · Última modificación: 2020/05/09 09:24 (editor externo)