Comparativa: PuTTY vs. ssh

Definició resumida:

Aspecteputty.exe (PuTTY)ssh (comanda)
EntornWindows (amb interfície gràfica)Linux, macOS, o Windows (amb WSL/PowerShell)
InterfícieGràfica (pots guardar sessions)Línia de comandes
Facilitat d’úsIntuïtiu per a usuaris no tècnicsRequereix coneixement de línia de comandes
Com s’usaObrint el programa i escrivint IP/usuari/portssh usuari@ip
Gestió de claus SSHPermet importar claus .ppk (PuTTYgen)Usa claus .pem o .ssh/id_rsa
Transferència de fitxersCal afegir eines (pscp, psftp)Es pot fer amb scp o rsync
Historial i scriptsNo pot guardar historial d’ordresPots usar scripts de shell

PuTTY (putty.exe) és una eina que permet establir connexions segures (SSH, Telnet, etc.) des de Windows a servidors remots per executar comandes, transferir fitxers o gestionar sistemes.

SSH

SSH és un protocol que permet accedir remotament a un ordinador o servidor de forma segura mitjançant línia d’ordres.

🔐 Què ofereix?

  • Xifratge → Les dades viatgen protegides (a diferència de Telnet).
  • Autenticació segura → Amb contrasenya o claus SSH.
  • Integritat → Detecta si algú ha modificat les dades en trànsit.
  • Control remot → Executar comandes, gestionar fitxers o processos.

Les funcions que es fan amb putty es poden realitzar també amb SSH?

ChatGPT ha dit:

Sí, totes les funcions que es poden fer amb PuTTY es poden fer amb SSH, i sovint de manera més flexible o automatitzable. De fet, PuTTY és només una eina que implementa el protocol SSH (entre d’altres), així que en el fons fan servir el mateix sistema de connexió.

Col·laborar PHP & Python (Separant totalment la responsabilitat

  • PHP fa la seva feina (interfície, configuració, etc.).
  • Python està sempre en segon pla, monitorant el porta-retalls i parlant.

Exemple de control via fitxer:

<?php
file_put_contents("config.txt", "start"); // O "stop"
?>

Python (modificat):

import pyperclip
import pyttsx3
import time
import os

engine = pyttsx3.init()
last_text = ""

while True:
    if os.path.exists("config.txt"):
        with open("config.txt") as f:
            state = f.read().strip()
        if state != "start":
            time.sleep(1)
            continue
    text = pyperclip.paste()
    if text != last_text and text.strip() != "":
        print("Nou text copiat:", text)
        engine.say(text)
        engine.runAndWait()
        last_text = text
    time.sleep(0.5)
  • 🛠️ Etapa 1: Crear el lector en Python
  • ✅ Script Python que detecta el text copiat.
  • ✅ Converteix el text en veu (TTS).
  • ✅ Opció per controlar l’activació (fitxer config.txt).
  • 🛠️ Etapa 2: Crear una interfície bàsica en PHP
  • ✅ Botons per activar o desactivar la lectura.
  • ✅ Escriure a config.txt segons l’acció.
  • 🛠️ Etapa 3: Integració
  • ✅ Gestionar l’estat des de la interfície.
  • ✅ Executar el script Python des de PHP si cal.
'Etapa 1: lector en Python

import pyperclip
import pyttsx3
import time
import os

engine = pyttsx3.init()
last_text = ""

def llegir_text(text):
    engine.say(text)
    engine.runAndWait()

while True:
    # Llegim l'estat del fitxer de configuració
    if os.path.exists("config.txt"):
        with open("config.txt") as f:
            estat = f.read().strip()
        if estat != "start":
            time.sleep(1)
            continue
    else:
        time.sleep(1)
        continue

    # Llegim el text del porta-retalls
    text = pyperclip.paste()
    if text != last_text and text.strip() != "":
        print("Llegint:", text)
        llegir_text(text)
        last_text = text
    time.sleep(0.5)

NextUp Talker (TextAloud)






Getting Started with TalkForMe


Getting
Started with NextUp Talker

 

Overview

 

NextUp Talker is a Text-To-Speech application specifically
designed for those that have lost the ability to speak.? Like TextAloud and other NextUp speech
applications, NextUp Talker synthesizes speech from text.? The difference is that while these other
applications synthesize speech from various kinds of text content, the sole
purpose of NextUp Talker is to carry on conversation.? NextUp Talker will synthesize spoken audio
from the text you type, allowing you to use your computer as a tool for
speaking with others.

 

Options available in NextUp Talker fall into two general
categories

1.     
Control over when the
text you type is spoken

2.     
Reducing the amount of
typing required to carry on conversation.

 

 

The NextUp
Talker Main Window

 

Rounded Rectangular Callout: This is the Predefined Phrases Area.  Click in this area to create a hierarchy of commonly used phrases.Rounded Rectangular Callout: This is the Log Area.  This area keeps a log of your most recent speech requests.Rounded Rectangular Callout: This is the Input Area.  Type the text you want to speak here.  The "Speak Text" dropdown list determines when the words are spoken.

 

 

 

Speaking the
first time

When you first install NextUp Talker, the first thing to do
is get it to speak a few words just to make sure installation went well and
everything is working.

Type a few words in the ?Input Area? (see the illustration
above for the location of the input area), and press the ?Speak Input? button
on the toolbar.? Any problems at this
point are probably installation related; contact us at support@talkforme.com so we can take a
look.

 

Four Ways to
Speak Text

Use the ?Speak Text? dropdown list to control when text in
the input area is spoken.? Options are
available on the NextUp Talker Options panel to control whether or not the
input area is automatically cleared as speaking begins and/or ends.

 

?        
On Demand
? Enter a block of text into the input area, then press the ?Speak Input?
button on the toolbar.

 

?        
By Word
? As you type text into the input area, NextUp Talker will automatically speak
each word you type.

 

?        
By
Sentence
? As you type text into the input area, the current sentence will
be spoken each time you enter ?end of sentence? punctuation (period, question
mark, exclamation point).

 

?        
By
Carriage Return / Line Feed
? This option allows you to type multiple
sentences into the input area, and initiate speaking by pressing the Enter key.

 

 

Pre-Defined
Phrases

The panel on the left side of the GUI is for defining
phrases you may use often.? Right click
in this area to define folders and phrases within the folders.? Folders may contain other folders, and you
can define whatever hierarchy of phrases that is convenient for you.

 

When defining phrases, you can use the ?%? character to
define substitutable parameters.? If you
define a phrase like ?Hi %name%?, you will be prompted for ?%name% anytime you
use the phrase.? A phrase can have any
number of these parameters.

 

Phrase definition allows you to assign keyboard shortcuts to
phrases you use frequently.

 

The phrase hierarchy is also automatically maintained under
the NextUp Talker Insert menu, along with the most recently used phrases.

 

 

Inserting
Sounds

NextUp Talker can also mix in actual sound files into
speech.  You can insert a link to a sound file using the insert
menu.  For some users who have warning before losing their voice, such as is the case often with surgery, you can use your computer to
record various sound files saying things like "I love you", or
answering the phone.  These recordings can then be intermixed with text to
speech.  Another neat use is inserting sound effects.  There are a
huge number of free sound files on the internet.  A common use for these
might be to include some funny sound effects with your speech.  This is
especially helpful when speaking with children.  The funny sounds often
help children become more comfortable when talking with someone who has to use
a computer.

 

Keyboard
Shortcuts

Most of the features available in NextUp Talker are
available either on the main menu or the Predefined Phrases popup menu.?? If you look under Options (on the main
menu), you?ll see a ?Shortcut Setup? dialog which can be used for assigning
keyboard shortcuts ??The dialog allows
you to assign keyboard shortcuts for commonly used NextUp Talker actions.

 

When creating predefined phrases, you have the option of assigning
a keyboard shortcut to the phrase as you create it.? You may also use Shortcut Setup to create /
modify shortcuts for your phrases after they?ve been created.

 

 

Need Help ?

If you run into any problems at all please contact support@talkforme.com, we?ll answer you
right away.

 

 

 

 

Script PowerShell per guardar la llista de veus en un fitxer .txt

Add-Type -AssemblyName System.Speech
$synth = New-Object System.Speech.Synthesis.SpeechSynthesizer

# Ruta on es desarà el fitxer (escriptori de l'usuari actual)
$outputPath = [System.IO.Path]::Combine([Environment]::GetFolderPath("Desktop"), "Veus_Instal·lades.txt")

# Obtenir les veus i formatejar-les
$voicesInfo = $synth.GetInstalledVoices() | ForEach-Object {
    $voice = $_.VoiceInfo
    "Nom: $($voice.Name)`nIdioma: $($voice.Culture)`nGènere: $($voice.Gender)`nEdat: $($voice.Age)`nDescripció: $($voice.Description)`n---"
}

# Escriure-ho al fitxer
$voicesInfo | Out-File -FilePath $outputPath -Encoding UTF8

# Mostrar confirmació
Write-Output "Llista de veus desada a: $outputPath"

Nom: Microsoft Zira Desktop
Idioma: en-US
Gènere: Female
Edat: Adult

Descripció: Microsoft Zira Desktop – English (United States)

Nom: Microsoft Hazel Desktop
Idioma: en-GB
Gènere: Female
Edat: Adult

Descripció: Microsoft Hazel Desktop – English (Great Britain)

Nom: Microsoft Helena Desktop
Idioma: es-ES
Gènere: Female
Edat: Adult

Descripció: Microsoft Helena Desktop – Spanish (Spain)

Nom: Microsoft Hortense Desktop
Idioma: fr-FR
Gènere: Female
Edat: Adult

Descripció: Microsoft Hortense Desktop – French

Nom: Vocalizer Expressive Jordi Harpo 22kHz
Idioma: ca-ES
Gènere: Male
Edat: Adult

Descripció: Vocalizer Expressive Jordi Harpo 22kHz

un script PowerShell per a executar a Windows 11 per instal·lar una veu en anglès de usa

Instal·la el paquet bàsic d’anglès (Estats Units)

Add-WindowsCapability -Online -Name “Language.Basic~~~en-US~0.0.1.0”

Instal·la la capacitat de veu (sintesi de veu) per anglès US

Add-WindowsCapability -Online -Name “Speech.en-US~0.0.1.0”

Estableix l’anglès US com a llengua d’usuari

Set-WinUserLanguageList -LanguageList en-US -Force

Mostra les llengües configurades per verificar

Get-WinUserLanguageList

Bucle while true (PHP)

En PHP, el bucle while s’utilitza per executar un bloc de codi mentre una condició sigui certa. La sintaxi bàsica és:

while (condició) {
    // Codi a executar
}

Si el que vols és un bucle infinit, pots utilitzar while (true), que s’executarà indefinidament fins que es trobi una instrucció break o es tanqui el programa:

while (true) {
    echo "Aquest bucle no s'atura mai!";
}

Pel que fa a la sintaxi que has escrit (while(1)- | codi | buclw-- al while), sembla que hi ha errors de format. Si vols un bucle que executi un bloc de codi repetidament, pots estructurar-lo així:

while (1) {
    // Codi a executar
}

Si necessites més informació, pots consultar la documentació oficial de PHP o una guia pràctica sobre el bucle while en PHP.

Crear un subdomini al Synology

En primer lloc, hem d’entrar al proveïdor de dominis en el meu cas Entorno digital i crear el subdomini. No entrarà en funciona fins passat un temps de propagació per la xarxa.(pot ser més de 24 hores).

Ara obrim el Synology i entrem a web station i premem crear


Agafo el servei ccc-urquizu-info o en creo un específic per al subdomini, on es pot especificar la versió de PHP a utilitzar i altres configuracions.polidic, de moment té problemes amb la versió 8.0

Aquesta part és la més important observar que aquí es defineix on ha d’apuntar el subdomin: ccc.urquizu.info. Ara només hem de prémer crear

Ara ja està creat. Però encara hem de definir a quina carpeta de www apunta que pot ser diferent de urquizu. En aquest cas serà 0capsa_dic

Hem de crear el servei web-> crear

Configurar una pàgina web en un servidor Synology DSM 7.2 sense un domini propi

Per configurar una pàgina web en un servidor Synology DSM 7.2 sense un domini propi, sinó només amb una IP (interna o externa), cal fer alguns passos específics. Aquí tens una guia clara per fer-ho funcionar utilitzant una IP i ruta local com 192.168.1.140/polidic/index.php:

✅ PAS 1: Verifica que el servidor web estigui actiu

  1. Entra a DSM.
  2. Ves a “Centre de paquets” > activa “Servidor Web”.
  3. Assegura’t que Apache o Nginx està actiu (segons el que utilitzis).
  4. El directori per defecte és /web. Si has creat un portal anomenat polidic, la ruta hauria de ser /web/polidic.

✅ PAS 2: Crea el lloc web (portal definit per usuari)

  1. Ves a “Pàgina d’inici del lloc web” (Web Station).
  2. A l’apartat de “Portal definit per usuari”, crea un nou lloc:
    • Nom del servei: polidic
    • Nom de host: aquí és on ve el problema. Has de posar-hi només:
      • * si vols que funcioni amb qualsevol IP o nom
      • O http192.168.1.140 si és per accedir des de la xarxa local
    • Port: 80 (HTTP) o 443 (HTTPS), segons el cas
    • Ruta virtual: /polidic (si accedeixes amb /polidic a l’URL)

🔴 No pots posar una IP seguida d’un camí com 192.168.1.140/polidic/index.php com a “nom de host”. Això no és vàlid: només s’accepten noms com exemple.com o http192.168.1.140.

✅ PAS 3: Accés a través d’IP i ruta

Si el directori web és /web/polidic, i has configurat correctament el portal, pots accedir a la pàgina amb:

arduinoCopiaModificahttp://192.168.1.140/polidic/index.php

Només has d’assegurar-te que:

  • El fitxer index.php existeix dins /web/polidic
  • El servidor web està actiu
  • No tens errors de permisos (fes que el fitxer sigui llegible per l’usuari del servidor web, com http o www)

✅ PAS 4: Redirecció per IP externa (opcional)

Si vols accedir-hi des de fora de la xarxa:

  • Obre el port 80 al teu router i redirecciona’l cap a 192.168.1.140
  • Accedeix amb l’IP pública: http://81.36.0.116/polidic/index.php

⚠️ Això només funcionarà si:

  • El port 80 no està bloquejat pel teu ISP
  • El Synology accepta connexions externes (configurat correctament al tallafocs)
  • No tens cap problema de NAT o doble NAT

En resum:

  • Nom del host ha de ser *, localhost o la IP (sense /polidic)
  • El camí /polidic/index.php va a l’URL, no al nom del host
  • Revisa que el directori i fitxers existeixin dins /web