NSServerNotificationCenter and a Linux server - cocoa

In one of my Mac apps, I have the need of having PUSH notifications. Instead of using some custom solution, I thought I might as well give NSServerNotificationCenter a try. Apple's docs mention a notificationconf command, which my Ubuntu server does not have. The docs also mention that NSServerNotificationCenter uses XMPP.
My question is basically this - I have ejabberd running on my server, could I just connect to that from my code? How would I post a notification to a user using this? I also need a way to let my NSServerNotificationCenter know my user's credentials - I presume I would do this using an NSTask and run notificationconf setpass hostname username.
Does anyone know how I should go about setting this up? I also need to find a way to create a new ejabberd user when a user is registered through PHP, but that should be no problem.
Then again, if this isn't possible too easily, is there another way of doing push notifications on the Mac with an Ubuntu server running the server part?
Thanks for any responses, this topic is seriously confusing me.

My experience with this class suggests that it is really only meant to communicate with an OS X Server (i.e. Mac running the server package/version of the OS) and only meant to do push notifications for Mail and iCal. Very limited!
But XMPP is definitely the way to do push notifications here! I suggest you check out the XMPPframework project from the Deusty guys. It's a Cocoa implementation of XMPP and should work nicely with ejabberd (though I use OpenFire).
There are also a handful of PHP-XMPP frameworks. Check out xmpphp on Google Code.
Lot's more information for other frameworks and languages here.

Related

update client code in electron

So I have multiple clients using an app built in electron. The entire application is actually a number of electron windows that talk to each other. When I have an update for the client side code (html/js/css) I have to have them shutdown, and run a utility that downloads from our internal server to update their app. I would like to know if there is a way I can either push new code to the clients (maybe through a socket) to overwrite the old code, or even maybe poll our 'code server' for updates, and then have it automatically update/overwrite existing code.
Is this possible? Is there functionality built in to electron that allows this?
And, if possible, how can it be accomplished? i.e. is there a library I can look at that will help me?? (i found a filesaver.js library, but its not exactly what I need). Thanks in advance.
You can have your Electron app load all code from a server every startup and cache this locally. You can do this by simply hosting your electron code on a web server and pointing Electron at the URL. You could make the app work offline by using a Service Worker.
This isn't a great idea though as code loaded from the internet will have access to all the node APIs. You will have essentially made a DIY botnet and securing it from abuse can be tricky.
You should read Security, Native Capabilities, and Your Responsibility in the Electron docs and be sure you understand the implications.
You can use the built-in autoUpdater of Electron: https://electronjs.org/docs/api/auto-updater
You need a server the autoUpdater can talk to, to download the updates from. The updates are installed after download.
You can host a server by yourself or use a service like https://www.update.rocks/
What you need is electron updater and you can use electron-builder for that.

Facebook Like Chat Messenger/phonegap and its requirements

Please I need venerable expert contribution on this only:
1.) Am trying to get insight on how to build a Facebook like chat Messenger using Ajax,Jquery,html5 and Phonegap as a Wrapper(For cross multiple platform). Is this a good idea or
approach?
2.) For Chat application I want to use either Ejabbered Client with XMPP or Web sockets. The chat will be require to
periodically display typing status, instant notifications, Messaging sounds etc
Between this two technology Websocket and
Ejabbered/XMPP which one is the best in terms of performance, latency reduction,cpu and Bandwith consumption reduction and battery life
saver etc. Again between the Ejabbered Client/XMPP and Web Socket which of them is supported by phonegap.
3.) Does every hosting company supports Web sockets and Ejabbered Client/XMPP Server
4.) Please emphasize on the reason why one is prefered to the other.
Thanks
I just did an IM application using Jabber (XMPP) in native android, (not in phonegap); and it works like a charm.
Is it a good idea? - well, if you are good and quick at phonegap, then go for it.
For a comparison, this post might help you. I know XMPP better, it is a well-done IM protocol with lots of awesome extensions. Furthermore, this sample XMPP app on Phonegap might also give you good insight, if not anything more.
Many choices. Rent a cloud server. Begin with a free version Amazon EC2 server.
For my Jabber IM app, I installed the opensource OpenFire IM server quite easily on an Amazon EC2 Server where I quite simply run a Linux machine. This is a step-by-step tutorial on how to install and run a Linux OS up in Amazon with one click!

How to use Windows Azure in Indonesia?

I plan to implement my website (asp.net & sql2008) using windows azure, but I have difficulty to do it because windows azure has not released yet in my location (Indonesia).
Should someone like to share the solution the same with my problem would be appreciated.
The question was asked on MSDN and the answer is that it is not possible. The only solution is to wait for Windows Azure available in your country.
MSDN Forum
Just run your apps on HK or Singapore Windows Azure Public Data Centers, these are the APAC Data Centers for your region.
for testing reasons, I wanted to create an Azure account, and faced the same here in Egypt.
I've made it by remotely logging into one of our U.S-based servers, and registered from there :) If you can't do so, and need this account badly, and don't have such server, try using TOR.
Update: TOR is a proxy-like solution for your internet connection, it will redirect all requests/responses to a node on the TOR network, which consists of volunteers like you and me.
so my solution is simple, we gonna use tor to simulate that you are inside one of the permitted countries, and register your account with ease.
what you gonna need is to install TOR and configure your browser to use it, but my personal recommendation is to install TOR browser bundle, it's TOR+a Browser that is pre-configured to use it.
you gonna find a nice video on the TOR browser bundle page that will give you an overview about it.
give it a try, and tell me what happened.

Handle skype message using Ruby

Is there any library that allows to handle Skype messages using Ruby?
Take a look at this: http://rubyforge.org/projects/skyperapper
If you are using JRuby http://skype.sourceforge.jp/ might be a better option
For the public API doc: http://developer.skype.com/accessories
You can use the RestClient gem and the tropo.com service to send and receive Skype IMs. See the documentation for their REST api here:
https://www.tropo.com/docs/scripting/message.htm?search=skype#anchor
They're currently not charging for the service that sends/receives instant messages.
There are currently two ways of accessing the Skype network in a sanctioned manner. The first is the Skype Public API, which requires talking to the official Skype client running on a local machine. The other is SkypeKit which I am led to believe has a very restrictive agreement attached to it.
SkypeKit for ruby is available as a gem here.
The following is historical only; Skype no longer supports the Public API for their client. I have also been working on a Ruby wrapper around the Skype Public API. It's far from finished at the moment but supports Windows and Linux currently (OSX should be easy to implement as well, however I currently don't have a Mac) and allows you to connect and send commands to Skype manually. Long term the entire API will be wrapped.
In the interests of full disclosure, there seem to be a few other projects hanging around too, however they seem to only target a single platform and the ones I found seem to be abandonware at the moment.
libpurple have a plugin for Skype, but this is not easy to Setup.
Unfortunately, Skype protocol is closed & encripted, so there are no good libs out there.

FTP/SFTP Server thats scriptable

I am looking for a windows FTP/SFTP server software that I can administrate (partly) by scripting against it, or if it has a .NET or COM API but at the end of the day I need to execute scripts/tasks against it that adds accounts and such.
I have considered building my own c# implementation but it seems unneccecary to do that by my self when there probably are tons of great ftp and sftp software out there.
Anyone has any suggestions?
Thanks in advance.
/Johan
You could use solt_sftp, that is a SFTP server developed in Python based on Paramiko and running under Gevent greenlets. Users can be managed in Redis and there is a Redis channel to notify the SFTP server for user add/modify dynamically.
CompleteFTP is a lightweight and fast Windows FTP/FTPS/SFTP/SCP server. At times we've considered adding the ability to do various admin things via a script. If you contact us and let us know what your requirements are, maybe we can help.

Resources