Thingsboard - Importing dashboards(and its components) from one env to other - thingsboard

How to import a dashboard from one server to other?
I tried and downloaded the dashboard JSON file and imported it the other TB server, and gave the alias names.
But, the devices and the assets and other entities and its states did not get imported.
Am I doing it wrong?
Are the other devices and the assets and other entities , need to be imported seperately? How?
Thanks

when you import a dashboard you just import its configuration not the telemetries and attributes and value of them . try to import dashboard then see what entity it wants then go and define an entity for example define a device and use thingsboard telemetry upload api to send needed telemetries to device and their value (try in postman). then go to dashboards edit mode and select your own entities sent before . for example :
send a request to http(s)://host:port/api/v1/$ACCESS_TOKEN/telemetry
request body something like this :
{ "temperature": 456 ,
"humidity" : 700 ,
"energy" : 78444 ,
"water" : 12344 ,
"address" : "Iran, Tehran, 3 District"
}

Related

How do I insert data to Astra DB using GraphQL API?

I am trying to follow this youtube tutorial.
I am getting stuck at inserting the first piece of data. Ania demonstrates it at 20.46 as follows:
mutation insertGenres {
action: insertreference_list(value: {label: "genre", value: "action"}) {
value{
value
},
}
When I try this, I get an error that says:
{
"errors": [
{
"message": "Validation error of type FieldUndefined: Field 'insertreference_list' in type 'Mutation' is undefined # 'insertreference_list'",
"locations": [
{
"line": 2,
"column": 3
}
],
"extensions": {
"classification": "ValidationError"
}
}
]
}
When I google the error, a lot of responses tell people to use mutations instead of queries - but I've started from a mutation. I would like to know how to resolve the error, but I'd also like to find the skills to improve my search strategy for finding answers.
When I look at the documentation for using GraphQL with DataStax, I see a different format to the write structure, which is as follows:
insertbook(value: bookInput!, ifNotExists: Boolean, options:
UpdateOptions): bookMutationResult
It has a colon and a fragment of text after it. It also explicitly states the ifNotExists: Boolean and options. I don't know if there may have been a change to how to use DataStax since the time Ania recorded the tutorial that means it is no longer a current demonstration of how to use the tool, or if there is an answer for this and I just haven't found it yet.
You didn't provide details of how you've configured your Astra DB for Ania's Netflix Clone tutorial so I'm going to assume that you've named your keyspace as netflix.
It seems as though you haven't followed the instructions correctly and have missed steps. I can replicate the error you reported if I skip at least one of the steps in the tutorial.
In step 5 of the tutorial, you needed to do the following:
✅ In graphQL playground, change tab to now use graphql. Edit the end of the URl to change from system to the name of your keyspace: netflix
✅ Populate HTTP HEADER variable x-cassandra-token on the bottom of the page with your token as shown below (again !! yes this is not the same tab)
Switch tabs
In order to insert data, you need to switch to the graphql tab.
If you try to insert the data in the graphql-schema tab, you will get the error you reported.
Set keyspace
You need to update the URI of your GraphQL playground in the graphql tab to use the keyspace name netflix instead of system. For example:
https://db_id-us-west1.apps.astra.datastax.com/api/graphql/system
change to:
https://db_id-us-west1.apps.astra.datastax.com/api/graphql/netflix
If you try to insert data into the system keyspace, you will get the error you reported because the reference_list table does not exist in that keyspace. Cheers!

Is it possible to implente EAP-MSCHAPv2 without Active Directory?

I would like to test 802.1X function for an Ethernet Switch (NAS).
I have a Workstation (Windows 10) and an Ubuntu server : I want to test EAP-MSCHAPv2.
I see a tutorial to configure FreeRADIUS : https://wiki.freeradius.org/guide/FreeRADIUS-Active-Directory-Integration-HOWTO
Problem is I don't have a Windows server. Is it possible to test EAP-MSCHAPv2 without it ? How to configure FreeRADIUS ? ... I just want to test a static configuration with one login+password.
Currently my FreeRADIUS works with EAP-MD5 : I already created user profile and NAS config
You need to set the MS-CHAP-Use-NTLM-Auth attribute to No in the control list. The mschap module will then do the authentication internally, rather than trying to call out to AD.
This is documented more extensively in raddb/mods-available/mschap.
For example you could create a user bob with password test in the raddb/users file thus:
bob Cleartext-Password := "test", MS-CHAP-Use-NTLM-Auth := No
Note that this attribute must be in the control list, not in the reply list, so appears on the same line as the username.

Django admin and MongoEngine ObjectID instead of int()

Small test case is https://github.com/mekanix/djangomongodbtest, I can't seem to get admin page to show up. I login and get "int() argument must be a string or a number, not 'ObjectId'" exception. Is django admin used with mongoengine at all or do I have to use something like https://github.com/jschrewe/django-mongoadmin? Thanx!
You may need to update the handler for admin as well. The Django provided handler admin.site.urls does not work with Mongo.
from django.conf.urls import include
from django_mongoengine import mongo_admin
urlpatterns = [
url(r'^admin/', include(mongo_admin.site.urls)),
]

uploading a file from iOS mobile application to SharePoint

I'm working on a SharePoint mobile solution where I'm using the web services exposed in server/_vti_bin/sitedata.asmx, server/_vti_bin/Lists.asmx and server/_vti_bin/copy.asmx.
I'm able to successfully fetch the list of sites, document libraries and files using the services defined in server/_vti_bin/sitedata.asmx.
Now I'm actually trying to upload an image file from Photo Albums available in iOS to SharePoint. For this, I tried using CopyIntoItems web service, where in I'm getting the following error response.
<CopyResult ErrorCode="DestinationInvalid" ErrorMessage="The Copy web service method must be called on the same domain that contains the destination url." DestinationUrl="http://xxxxserveripxxxxxx/Shared Documents/image1.png"/>
But came to know that this service is used only if the file to be uploaded is also from the same source(i.e., from sharepoint).
Is there any other way to upload a file available in iPhone to SharePoint.
Also tired addAttachment service defiend in server/_vti_bin/Lists.asmx but I'm unable to identify the input parameters which requires list name and list Item ID.
I'm trying to upload a file to Shared Documents, so I've List Name value which is the one in curly braces of Shared Documents but now what should be the List Item Id value?
These are the details I've with regard to "Shared Documents" document library.
{
AllowAnonymousAccess = false;
AnonymousViewListItems = false;
BaseTemplate = DocumentLibrary;
BaseType = DocumentLibrary;
DefaultViewUrl = "/Shared Documents/Forms/AllItems.aspx";
Description = "Share a document with the team by adding it to this document library.";
InheritedSecurity = true;
InternalName = "{425F837A-F110-4876-98DE-C92902446935}";
LastModified = "2013-07-26 20:09:58Z";
ReadSecurity = 1;
Title = "Shared Documents";
},
So, I'm using the using InternalName value for listName tag.
What should be the value of listItemID?
Am I going in the right way or is there any other approach to upload a local file from mobile to SharePoint?
Thanks
Sudheer
Are you actually calling a URL or are you using the IP (you x'ed it out and said server IP)? If you don't have Alternate Access Mappings defined for the IP, uploads will fail but the GET requests will generally work ok.

secure curl POST

in my new script i am using two servers ..
one for database and php files
and one for files uploaded by users , like exe , mp3 , etc ..
from control panel on the first server , they can delete them files on the second server ..
my question is :
i am using curl to do this job
i am sending 2 POST information by curl
1 - some password for my site
2 - the job what i want do ! , like , delete file , make new folder ...
examples for the curl function :
$post = array('password'=>'Mywebsitepassword','command'=>'make new folder');
example for the file on the second server
if($_POST['password'] and $_POST['password'] == Mywebsitepassword){
it's ok
}
Now the password is 'Mywebsitepassword'
can any one know it ?????
if some one can know it , he will be able to delete all my second server content !!
is any addone or some way to know it ??
may be some addone for firefox can know it or something like that
and what is the best way to secure this job ?
thank you ..
Just make sure you do your stuff over a secure connection (SSL).
EDIT
Tutorial of creating self signed certificate on Linux: http://www.akadia.com/services/ssh_test_certificate.html
on Windows: http://technet.microsoft.com/en-us/library/cc753127(WS.10).aspx

Resources