How to send parameters to daemon from client to server? - daemon

I am trying to create a kiosk client that stores its configuration on the server. Client is based on Raspberry Pi OS Lite (it runs on RevPi). Server is an Debian system. What I had in mind is following process:
boot kiosk (first boot with customized Raspberry Pi OS Lite)
kiosk will ask for server IP (maunual input)
kiosk will create ssh key at this moment
kiosk will ask server at given IP for registration (passing its MAC and generated key?)
? Server will receive request from kiosk with MAC and generated key.
server will create config file for that MAC address (copy from template) and do some more adminitrative tasks.
kiosk will reboot
after boot kiosk will check if his local config file is same as version on the server
if not: kiosk will download it AND reboot.
if yes: it will precess it and run... for ever till end of electricity.
I am done with cleaning up kiosk, I have installed what I need, all is configured as I wanted.
Now I am looking for an elegant solution to my only problem, atm:
How to send kiosks MAC address to server without any login ceremony. I thought of using a daemon on server side that listens at port for and messages with MAC address and ssh-keys but it have no idea how to
I used info from how to pass arguments to Linux daemon/service and my daemon is based on http://www.netzmafia.de/skripten/unix/linux-daemon-howto.html

Ok, after looking around I found spring-server. This is much more then I anticipated for! But all additional functionality offers more application possibilities! Thank You Bartobri.
With implementation of this answer I am good to go.

Related

Raspberry-PI system smart control through android apps

How can smartly/remotely control a Raspberry-PI system through android apps. I have found an android app named "Raspberry Control" (source). I have followed all the steps as given in the above URL.
I have installed the android app in my phone (samsung galaxy note, recent release in 2014) followed tried to make a connection of android app with my RPI system (I have followed the steps mentioned in this Youtube video). But as shown in video, when the app started from phone, it needs a SSH connection (showed at 0.25 in the video). Unfortunately, I have faced an error like "check installation on RPi".
Thanks in advance for your precious time. Do I need to install any software on raspberry pi or am I missing any steps?
Secure Shell (SSH) is a network protocol that allows data to be
exchanged over a secure channel between two computers. Encryption
provides confidentiality and integrity of data. SSH uses public-key
cryptography to authenticate the remote computer and allow the remote
computer to authenticate the user, if necessary. SSH is typically used
to log into a remote machine and execute commands, but it also
supports tunneling, forwarding arbitrary TCP ports and X11
connections; file transfer can be accomplished using the associated
SFTP or SCP protocols. An SSH server, by default, listens on the
standard TCP port 22. An SSH client program is typically used for
establishing connections to an sshd daemon accepting remote
connections. Both are commonly present on most modern operating
systems, including Mac OS X, GNU/Linux, Solaris and OpenVMS.
Proprietary, freeware and open source versions of various levels of
complexity and completeness exist.
-Wiki
You found a complete guide/dossier in this link. The install instruction can change depending on the system.
You can control rpi trought ssh simply from windows, linux, android, iOs using a ssh telnet/client. Your app simply after press a button send to rpi the correct ssh comand.
If you have debian(or raspbian) this guide is for you:https://wiki.debian.org/en/SSH.
So, you must enable the ssh service on your rpi. Username and password are user/pass of your rpi account.

how to access client desktop and to control mouse using tcp/ip protocol from server machine

I'm working on project to develop an software using the TCP/IP protocol. The basic function of the software is to access the client activity running on client machine from server machine, for example information about current running applications.
Also, I want to access desktop screen and mouse from client machine to server machine using TCP/IP protocol. What are the basic steps that I can follow to access the desktop and could handle client mouse from server machine using TCP/IP.
It sounds like you want to build a VNC or RDP -like program. There have been an explosion of these services/programs in the time since you asked the question, though I don't know how many might be open source. I would start by investigating an Open Source VNC client and then see about adding an encrypted tunnel to keep the connection secure.
UltraVNC and TightVNC are popular Open Source VNC clients.

Client times out when launching XenApp6 app from internet

Using XenApp6 on Windows 2008 R2 I have the windows Calculator as a test app. Apps are set to run on the server, and are not streamed to the client. When running Calculator from inside the network it runs as expected.
However, when accessing the app from an external web browser or Citrix Receiver, the client always times out and the Calculator app is not launched. I see incoming traffic on port 1494 (which is open) but there is no response from XenApp.
For both internal and external, I log in as Administrator and can see the citrix management console showing my test Calculator app.
Any ideas why it's timing out and not launching from the internet?
Thanks.
Chris
If the Citrix server's internal IP is being NATted to an external IP you may need to set an alternate address using altaddr on the Citrix server. Try this: Download the ICA file that the Citrix server passes when you launch a published app from a web browser, open it in a text editor, and see what FQDN or IP it is trying to connect to.

iOS communicating with OS X

I'm looking for a pointer in the right direction to get started with writing an iPhone app that sends commands to OS X, for example telling OS X to sleep. I can't seem to find the relevant part of the documentation?
AFAIK, most apps have been performing this kind of communication with a client/server design, where a "server" app runs on the host OS X machine, and a "client" app on the iOS device connecting using some sort of protocol (HTTP? Bonjour?).
You won't find this in the documentation because this is a niche design pattern that few apps need (especially since documents can now be shared more easily with the new version of iOS and iTunes).
iOS doesn't support ObjC remote objects, which would be the easiest way to communicate between two OS X machines.
An alternative to the HTTP client/server approach could be making your iPhone app connect in via a remote Unix shell to the OS X machine (via ssh) and then issuing Unix or AppleScript commands to perform your system actions.
You could also set up a socket connection. I have done a app for Android, that does exactly the same for Windows computers. The app is in use in a computer store :)
For Mac, you have to use sudo command, so you need the user to type in password, on first use.
Then the server application on the Mac can send "sudo shutdown -h now" to the terminal when the server application gets a predefined byte stream on the socket input.

Remote access to apache2 server

I'm trying to test my iPhone application on the device.
I have a mac computer which stores my development environment.
Right now I can only access PHP files using the http://localhost/PHPFileLocation
which does not work when I try to test my app on real device.
How do I configure apache2 to be accessible from outside?
Is it possible to configure it to a specific IP address?
I want to reach some php scripts located on my development machine running apache2 from my iPhone device.
Thanks
If your computer has a WiFi card then you should be able to attach the iPhone remotely to a ad-hoc Wifi network created on your dev machine.
I'm assuming your Mac is behind a router. You should be able to configure your router to port forward connections to your WAN facing IP address to port 80 (the HTTP port) on your Mac - see http://portforward.com/ for some help.
You may also need to turn the firewall off on your Mac.
Once this is set up correctly you can hit http://yourexternalIP/PHPFileLocation in your iPhone app and this will be directed by your router to the Apache2 server on your Mac. The external IP is normally found on your router's admin page somewhere.