There are many things I like about Linux over MS Windows. One of these things for a long time was no WindowsRegistry
However it seems lately Linux is leaning more and more towards "registry type" configurations. I have mixed feeling about this.
For example, in the "old days" (a couple of years ago ) I would normally put my proxy setting in either my bashrc or bash_profile.
If I wanted to make it global for all users, maybe I would put it in /etc/environment or /etc/profile .
This still works... for the "most" part. But not always. In Ubuntu, SusSE, Fedora, (I think Redhat 8.x also, but haven't checked)
You would use gsettings to do this.
To make switching easy, I went to the network settings, changed the proxy to manual and entered all my information for the proxy (host & port).
Then if I wanted to surf without proxy, I simply had to execute the following command:
gsettings set org.gnome.system.proxy mode 'none'
In order to switch back to the proxy connection I had to use the following command:
gsettings set org.gnome.system.proxy mode 'manual'
No need to specify host & port again, since those are already saved. If, however, you have to work with several proxies and would need to switch between different hosts, you can specify the proxy data with the following commands:
gsettings set org.gnome.system.proxy.http port 8080
gsettings set org.gnome.system.proxy.http host 172.16.1.1
Changes take effect immediately.
gsettings help is useful
gsettings list-schemas will show the default templates/frameworks. If you've used Java frameworks, this is similar.
gsettings has autofill help commands, for example if you type ...
gsettings set org.gnome.system.proxy.http
and then press the tab key, it will show you the options to complete the command.
If you've forgotten what you've set something to, you can use the "get" command, for example...
gsettings get org.gnome.system.proxy.http port
... will show you which port you have set for your proxy.
Now I know I have focused on proxy settings for this post, but this also works with many other system wide configurations.
However it seems lately Linux is leaning more and more towards "registry type" configurations. I have mixed feeling about this.
For example, in the "old days" (a couple of years ago ) I would normally put my proxy setting in either my bashrc or bash_profile.
If I wanted to make it global for all users, maybe I would put it in /etc/environment or /etc/profile .
This still works... for the "most" part. But not always. In Ubuntu, SusSE, Fedora, (I think Redhat 8.x also, but haven't checked)
You would use gsettings to do this.
To make switching easy, I went to the network settings, changed the proxy to manual and entered all my information for the proxy (host & port).
Then if I wanted to surf without proxy, I simply had to execute the following command:
gsettings set org.gnome.system.proxy mode 'none'
In order to switch back to the proxy connection I had to use the following command:
gsettings set org.gnome.system.proxy mode 'manual'
No need to specify host & port again, since those are already saved. If, however, you have to work with several proxies and would need to switch between different hosts, you can specify the proxy data with the following commands:
gsettings set org.gnome.system.proxy.http port 8080
gsettings set org.gnome.system.proxy.http host 172.16.1.1
Changes take effect immediately.
gsettings help is useful
gsettings list-schemas will show the default templates/frameworks. If you've used Java frameworks, this is similar.
gsettings has autofill help commands, for example if you type ...
gsettings set org.gnome.system.proxy.http
and then press the tab key, it will show you the options to complete the command.
If you've forgotten what you've set something to, you can use the "get" command, for example...
gsettings get org.gnome.system.proxy.http port
... will show you which port you have set for your proxy.
Now I know I have focused on proxy settings for this post, but this also works with many other system wide configurations.