I've been tinkering with my .zshrc file for a while to change how the command prompt looks and also make it display certain statuses for git. But after I made some changes
when I type in echo $HOST to see the hostname of my laptop, this shows up. (narnia is just what I named the hostname) It used to show narnia.local, but now it shows narnia.ht.home. Could someone explain what caused this to change, and whether or not it's something I should worry about?
Related
Normally, when debugging with 'dump()' in twig, I get those tiny black little boxes, in which I can see my output,and open objects by clicking on an arrow. I don't know what I have changed, but now I get real var_dumps, means, I see full objects with 1000 lines instead of the black boxes.
Does anybody know, how to turn back the "old" behaviour?
You need to install:
composer require --dev symfony/var-dumper
You need to have php bin/console server:run previously and then, open another terminal and if you want to see it directly in the terminal, run:
php bin/console server:dump
or
php bin/console server:dump --format=html > dump.html
if you want to generate a html for opening and close object by clicking.
For more info, check: https://symfony.com/doc/current/components/var_dumper.html
Okay, one point which was missing is:
It is important to set the environment to DEV, in my case, we are using antother environment called LOCAL. If I switch to DEV, everything works like described by #DarkBee and #AythaNzt:
composer require var-dumper
set html_errors on in php.ini
set fastcgi_param VAR_DUMPER_FORMAT html; in nginx
Currently I don't know where the difference between these two environments, since local is a plain copy from dev, but anyway: it works.
how to make emacs as default editor in bash shell? I tried setenv EDITOR emacs. It gave me the error message "setenv: command not found".
When changing profiles, make sure you always use full paths, just in case PATH is not yet set at that point. Double check if you do have setenv:
# find / -name setenv
If so, just enter its full path in your profile. Furthermore: a unix flavor would be nice for people to know, not all flavors work with the same file names.
I'm writing a script to create virtual hosts in Mamp Pro. I want them to be created and appear in the GUI next to the normal ones I've created manually through the GUI. I've found the following questions on SO:
Automatic Virtual Hosts with MAMP Pro?
Add MAMP Pro Vhosts with script
Here are my findings, so far:
I've found out that the hosts appearing in the MAMP Pro GUI are found in: ~/Library/Application\ Support/appsolute/MAMP\ PRO/settings3.plist; I've tried editing it but I can't seem to get the entries right with the command PlistBuddy -c 'print ":virtualHosts"' settings3.plist which says Print: Entry, ":virtualHosts", Does Not Exist
From the second question I've listed above, I found out that I can edit the httpd.conf files (one found in user library and one in the root library) through the GUI.
The hosts file including all of the IP addressing is in /private/etc/hosts
The questions are dead, even though I commented on the latest one asking for an update on how he solved his scripting problem in the end.
In the end, I can easily add the values into the hosts file and the vhosts.conf files to make the website work. My only problem is getting it to show up in the list with the other virtual hosts in the MAMP Pro GUI.
Update: After further investigation and experimentation, I realized the process in which the virtual hosts are created; when I first create a host through the GUI, the settings3.plist file gets updated, when I hit "save" to save the changes, the hosts and httpd.conf files are updated accordingly. I understand that settings3.plist can be converted to an XML through plutil -convert xml1 -o - settings3.plist > test.txt and then edit it and convert it back to binary through plutil -convert binary -o - test.txt > settings3.plist.
My problem with that is that, even though I got the gist of how the CP$UID works in the XML formats, I cannot create a script to undestand the concept, check for the position of the values through the list, and then put in the values accordingly. I even asked a question about it here: https://stackoverflow.com/q/33775025/1934402
The solution provided in Automatic Virtual Hosts with MAMP Pro? refers to MAMP PRO version 2.x where host configuration is saved in settings.plist which is an XML format property list file while in MAMP PRO version 3.x host settings are stored in settings3.plist which is a binary format property list file.
Even in this format you should be able to do:
/usr/libexec/PlistBuddy -c Print settings3.plist
and still get the contents of the file. Your problem arises from the fact that virtualHosts is no longer there as you will see by running the above command. The above command output is not very helpful for understanding the structure of your plist file so you could run:
plutil -convert xml1 -o - settings3.plist > ~/settings3.plist.xml
and then work out the structure of ~/settings3.plist.xml in order to find out which keys to use in PlistBuddy commands. It is a good idea to check the manual pages for plist and PlistBuddy. Do note that key names have changed and the structure is not that clear even in the xml file.
I hope this helped. I will investigate further into it and modify this answer if I have a full recipe for editing host details.
I've tried to change global variable DSQUERY in Solaris with this command:
setenv DSQUERY "SYBSERVER"
but it wasn't persisted. When I entered again in the machine the value was set to the older one.
How can I persist this change?
You have to put this line in your profile file. This file is read when you start a shell, and allows you to set-up some specific settings.
The filename depends on the shell you use and how you connect (with a direct connexion or with a su for example).
It seems you use csh, so you will have to change $HOME/.cshrc and.or $HOME/.login files.
Add your SetEnv command to .cshrc and .login file will do the job.
You have to do it in the user profile files, depending on the shell being used (.login, .cshrc, .bashrc, etc) so that when you log in again, it's executed automatically. There are global versions of those files under /etc for some shells, in case you want that to be applied to all users.
Rgds,
Daniel
Something for debugging reason, I check the log information very often, I may help to make the log file directly output in screen line by line like webrick does
in your terminal type
tail -f log/development.log
after you start nginx and be sure to type in your project directory