-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
357 changed files
with
11,154 additions
and
1,875 deletions.
There are no files selected for viewing
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import socket\n", | ||
"\n", | ||
"nombre_equipo = '192.168.0.14' #socket.gethostname()\n", | ||
"direccion_equipo = socket.gethostbyname('Martín-PC')\n", | ||
"print(\"el nombre del equipo es: %s\" % nombre_equipo)\n", | ||
"print(\"La IP es: %s\" % direccion_equipo)\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"'192.168.1.143'" | ||
] | ||
}, | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"import socket\n", | ||
"socket.gethostbyname('radaracconeer')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"'Martín-PC'" | ||
] | ||
}, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"socket.gethostname()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"b'acc_board_init: Board data from EEPROM: HW: XC112, HW rev: R2B, Production test version: v1.104, Test log id: 21265204, Date: 2018-08-10, Test status: PASS.\\nbind(): (98) Address already in use'\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import paramiko\n", | ||
"# Inicia un cliente SSH\n", | ||
"ssh_client = paramiko.SSHClient()\n", | ||
"# Establecer política por defecto para localizar la llave del host localmente\n", | ||
"ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n", | ||
"# Conectarse\n", | ||
"ssh_client.connect('192.168.1.143', 22, 'pi', 'raspberry')\n", | ||
"# Ejecutar un comando de forma remota capturando entrada, salida y error estándar\n", | ||
"\n", | ||
"entrada, salida, error = ssh_client.exec_command('Downloads/rpi_xc112/utils/acc_streaming_server_rpi_xc112_r2b_xr112_r2b_a111_r2c')\n", | ||
"\n", | ||
"# Mostrar la salida estándar en pantalla\n", | ||
"print(salida.read())\n", | ||
"# Cerrar la conexión\n", | ||
"#ssh_client.close()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"\n", | ||
"ssh_client.close()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.