How to change Fennec application name - build

I need to change Fennec application name.
I build Fennec using next instruction https://wiki.mozilla.org/Mobile/Fennec/Android. Them when after apk installation application name is "Fennec Misha". Instruction tells that
The name of the app that shows up on your phone will be "Fennec $USER"
(where $USER is the username under which you built the code).
And when I change $USER using export USER=app
$USER variable is changed but application name is still the same "Fennec Misha"
Solution to create local user with required name doesn't fits to me.
What I'm doing wrong?

Override MOZ_APP_DISPLAYNAME. If it's not overridable edit /mobile/android/branding/unofficial/configure.sh

Related

sg-cookie-optin extension throws No class named SGalinski\SgCookieOptin\Hook\LicenceCheckHook

Downloaded this https://packagist.org/packages/sgalinski/sg-cookie-optin
Copied the file to the server, activated the extension in ext manager.
Suddenly front & backend not working anymore.
Deleted the extension manually from PackageStates.php according to
https://docs.typo3.org/m/typo3/guide-installation/master/en-us/ExtensionInstallation/Index.html
Frontend now working, backend still throws the error
No class named SGalinski\SgCookieOptin\Hook\LicenceCheckHook
in /home/sc/wwn/typo3_src-10.4.10/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 3340
throw new \InvalidArgumentException($errorMsg, 1294585865);
}
} else {
$errorMsg = 'No class named ' . $parts[0];
throw new \InvalidArgumentException($errorMsg, 1294585866);
}
} elseif (function_exists($funcName) && is_callable($funcName)) {
// It's a function
$content = call_user_func_array($funcName, [&$params, &$ref]);
I did set up the key and the output folder in the config file
what I didn't do since backend not working anymore :
3. Add the static TypoScript named "Cookie Optin" to your instance with the "Template" backend module.
Open up the "Template" module in the backend of TYPO3.
Go to your root site page within the page tree.
Choose "Info/Modify" at the select on the top.
Click on the button "Edit the whole template record".
Select the tab "Includes".
Choose the template "Cookie Optin (sg_cookie_optin)" on the multi select box with the name "Include static (from extensions)"
Save
4. Go into the "Cookie Opt In" backend module, configure it and save it once.
Any idea how i can fix that? Pretty stuck atm.
The install tool of your installation should still work. Try to open yourdomain.tld/typo3/install.php.
To enable the Install Tool, the file ENABLE_INSTALL_TOOL must be created in the directory typo3conf/. Make sure that the file has no file extension like .txt.
Then log in to the install tool and go to Maintenance => Flush TYPO3 and PHP Cache and flush all caches.
Then the backend should work.
If the install tool is not accessible, try to find a folder var/Cache. Most probably it will be located in typo3temp. Delete all files and subfolders from the Cache folder.

Local machine environment variable

I have next problem: I have same environment for site on work and home PC, but I have different database records inside it.
So in that case for test requests on my local environment I constantly need to change tested values.
Postman has different scopes for variables (see documentation)
In my case in collection scope is saved production variables. On environment scope I rewrite this values by my local configuration.
Collection variables
SITE_DOMAIN - https://www.prod.com/
USER_ID - 1234567890
Environment variable
SITE_DOMAIN - https://dev.loc/
USER_ID - 123
At home I have the same domain, but another user id and I need to change it in Environment variable every time when I wanna run request at home.
I wanna setup USER_ID to another value only at home local machine.
Recorded interface example
Is it possible to rewrite variable with local machine scope? There is local layer, but it isn't described in documentation.
If I understand the question correctly:
You could add a value into the local environment file local_dev or something, to run a check to see if it’s there - then have some logic in the pre-request script that looks for the value, if it exists, then change the USER_ID variable to the one you want before the request is made and if not, do nothing.
Roughly, something kind of like this but more elegant:
if(pm.environment.get('local_dev') === 'some_value') {
pm.environment.set('USER_ID', 1234)
}
I might have totally misunderstood the question though.
As I see, local variable is that variable which we setup in Pre-request Script section in pm.variables scope.
So we can override environment value without changing it by
pm.variables.set("VAR_NAME", "VAR_VALUE");
Unfortunately it will run in all PC's on each send request. So we need to add some logic to it.
As it supposed by #Danny Dainton we can add some environment variable for dev PC position.
So as a workaround I add variable PC_ENV to Local environment and put some logic for this in Pre-request Script section.
if (pm.environment.get('PC_ENV') === 'home') {
pm.variables.set("USER_ID", "35");
}
How can we use this? When we start work with Postman we go to our environment and setup PC_ENV value to home or office depends on where we are now.
Recorded example
If we don't want to run Pre-script section every time we can add all local variables values for each PC and run it only once at the beginning of the work by setup required condition.
const needSetupEnvironment = true;//change to false when setup is finished
if (needSetupEnvironment) {
const currentEnvironment = 'home';//setup environment before start work
let userId;
switch (currentEnvironment) {
case 'home':
userId = 35;
break;
default:
userId = 123;
break;
}
pm.environment.set('USER_ID', userId);
}
We can enable script when we need to change environment variables, and than disable it after setup run it once with correct environment.
Recorded example

R Markdown with Shiny Server change host parameter

I am running RStudio on a server and I created a RMarkdown (.Rmd) file. It works fine if I create it as a static HTML but it does not work if I want it to be interactive (by adding runtime:shiny).
The issue is that when I add runtime:shiny and press the Run Document button the application will try to open at 127.0.0.1:xxxx (here xxxx is a random port). In order to make it work I would have to be able to change the host parameter to '0.0.0.0'. This is an option in the runApp function from the shiny package but I don't know how to add this option in RMarkdown.
Can anyone help me with this?
Thank you.
The ::run command from rmarkdown invokes shiny::runApp internally. You can set the option shiny.host before running the document:
options(shiny.host="0.0.0.0")
rmarkdown::run("myfile.Rmd")
You an also pass arbitrary paramters to runApp, so this should work too:
rmarkdown::run("myfile.Rmd", shiny_args=list(host="0.0.0.0"))
Neither of these will work with the Run Document button; that button starts a new R session in which to render the document. To change the shiny.host option in that session, you'll need to add the option to your .Rprofile.
Set the default values you want to initialize in (~/.Rprofile) under user directory
Sys.setenv(TZ = "UTC") # for Timezone
options(shiny.port = 9999)

Setting UID to User Other Than Root in C++

I am developing in C++ on NetBeans 6.9 on Ubuntu 11.04. I am making a system() call which I would like to be called as user "peter" rather than as root. I understand that
setuid(0);
sets the user to root but how does one set the user to peter?
Thanks,
Peter.
You perhaps want to search the password file for the correct user id via, e.g. getpwnam(). Something like:
// look up peter's uid
uid_t peter_uid=getpwnam("peter")->pw_uid;
// Become peter
setuid(peter_uid);
seteuid(peter_uid);

Hyper-V/WMI programming Question

I've looked at several objects in the "root\virtualization" name space but I have not been able to find where Hyper-V stores the path to the config file for a given virtual machine. I need to get this file path programmatically or at least just the home path of a given virtual machine would be fine as well. What WMI object and field stores the path to a given virtual machine (hint it's not Msvm_ComputerSystem) ?
Get the DefaultExternalDataRoot property of Msvm_VirtualSystemManagementServiceSettingData to get the vm root, and append the Name property of Msvm_ComputerSystem (guid) and ".xml". Even if the VM is created in a non-default location, you'll see a symlink in the default external data root directory referencing the config file.
This is not completely true. In WSS2008R2, when changing default VM data root, nothing is written in the system data root. To find the data root of a single VM, you need to look in Msvm_VirtualSystemGlobalSettingData, search for SystemName property matching your VM GUID and look in ExternalDataRoot and SnapshotDataRoot properties to see the VM related folders.