Ejabberd : make && make install does not update ejabberd.yml file? - erlang

I want to add a hook to ejabbered code. Steps followed:
added mod_filter.erl to src folder(mod_filter catches filter_packet event and returns modified packet)
added mod_filter in ejjbaerd.yml under modules section.
ran ./configure, make , make install
Ejabberd server runs successfully , with mod_filter.beam file in /ebin folder but the ejabberd.yml file located at /etc/ejabberd/ejabberd.yml does not get updated as per my second step.
I can manually update it and restart server but that does not seem to be the correct way. I think i might be missing a deployment step here, please suggest.

Change configuration file (ejabberd.yml) according to your need and reload configuration file like that- ejabberd_ctl reload_config or ejabberd_config:reload_file(). or ejabberd_config:load_file("/etc/ejabberd/ejabberd.yml"). you do not need to restart server.
https://www.ejabberd.im/tricks
https://docs.ejabberd.im/admin/api/

Related

Milo - Run configuration settings

I am interested create an Client Interface for a simulation software. So I have downloaded Milo and I went through the examples. I was able to build successfully when I executed mvn clean package. I would like to know how to set the run configuration for executing the Client Example.java.
In the client-examples project. Look into the ClientExample.java source file. In this file
update the method getEndpointUrl for server Endpoints. By default this method has a loop back Endpoints i.e :"opc.tcp://localhost:12686/milo".

How to adda new module to MongooseIm chat server written over ejabberd

I am trying to add the mod_zeropush module to the existing ejabberd MongooseIm server.
I copied the beam file to location where all beam files are there in the rel folder.
When do the $sudo bin/mongooseimctl debug command and finding the mod_ all entries matching with mod_... I see all except my mod_zeropush.
Can anyone help me how they made this module add to their chat server.
Raised this issue to Github guys as well : MongooseIM GitHub
I achieved this by getting some help and would like share how its added to MongooseIM.
This setup is done on a server running Ubuntu 16.04.
After you downloaded mod_zeropush.erl (maybe from here), put it in the location as mentioned below:
`<GitSourceMongooseFolder>/apps/ejabberd/src/mod_zeropush.erl`
Run sudo make in MongooseIM directory.
After the build is done, the beam file is created in the rel
folder at location given below:
/MongooseIM/rel/mongooseim/lib/ejabberd-2.1.8+mim-2.0.0beta2-312-g3cec442/ebin
Add the following code to ejabberd.cfg in modules section.
{mod_zeropush, [
{sound, "default"},
{auth_token, "myapp-chat-token"},
{post_url, "http://my.url/mypath"}
]},
Go to rel/mongooseim folder and enter the command sudo
bin/mongooseimctl debug
Check by entering mod_ on shell prompt then Tab; you should see
mod_zero
Go to root/rel github directory and sudo bin/mongooseim restart
Done. You should receive offline messages on your web server.

electron how to create delta file

I use electron-builder to build my app and succeed to build the first version which contains three outputs: foosetup.exe, foo-0.0.1-full.nupkg and RELEASES.Now I want to implement the auto-update and I have deployed a back-end service by using electron-release-server.
The auto-update need to set a feedURL which will be used to fetch updates,but the problem is that I don't know what the updates exactly means?Is it the foo-0.0.1-full.nupkg or the foo-0.0.1-delta.nupkg or another file?
The second problem is that I don't know how to create the delta file.I can just find an option remoteReleases in electron-builder which is a URL to your existing updates.If given,these will be downloaded to create delta file.But what's the URL exactly means?I find a example i which "remoteRelease": "https://github.com/user/repo",and it creates some releases and uploads many extra files for each release such as foosetup.exe, foo-xx-full-nupkg, RELEASES.I guess electron-builder will fetch the ${remoteReleases/release/download/some-version/xxx} to download file and then diff the two file to create delta file,but I can't upload RELEASES when I create release on github,it reports that they don't support this file type.
Is there anyone can help?There're to few docs to follow for a beginer
For electron-release-server please take a look at the docs.
The delta-file will be create automatically if you use electron-builder. But in order for this to work remoteReleases must be set to a valid (and reachable) URL plus there must at least an empty file called RELEASES. So for the very first build just create an empty file and call it RELEASES.
On every future build there will be a RELEASES file created for you. Threw all the generated files in your release server (overwrite existing RELEASES) and it'll be fine.
Attention: For electron-release-server you do not need the RELEASES generated by electron-builder. electron-release-server will create one by itself.
To get started with auto-updates I'd recommend that you set up a dead-simple release-server locally. I. e.:
Create a directory and throw an empty file RELEASES in there.
Then start a simple webserver pointing at that directory (e. g. cd into/your/dir && php -S 0.0.0.0:80).
Edit your package.json: "remoteRelease": "http://localhost"
Then build your installer: npm run dist
It should successfully build and you should see some GET requests on your local server.
Take the generated files and stuff them into the directory you created.
Now increment your version and start another build: npm run dist
You should see some GET requests again and there should be an addition delta-file being created.
Again stuff all those things into the directory (or for electron-release-server upload the assets .nupkg, .exe and delta into a new release).
Hope that helps. Feel free to comment if something is unclear.
Check out this sample app that I have created https://github.com/electron-delta/electron-sample-app
It uses two npm packages.
#electron-delta/builder
#electron-delta/updater
More details https://github.com/electron-delta/electron-delta#installation

The command line statement php artisan tinker isn't working

I am using laravel 5.1 and I am following a tutorial that I've followed before without any issues. But today when I ran
php artisan tinker
I got the following error
PsySH history file found at '/home/vagrant/.config/psysh_history'. Please delete it or move it to '/home/vagrant/.config/psysh/psysh_history'.
I have never seen this before and I have been looking for it but dont know where to locate it so can either delete it or remove it. Also another question I have is should I delete it or move it? I don't want to do something that inadvertantly crashes my app. Thanks in advance
So you don't have to answer and accept your own question:
It looks like pshsy_history is a history file for the php debugger psysh, and your php command wants it in a different location from where it is. I'm guessing it was created the first time you followed the tutorial.
I'm thinking it's safe to delete with rm /home/vagrant/.config/psysh_history since your php command seems like it's going to create a new one.
If you want to be on the safe side then to move it like the error message says with mv /home/vagrant/.config/psysh_history /home/vagrant/.config/psysh/psysh_history
If you want to double check the contents of the file before doing either, try head /home/vagrant/.config/psysh_history.
find "psysh_history" manually in "home" folder and than move or remove file
Note: Its a hidden file
For future viewers:
I had a similar issue today. The only difference was I was not running my project on vagrant instead of MAMP.
Few different things I had to do besides what are mentioned above were :
Moved the folder ../.config/psysh/psysh_history and did following :
1) I had to shut down the MAMP
2) Restart terminal
3) php artisan tinker
Note: I was not able to run tinker until I restarted MAMP and terminal.
Faced the same issue but
I didn't find psysh_history file in .config folder.
But because it was asking to move the psysh_history file to .config/psysh, so I just created a folder psysh inside .config folder and it works.

How to run Grails Wrapper (grailsw) behind a proxy?

I tried to run grailsw, but the wrapper cannot connect to download grails-2.2.1-download.zip (creates a 0 byte file instead).
I need to use a proxy server to connect to the internet, where do I configure proxy settings for the Grails Wrapper?
After running grails wrapper, your project directory has a new subdirectory called wrapper, with a file grails-wrapper.properties. You can configure your proxy settings in there, with the following properties:
systemProp.http.proxyHost=
systemProp.http.proxyPort=
systemProp.http.proxyUser=
systemProp.http.proxyPassword=
systemProp.http.nonProxyHosts=
I solved this problem for myself.
It is a two step process
1.a) Back up your JRE_HOME\lib\security folder. This is essential because the below steps might corrupt cacerts file under jre.
1.b) You need to install the ssl public key of Github.com to your local file system. To do that you have to use the InstallCert.java program( Link to InstallCert.java )
It is supposed to be run as java InstallCert github.com
and when it asks to enter cert number you need to enter 1
It will create a file with name "jssecacerts" in the current directory
1.c) But this program will not work because it does not know about how to authenticate with proxy. For this you need the code from SSLSocketClientWithTunneling page
Use the above two and create a program that tunnels through the proxy retrieves the ssl key and writes a file called jssecerts
2) Update your grails.bat with addtional options. Add these options to the %JAVA_EXE% command line. Paste them after %DEFAULT_JVM_OPTS%
-Dhttp.proxyHost=YourproxyURL -Dhttp.proxyPort=YourproxyPort -Dhttps.proxyHost=YourproxyURL -Dhttps.proxyPort=YourproxyPort -Dhttp.proxyUser=YourProxyUserID -Dhttp.proxyPassword=YourProxyPassword -Dhttps.proxyUser=YourProxyUserID -Dhttps.proxyPassword=YourProxyPassword -Djavax.net.ssl.trustStore=path-to-your-jssecacerts-created-in-step-1

Resources