Run a Linux command every X seconds forever using Watch command | OSTechNix

open source tools

Have you ever wanted to run a command every few seconds automatically? Of course you can do this using a shell script or cron jobs. Alternatively, you can repeat a Linux command at a particular interval without having to manually run it. Here comes watch command in handy. Watch command can be used to execute a program every X seconds forever and it displays the outputs in the console. By default, the program is run every 2 seconds, Or you can define the time interval of your choice. It will keep running and displaying the respective results until you terminate the program by pressing CTRL+C or kill the process or force your system to reboot. Syntax: watch command Here is the set of five examples that explains where can you use watch command. Example 1: Let us display the output of the ‘uptime’ command: watch uptime Sample output: Every 2.0s: uptime                                      Wed Feb  3 12:56:46 2016 12:56:46 up  2:14,  2 users,  load average: 0.80, 0.87, 0.63 Here, Every

Fonte: Run a Linux command every X seconds forever using Watch command | OSTechNix

How to simulate yes/No in Linux scripts/commands – The Linux Juggernaut

In some situations when executing a command or a Linux shell script we may require some manual intervention. The yes command is simple built-in command which will help you remove this manual intervention stuff in your scripts. The yes command is a cousin of echo command both print what we given. Only difference is echo […]

Fonte: How to simulate yes/No in Linux scripts/commands – The Linux Juggernaut

driver wifi realtek no debian 8

Realtek RTL8188CE, RTL8188CUS, RTL8188DE, RTL8188EE, RTL8188ETV, RTL8188EU, RTL8188SU, RTL8191SE, RTL8191SU, RTL8192CE, RTL8192CU, RTL8192DE, RTL8192E, RTL8192EE, RTL8192SE, RTL8192SU, RTL8192U, RTL8723AE, RTL8723AU, RTL8723BE, RTL8812AE, RTL8821AE devices

Add a “non-free” component to /etc/apt/sources.list, for example:

# Debian 8 “Jessie”
deb http://http.debian.net/debian/ jessie main contrib non-free

Update the list of available packages and install the firmware-realtek package:

# apt-get update && apt-get install firmware-realtek

(faça reboot e o sistema carregará normalmente o driver correto)

testa:
dmesg |grep rtl

liga wifi:
wicd ou qualquer outro
ou… #ip link set wlan0 up

procura:
iwlist scan

configura:
https://wiki.debian.org/WiFi/HowToUse

Fonte: https://wiki.debian.org/rtl819x#rtl8192ce

Encriptar e Desencriptar usando openssl base64 e validação md5sum

Encriptar

#!/bin/bash
# crypten - a script to encrypt files using openssl
PASS=senha.txt
FNAME=$1
date >> $FNAME.log
md5sum $FNAME >> $FNAME.log

if (( $# == 0 )); then
echo "crypten [ ... ]"
echo " - crypten is a script to encrypt file using aes256"
exit
fi
for FNAME in "$@"; do
openssl enc -aes-256-cbc -a -salt -in "$FNAME" -out "$FNAME.encriptado" -pass file:"$PASS"
done
date >> $FNAME.log

Desencriptar

#!/bin/bash
# crypten - a script to encrypt files using openssl
PASS=senha.txt
FNAME=$1
date >> $FNAME.log

if (( $# == 0 )); then
echo "crypten [ ... ]"
echo " - crypten is a script to encrypt file using aes256"
exit
fi
for FNAME in "$@"; do
openssl enc -aes-256-cbc -d -a -in "$FNAME" -out "$FNAME.desencriptado" -pass file:"$PASS"
done
date >> $FNAME.log
md5sum $FNAME.desencriptado >> $FNAME.log

Criar Senha

openssl rand -base64 4096 > senha.txt

======================================================
personalização do script crypten
http://linuxtidbits.wordpress.com/2009/01/12/encryptingdecrypting-a-file-easily-with-a-couple-bash-scripts/
======================================================

link sugerido:
https://www.madboa.com/geek/openssl/