Benvinguts.
Aquí trobareu algunes eines útils per fer projectes informàtics, d'electrònica i alguna cosa mes. Espero que trobeu alguna cosa del vostre interès.
BitAciD
Lost Pirates
lunes, 14 de mayo de 2018
Mandar correo desde Bash con swaks.
Contingut:
Enviament de un correu desde un arxiu .SH.
Realtzació:
mandarmail.sh "Asumpte del correu" "correu@desti.com" "missatge"
touch mandarmail.sh
nano mandarmail.sh
-> #!/bin/bash
->
-> SUBJECT=$1
-> RECEIVER=$2
-> TEXT=$3
->
-> SERVER_PORT="el_servidor_smtp:587"
-> SENDER="el_email_emisor@el_domini"
-> USER="el_teu_email@el_teu_domini.com"
-> PASSWORD="la_teva_contrasenya"
->
swaks --to $RECEIVER --from $SENDER --server $SERVER_PORT --auth LOGIN --auth-user $USER --auth-password $PASSWORD -tls --data "Date: %DATE%\nTo: %TO_ADDRESS%\nFrom: %FROM_ADDRESS%\nSubject: $SUBJECT %DATE%\nX-Mailer: swaks v$p_versionjetmore.org/john/code/swaks/\n%NEW_HEADERS%\n $TEXT \n"
chmod +x mandarmail.sh
./mandarmail.sh "Prova de script mandarmail.sh" "tu-email@algo.com" "Text de prova del script mandarmail.sh"
Fonts:
Luis_Armando_Medina
Instalació d'un servidor LAMP (Linux+Apache+Mysql+PHP), a Linux Ubuntu Server.
Contingut:
Instal·lació de un servidor Apache amb PHP7.2, MySQL y PHPMyAdmin.
Realtzació:
Abans de començar haureu d'haver instal·lat l'Ubuntu Server en una màquina virtual de Vbox. El procés us portarà uns 30 minuts si el seguiu pas a pas.
Sudo su
apt-get update
apt-get install apache2
→ Y
ufw status
ufw enable
ufw app list
ufw app info “Apache Full”
ufw allow in “Apache Full”
ifconfig
apt-get install mysql-server
→ Y
mysql_secure_installation
→ Setup validate password – N
→ 12345Y
→ Remove anonymous users – Y
→ Disable Root Login Remotely – Y
→ Remove test database – Y
→ Reload Privilege Tables – Y
mysql -u root -p
→ 12345
→ show databases
→ ctrl + c
→ exit
apt-get install php libapache2-mod-php php-mysql -y
service apache2 restart
sudo chown -R $USER:root /var/www
nano /var/www/html/info.php
→ <?php
→ phpinfo();
→ ?>
apt-get install phpmyadmin
→ Y
→ 12345
→ Y
→ apache2
→ Yes
→ 12345
nano /etc/apache2/apache2.conf
→ Include /etc/phpmyadmin/apache.conf
service apache2 restart
www → localhost/phpmyadmin/index.php
→ user:phpmyadmin
→ pass:12345
mysql -u root -p
→ 12345
→ use mysql
→ update user set authentication_string=PASSWORD(‘12345’) where user = ‘root’;
→ select user, plugin from user;
→ update user set plugin=’mysql_native_password’ where user = ‘root’;
→ flush privileges;
→ select user, plugin from user;
→ exit
Fonts:
CellSnake007
Instal·lació de un servidor Apache amb PHP7.2, MySQL y PHPMyAdmin.
Realtzació:
Abans de començar haureu d'haver instal·lat l'Ubuntu Server en una màquina virtual de Vbox. El procés us portarà uns 30 minuts si el seguiu pas a pas.
Sudo su
apt-get update
apt-get install apache2
→ Y
ufw status
ufw enable
ufw app list
ufw app info “Apache Full”
ufw allow in “Apache Full”
ifconfig
apt-get install mysql-server
→ Y
mysql_secure_installation
→ Setup validate password – N
→ 12345Y
→ Remove anonymous users – Y
→ Disable Root Login Remotely – Y
→ Remove test database – Y
→ Reload Privilege Tables – Y
mysql -u root -p
→ 12345
→ show databases
→ ctrl + c
→ exit
apt-get install php libapache2-mod-php php-mysql -y
service apache2 restart
sudo chown -R $USER:root /var/www
nano /var/www/html/info.php
→ <?php
→ phpinfo();
→ ?>
apt-get install phpmyadmin
→ Y
→ 12345
→ Y
→ apache2
→ Yes
→ 12345
nano /etc/apache2/apache2.conf
→ Include /etc/phpmyadmin/apache.conf
service apache2 restart
www → localhost/phpmyadmin/index.php
→ user:phpmyadmin
→ pass:12345
mysql -u root -p
→ 12345
→ use mysql
→ update user set authentication_string=PASSWORD(‘12345’) where user = ‘root’;
→ select user, plugin from user;
→ update user set plugin=’mysql_native_password’ where user = ‘root’;
→ flush privileges;
→ select user, plugin from user;
→ exit
Fonts:
CellSnake007
Enviar un correu desde la shell.
Contingut:
Feia temps que
buscava un scrip per poder fer enviaments de mails desde la shell,
per tal de exportar dades desde el S.O.
Realtzació:
sudo su
apt install
mailutils
→ Y
→ No Configuration
/ Internet Site / Internet with smarthost / Satellite System / Local
Only
nano /etc/mail.rc
→
set smtp-use-startls
→
set ssl-verify=ignore
→ set
smtp-auth=login
→
set smtp=smtp://smtp.tu_proveedor_de_correo.com:587
→ set
from=”tu_mail@tu_proveedor_de_correo.com”
→
set smtp-auth-password=tu_contraseña
→
set ssl-verify=ignore
mail
-s “asunto” mail@proveedor.com
Fonts:
Suscribirse a:
Entradas (Atom)