Is the hostname changeable? - nanoframework

the default hostname of nanoFramework is nanodevice_xxxxxx (xxxxxx = Mac-Address), is it posible to set an individual name?
Like Networkconfig.Hostname = "xxx" and a save function and after reboot is the new hostname activ.
Best regards

Currently this is not supported. We are considering adding this feature.

Related

Can I compose variable to create new varibales in Postman?

I have a variable as BASE_URL. When I am using the localhost, I am composing it with one more variable PORT that reflects the port on which the service is running on my local. These two variables composed as {{BASE_URL}}:{{PORT}} defines the complete base URL for my APIs.
But when testing the deployed version of my API, my base URL is just https://www.xyzapi.com without any port declared explicitly.
I am using {{BASE_URL}}/rule-service/v1/find-by-txn format in the request URL. I am using environments to switch between local and remote.
How can I utilize the same request format for both cases? I have multiple microservices running on different ports.
This code did the job!
let baseUrl = pm.environment.get("BASE_URL");
if(baseUrl.includes('localhost')){
let port = pm.collectionVariables.get("PORT");
baseUrl = baseUrl.split(':')[0];
baseUrl = `${baseUrl}:${port}`;
}
pm.environment.set("BASE_URL", baseUrl);
Try this. It introduces a variabe FINAL_BASE_URL which is to be used to build your URLs (eg {{FINAL_BASE_URL}}/rule-service/v1/find-by-txn) and it includes the PORT or not, depending if an environment variable PORT is set.
if (pm.environment.get("PORT")) {
let FINAL_BASE_URL = pm.environment.get("BASE_URL") + ":" + pm.environment.get("PORT")
} else {
let FINAL_BASE_URL = pm.environment.get("BASE_URL")
}

what else do I need besides $cfg['Servers'][$i]['ssl']=TRUE

When I add to my config
$cfg['Servers'][$i]['ssl'] = TRUE;
trying to connect gives
phpMyAdmin - Error #2002 -
-- The server is not responding (or the local server's socket is not correctly configured)
I suspect this is because the mysql server requires
--ssl-ca=... --ssl-cert=... --ssl-key=...
How do I put those into the phpMyAdmin configuration
Or is there some other problem that I'm missing?
It's all explained reasonably well in the manual; those options are configured through additional directives in config.inc.php.
See for instance http://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_ssl and the few paragraphs there that follow. (Or, to be more specific, see
http://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_ssl_key,
http://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_ssl_cert,
http://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_ssl_ca,
http://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_ssl_ca_path, and
http://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_ssl_ciphers).
In my case, I was able to achieve this through adding these directives:
$cfg['Servers'][$i]['ssl'] = true;
$cfg['Servers'][$i]['ssl_cert'] = '/etc/mysql/client-cert.pem';
$cfg['Servers'][$i]['ssl_ca'] = '/etc/mysql/ca-cert.pem';
$cfg['Servers'][$i]['ssl_key'] = '/etc/mysql/client-key.pem';
Adjusting of course for the correct paths on your local system. Good luck!
Just delete the my.ini file in ...wamp64\bin\mysql\mysql5.x.x and that's it this file uses the port = 3308 which is'nt the default mysql port

How can I change my connectionString in app.config file at runtime?

I created my vb.net project to .exe file.
During installation on another machine, one can change the location of installing package to any drive.
In my project, I have set my app.config to point the Database that is available in c:\project.
If I suppose, while installation, when I change the location of installation to **d:** or anywhere, I get invalid access db.
What I want is:
I want to reconfigure my app.config file automatically, by detecting its current db location.
Imports System.Configuration
Imports System.Configuration.ConfigurationManager
Dim config As System.Configuration.Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
config.ConnectionStrings.ConnectionStrings("MyProject.Properties.Settings.MyProjectConString").ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=|DataDirectory|\SampleDB;Persist Security Info=True;"
config.Save(ConfigurationSaveMode.Modified)
Where MyProject.Properties.Settings.MyProjectConString is the name of your project and connection string.
Although this is too late to answer as the question is very old but I think this might help someone else in the future.
So, there is a way to change the Connection String value in the runtime. Since connection string is a read-only item like all other items that are on Application Scope under My.Settings so we can't change it using My.Setting.ConnectionString = "Something". But here is the code by which you can solve the issue and change any My.Settings item that is on Application Scope in the runtime.
So the code is,
My.Settings.Item("ConnectionString") = "Something"
simple...
MsgBox(My.Settings.Item("remoteAddress").ToString)
My.Settings.Item("remoteAddress") = "abcserver.servebbs.net"
My.Settings.Save()
MsgBox(My.Settings.Item("remoteAddress").ToString)
You have three options:
1.) Create and use a folder in C:\Databse and set your connection string at design time.
2.)Add the database to the project's data source at design time, then use '|Data Directory|\mydb.mdb' as your connection string.
3.) And if you use sqlserver, you don't need to worry about the location of the database once you have attached the database to sqlserver. You only need to use the proper connection string eg 'Data Source=.; Database = mydb; Integrated Security = False; Username=myusername; Password = mypassword; User Instance = false'.
The above is an example of a sql server with SQL Authentication mode as login, if you use Windows Authentication, set Integrated Security = True and remove both username and password.

dbext connection string for sql-server

I have dbext installed into gVim - the plugin menu is visible and the help file are accessible; just not helping at the moment!
Suspect it is a connection string problem. I have the following in _vimrc:
" Microsoft SQL Server
let g:dbext_default_profile_WH = 'type=SQLSRV:user=profileName:passwd=profilePassword:dsnname=SQLOLEDB.1:srvname=imsname'
Is this correct?: dsnname=SQLOLEDB.1
Here is my working connection string configuration
let g:dbext_default_profile_mydb = 'type=SQLSRV:user=sa:passwd=password:srvname=localhost\SQLEXPRESS:dbname=mydb'
It seems that only difference between two configuration strings DNS part so it might be DNS problem as you mentioned.

SSHtools disable Verifying host key[Yes/No] message?

Hi is there an easy way to disable this host verification in j2ssh (assigning yes somewhere) that every time I connect to server I shoudn't type Yes ?
In SSH, there is a configuration option:
StrictHostKeyChecking=no
You can probably set this in j2ssh like this:
setConfig("StrictHostKeyChecking", "no")
Whether this is a good idea is left as an exercise for the reader.
If you don't want to validate the host, the following piece of code should do the job:
ssh.connect(hostname, new IgnoreHostKeyVerification());
Here is a snippet, just replace the parts from the example here.
SshClient ssh = new SshClient();
ssh.setSocketTimeout(30000);
SshConnectionProperties props = new SshConnectionProperties();
props.setHost(hostname);
props.setPort(port);
ssh.connect(props , new IgnoreHostKeyVerification()); // ignore unknown host warning
// Create a password authentication instance
PasswordAuthenticationClient pwd = new PasswordAuthenticationClient();
pwd.setUsername(username);
pwd.setPassword(password);
// Try the authentication
int result = ssh.authenticate(pwd);