Use ssh to access couchdb on remote server from mobile device - mobile

I have an instance of couchdb running on my local port 5984.
My ultimate goal is to run couchdb on a server within a closed network, and be able to send requests to this server from mobile devices within the network.
This post seems to provide a solution, provided I can open a terminal and make an ssh tunnel:
ssh -f -L localhost:15984:127.0.0.1:5984 user#remote_host -N
But I obviously won't be able to access the command line on mobile devices to make the tunnel. How does one go about accessing applications from mobile devices within closed networks? (I can't just deploy it to some web server as I don't have access to the internet)

You CAN run command line on Android, for example with this terminal emulator you can copy a statically linked ssh binary to /data/data/jackpal.androidterm/app_HOME then cd $HOME and ./ssh to execute it
and there are graphical ssh clients, some of which might have the functionality
also termux should have an ssh client available, you probably need to "apt install ssh" when in the app to get it.

You can create a SSH tunnel if the client supports port forwarding. Those I know are :
The paid version of JuiceSSH : Setting up a New Port Forward Profile
Connectbot : Long press in the hosts list and choose "Edit port forwards". The parameters are straightforwardly adapted from the -L option.

You can write a client via sudo apt-cache search libssh; it supports tunneling AKA forwarding.
#include <libssh/libssh.h>
http://api.libssh.org/master/libssh_tutor_forwarding.html

Related

Substrate Blockchain - Create First Blockchain FrontEnd doesn´t open

I am on the first tutorial of Substrate, running substrate on Windows Subsystem for Linux. The substrate network is running correctly, but when I open the frontend on the browser i get this erros:
Because you run on the subsystem I would recommend you to check the network configuration for that. here is my be help :
Sharing Network Resources WSL
I have encountered and resolved this problem. WSL share the same ip with host, you known. you should make sure weather your wsl's ip is the same one that your frontend connect to. Generally, it is same one. I just closed the wls terminal console window and reopen it, it can be works! I don't know why, Perhaps, the bugs of wsl lead to it. Good Luck, guy!
From what I've experienced, getting Windows and WSL communicating through localhost is tricky and prone to falling over. I resolved the issue by making use of WSL's internal network IP address.
When you run the front-end server (yarn start) it shows you the internal network IP you can use to open the frontend. Or you can run
ip addr | grep -E "\b*inet.*global" | sed -E s/inet(.*)\/.*/\1/
(which I got from https://github.com/microsoft/WSL/issues/4636)
Next, you have to run the node-template with the --ws-external flag (in addition to the --dev and --tmp flags), so that it binds to 0.0.0.0 and allows you to connect to from windows.
Finally, you have to edit the src/config/development.json so that the PROVIDER_SOCKER variable uses the internal IP address and not 127.0.0.1.

Use Psexec to get Connected USB Device names

I'm wondering if it's possible to use Psexec to return a list of connected USB Devices on remote windows 8 computers. Ideal output would be something like this:
USB1: Keyboard
USB2: Barcode Scanner
Obviously the device name would be displayed instead of 'keyboard' ect, is there an easy way to do this? I'm working within a secure environment with hundreds of remote machines, so unable to install any new Microsoft Tools such as Devcon myself.
Any suggestions would be appreciated.

Raspberry pi 3 Bluetooth

My Raspberry Pi 3 can connect briefly to my Android mobile, but once I accept the connection on the Raspberry Pi, I get this error:
GDBus.Error:org.bluez.Error.Failed: No such file or directory. Try to connect manually.
Please help me on this.
You can fix that from Bluetooth control. Type $bluetoothctl as root then you will end up with Bluetooth shall. There you should type "power on" command. After that you can use "scan on" command to check connection.
to continue from Dinusha's answer, after you scan and find your device's ID (you should also be able to see it's name in parentheses) you'll need to pair with the device by doing
pair <device ID>
then connect with the device by doing
connect <device ID>
You'll be able to see status of the connection
There are cases where I use a separate bluetooth dongle for connections I don't want dropped
Raspbian Jessie has some issues as far as I know with the Bluetooth module. I'd recommend using bullseye or buster. Also, there are a couple issues regarding the newest kernel. Run the following command to see if your phone which you are willing to connect is listed:
sudo bluetoothctl devices
If your mobile device is still listed here and not paired on the mobile side, there is your problem. Remove the device using the following command in RPI:
sudo bluetoothctl remove <mac-adress-of-device>

Telnet command for embeded system C

I have an embedded system that is programed in C. I need to do the equivalent to the DOS command Telnet. The idea is to test if the remote host is up and running.
I would like to have some orientation here like:
Open source project that I can use as a guide line (C language)
Some documentation on what the Telnet command does (so I can
implement my own)
Thanks
Update: Thank you for your valuable comments
My system connects to a host via GPRS/Ethernet/dial up/Wifi (one of them). As a developer I check if the host is ok by using my windows laptop (with a Dial up modem, GPRS modem or whatever is needed) and running Telnet like this:
telnet 192.168.0.1 8000
(non real values)
If the host is ok I got the clean screen, otherwise I got an error. That's what I need to do in code, to be able to determine if the host is up and running by using a sort of DOS telnet client command in C.
This is done once, just to check communications, after this test is cleared the real info should be sent.

Howto connect to localhost:8888 from another device on the same network?

I'm trying to test my application that I develop using the Google AppEngine.
When I want to test from the computer I use to develop the application ("localhost:8888" in my browser) everything works perfectly.
But when I want to test it from my android device's browser, using "192.168.5.194:8888" (the local IP adrress of the computer), it gives me nothing (it just tries to connect to the site unsuccesfully).
So, my computer and my browser are on the same LAN. The comp is running a win7. I use eclipse (Kepler) to develop.
Your help is appreciated.
In the documentation under command line arguments there is a parameter called host.
You can start you local environment like
./dev_appserver --host=0.0.0.0
You have to replace 0 with your actual network ip address, something like 192.168.0.42 which can be found with ifconfig command in a linux all mac terminal, ipconfig for windows.
If you visit from your favorite browser your actual ip address for example 192.168.0.42:8080 at 8080 port if you didn't set one manually you will be able to access your local machine from any browser on the network.
The above instructions apply only in a non graphical environment if you are using the application for starting your server I haven't checked it out, and I can't right now cause I am running on Linux, but I am quite confident that you can define a host somewhere in the parameters.
Add the following command line flag to the App Engine launcher: --host=0.0.0.0

Resources