Stream Management (XEP-0198) in Prosody - xmppframework

I am using Prosody for stream management. But I am suffering from some issues.
How can I ensure that stream management is enabled on prosody ? Is there any command to test on terminal ?
I also tried to add mod_smacks.lua modules in modules. but I don't know how to enable it on server.
I am using XMPPFramework as chat client on iOS. There is already a method to check support for stream management or not, but it is returning me always false so far.
Please help me out to enable stream management in prosody.

After you added mod_smacks.lua into your /usr/lib/prosody/modules/ add
"smacks";
to your
modules_enabled = {
...
}
in your /etc/prosody/prosody.cfg.lua if you want the module to be loaded every time prosody starts.
Then restart prosody.
Prosodyctl does not show loaded modules.
You can check if the module is loaded via ad-hoc commands (or telnet if activated). You can even load and unload modules via ad-hoc/telnet.
You get more information about mod_smacks here.

Related

ipxe uefi boot NBP filesize is 0 bytes

I want to install the system using IPXE in UEFI mode and embed scripts using ipXE.efi.The following:
[root#localhost src]# cat uefi.ipxe
#!ipxe
dhcp
chain http://192.168.222.1/ipxeboot/menu.ipxe
compile:
make bin-x86_64-efi/ipxe.efi EMBED=uefi.ipxe
The installation error is as follows:
enter image description here
I think you need to provide some more context.
I assume you want to load a ipxe script over http on 192.168.222.1. So you have to run a http server on this ip which provides a ipxe script. This ipxe scripts has to provide instructions where to load the os.
I wrote a tutorial to achive this here:
https://medium.com/#peter.bolch/how-to-netboot-with-ipxe-6a41db514dee

Symfony 4 framework session handler error

I'm using symfony 4, What does error stands for ?
Warning: SessionHandler::read(): open(/var/lib/php/sessions/sess_634q91mh896b6aa4jpjvlihmar, O_RDWR) failed: Permission denied (13)
When a user logs into a Symfony application, session information is stored on the web server. By default Symfony uses the native PHP session mechanism, storing session info in a file in /var/lib/php/sessions/ on Linux systems. Your error message is output by PHP and means it got a permissions error creating or re-opening a session file.
The error appears only intermittently because PHP removes old session files randomly about every 1/100th or 1/1000th page load. (On some Linux variants, old session files are removed by a cron job instead.)
https://symfony.com/doc/current/session.html says:
"some session expiration related options may not work as expected if other applications that write to the same directory have short max lifetime settings."
Try to avoid having multiple processes writing to the same sessions directory. I think I got the error message because both an Apache web server and php bin/console server:start were running at the same time. One process may have removed the other process's session file.
See PHP manual and Symfony manual for how to configure writing to separate directories. For example, I changed {Symfony directory}/config/packages/framework.yaml:
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
# handler_id: ~
cookie_secure: auto
cookie_samesite: lax
handler_id: 'session.handler.native_file'
save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
gc_probability: 100 # Run garbage collection always for
gc_divisor: 100 # investigating this problem only.
Another possibility is a problem in your Symfony code can cause the error message. The Symfony documentation says not to call the PHP session functions like session_start() directly since Symfony classes call them. A bug in my code caused an exception which I speculate caused the error message.
Related stack overflow questions: cleanup-php-session-files and how-does-php-know-when-to-delete-a-session
For those familiar with C code, see the PHP interpreter source code line that prints the error here
Hope this helps!
Not related to symfony 4, but you have to fix permissions in your /var/lib/php/sessions/ directory

Hyperledger Composer CLI Ping to a Business Network returns AccessException

Im trying to learn Hyperledger Composer but seems to be a relatively new technology, i mean there are few tutorials and few solutions to a lot of questions, tutorial does not mention possible error case when following the commands and which means there are is also no solution for those errors.
I have joined the composer channel in their community chat, looks like its running in Discord or something, and asked the same question without a response, i have a better experience here in SO.
This is the problem: I have deployed my business network, installed it, started it, created my network admin card and imported it, then to test if everything is ok i have to command composer network ping --card NAME-OF-MY-ADMIN-CARD
And this error comes:
juan#JuanDeDios:~/proyectos/inovacion/a3-poliza-microservice$ composer network ping --card admin#a3-policy-microservice
Error: transaction returned with failure: AccessException: Participant 'org.hyperledger.composer.system.NetworkAdmin#admin' does not have 'READ' access to resource 'org.hyperledger.composer.system.Network#a3-policy-microservice#0.0.1'
Command failed
I think that it has to do something with the permission.acl file, and gave permission to everyone to everything so there would not be any restrictions to anyone, and tryied again, but failed.
So i thought i had to uninstall my business network and create it again, i deleted my .bna and my network.card files also so everything would be created again, but the same error result.
My other attempt was to update the business network, but didn't work, the same error happened and I'm sure i didn't miss any step from the tutorial. I do also followed the playground tutorial. What i have not done its to create another app with the Yeoman but i will do if i don't find a solution to this problem which would not require me to create another app.
This were my steps:
1-. Created my app with Yeoman
yo hyperledger-composer:businessnetwork
2-. Selected Apache-2.0 for my license
3-. Created a3-policy-microservice as the name of the business network
4-. Created org.microservice.policy (Yeah i switched names but Im totally aware)
5-. Generated my app with a template selecting the NO option
6-. Created my assets, participants and transactions
7-. Changed my permission rules to mine
8-. I generated the .bna file
composer archive create -t dir -n .
9-. Then installed my bna file
composer network install --card PeerAdmin#hlfv1 --archiveFile a3-policy-microservice#0.0.1.bna
10-. Then started my network and created my networkadmin card
composer network start --networkName a3-policy-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin#hlfv1 --file networkadmin.card
11-. Imported my card
composer card import --file networkadmin.card
12-. Tried to ping my network
composer network ping --card admin#a3-poliza-microservice
And the error happens
Later i tried to create everything again shutting down my fabric and started it again and creating the network from the first step.
My other attempt was to change the permissions and upgrade my bna network, but it failed too. Im running out of options
Hope this description its not too long to ignore it. Thanks in advance
thanks for the question!
First possibility is that your network name is a3-policy-network but you're pinging a network called a3-poliza-microservice - once you do get the correct ACLs in place (currently, that's the error you're trying to resolve).
The procedure for upgrade would normally be the procedure below:
After your step 12 (where you can't ping the business network due to restrictive ACL conditions, assuming you are using the right network name) you would have:
Make the changes to to include your System ACLs this time eg.
/**
* Sample access control list.
*/
rule SystemACL {
description: "System ACL to permit all access"
participant: "org.hyperledger.composer.system.Participant"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}
rule NetworkAdminUser {
description: "Grant business network administrators full access to user resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "**"
action: ALLOW
}
rule NetworkAdminSystem {
description: "Grant business network administrators full access to system resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}
Update the "version" field in your existing package.json in your Business Network project directory (ie need to change it next increment - eg. update the version property from 0.0.1 to 0.0.2.)
From the same directory, run the following command:
composer archive create --sourceType dir --sourceName . -a a3-policy-network#0.0.2.bna
Now install the new business network code firstly:
composer network install --card PeerAdmin#hlfv1 --archiveFile a3-policy-network#0.0.2.bna
Then perform the requisite upgrade step (single '-' for short form of the parameter):
composer network upgrade -c PeerAdmin#hlfv1 -n a3-policy-network -V 0.0.2
After a few seconds, ping the network again to see ACL changes are now in effect:
composer network ping -c a3-policy-network

Questions on starting Locator using snappydata/bin> ./spark-shell.sh script

Spark v. 0.5
Here's the command I used to start a Locator:
ubuntu#ip-172-31-8-115:/snappydata-0.5-bin/bin$ ./snappy-shell locator start
Starting SnappyData Locator using peer discovery on:
0.0.0.0[10334] Starting DRDA server for SnappyData at address localhost/127.0.0.1[1527]
Logs generated in /snappydata-0.5-bin/bin/snappylocator.log
SnappyData Locator pid: 9352 status: running
It looks like it starts the DRDA server locally, with no outside interface for a client to connect to. So, I cannot reach my SnappyData Locator using this JDBC URL from an outside client host (e.g. my SquirrelSQL editor).
This does not connect:
jdbc:snappydata://MY-AWS-PUBLIC-IP-HERE:1527/
What property do I pass my ./snappy-shell.sh location start command to get the DRDA Server to start on a public IP address instead of "localhost/127.0.0.1"?
Use -client-bind-address and -client-port options. For locator also use the -peer-discovery-address and -peer-discovery-port options to specify bind address for other locators/servers/leads (that are passed to their -locators=<address>:<port>):
snappy-shell locator start -peer-discovery-address=<internal IP for peers> -client-bind-address=<public IP for clients>
See the output of snappy-shell locator --help for commonly used options.
For SnappyData releases, you may find it much easier to use the global configuration for all of the locators, servers, leads. Check configuring the cluster.
This will allow specifying all options for all JVMs of the cluster in conf/locators, conf/leads, conf/servers then starting with snappy-start-all.sh, status with snappy-status-all.sh and stop all with snappy-stop-all.sh
On a related note, we at SnappyData Inc., are developing scripts to enable users quickly launch SnappyData cluster on AWS.
If you want to try it out, below steps would guide you. We would love to hear your feedback on this.
Download its development branch git clone https://github.com/SnappyDataInc/snappydata.git -b SNAP-864 (You don't need to clone the repo for this, but I could not find a way to attach the scripts here.)
Go to ec2 directory cd snappydata/cluster/ec2
Run snappy-ec2. ./snappy-ec2 -k ec2-keypair-name -i /path/to/keypair/private/key/file launch your-cluster-name
See this README for more details.

How to use "telemetry.cfg" and ".telemetry.cfg" files with Adobe Scout

In the simplest language possible, can someone please explain...
the function of the "telemetry.cfg" file when debugging an application with Adobe Scout?
the function of the ".telemetry.cfg" file when debugging an application with Adobe Scout?
what TelemetryAddress is needed in each file
The only information I've found describing their functionality is very limited and I'm having trouble wrapping my head around these concepts.
Some notes for reference...
Example of "telemetry.cfg" file contents ("172.30.124.81" is the local IP of the machine running Scout):
TelemetryAddress = 172.30.124.81:7934
SamplerEnabled = false
CPUCapture = false
DisplayObjectCapture = false
Stage3DCapture = false
ScriptObjectAllocationTraces = false
And ".telemetry.cfg" could be the same except:
TelemetryAddress = localhost:7934
I've read this to be true:
7934 - Scout's default port
7935 - Flash Builder's default port
Please don't just post a link to the official Adobe documentation; I've read it numerous times.
The .telemetry.cfg and telemetry.cfg file formats are the same.
Either one is only used when enabling Scout options to profile a swf in a remote process (i.e. on a different PC). This configuration file is located on the PC that is running the swf in order to tell the Flash runtime where to send its telemetry data and which data that it should send.
There is an iOS & Android app for configuring AIR on the actual mobile devices and thus the telemetry.cfg/.telemetry.cfg file is not used.
telemetry.cfg is used to config Air (via FlashBuilder) for profiling Blackberry 10s over their USB connection. Same options in the '.telemetry.cfg', just the IP is a link-local IPv4 address (169.254.x.x). Blackberry 10s are at end of life for support for AIR and I personally have not developed for them.
So in the Scout preferences:
You can change the port number that Scout uses, and this port number has to match the one used in the .telemetry.cfg that is located on the remote PC.
The "Make the Flash Runtime on thus computer connect to Scout" option actually creates a temporary ./telemetry.cfg that exists only while Scout run and is picked up by the Flash runtimes/SWFs that you run so profiling is automatic.
TelemetryAddress in the file is the IP (or host name) of the PC that is running Scout and the port address has to match the one assigned in the Scout Preferences (default is 7934)