Tag Info

New answers tagged

0

Files under /usr are meant to be under the control of the package manager (except for files under /usr/local). Configuration files that the system administrator may modify live in /etc. This is part of the traditional unix directory structure and codified for Linux in the Filesystem Hierarchy Standard. The recommendation in the Arch Wiki to edit files under ...


0

Since you can't guarantee that an SSH connection (being TCP) will remain alive once one end stops sending ACKs to received packets, I personally use http://www.harding.motd.ca/autossh/ to restart all my SSH connections almost as soon as I unsuspend. Since GNU Screen will be in use on the server side, re-attaching gets me to where I was before. You can have ...


2

I'll answer that in a more general way - looking a bit at the whole "Unix learning experience". In your example you use two tools, and see the language is similar. It just unclear when to use what exactly. Of course you can expect there is a clear structure, so you ask us to explain that. The case with the space around = is only and example - there are ...


3

Some programs offer a check of the configuration file, for example: postfix check Otherwise you could get the original config files from the repositories and compare them with diff to the current.


4

.bashrc is nothing more than a config file for bash, just like my.cnf, php.ini, httpd.conf or a launchd plist. Each has their own syntax, ranging from the no-space assignment of bash to the XML tag soup of launchd (there's also a binary version :-O ) There are no firm conventions, and you have already discovered the Prime Directive of Unix: Read The Fine ...


2

The spaces around = sign is always problem when you do an assignment in bash. There is no exception here, you must remove all spaces around = if you want to get a valid simple assignment (no expansion, no arithmetic, no array assignment)in bash. For config file, because each software has its own parser to parsing its config file, bash has no relationship. ...


18

Bash will interpret a line that has text followed by a = as an assignment to a variable, but it will interpret a line that has text followed by a space as a command with an argument. var=assignment vs command =argument Bash scripts work on the principle that everything in the script is as if you have typed it into the command line. In configuration files ...


0

I would say that when you use a bash command that means attribute a value to something, the sign = means assigment and you need to remove spaces around or it will attribute the space also. While in a config file where = is to seperate a key from a value, you can or not put a space without problem and it will not take any special meaning.


1

I wrote a small python script that takes care of this problem. The logic looks at each line in the file package.accept_keywords and only acts on lines that start with = or <=. These lines have a maximum bound version so we can check if they are needed anymore. Lines without a qualifier or a >= are left as-is as we cannot know if they are obsolete. ...


3

One of the things to look out for when cloning Linux systems is udev's persistent network device naming rules. udev may create and update the file /etc/udev/rules.d/70-persistent-net.rules to map MAC addresses to interface names. It does this with the script /lib/udev/write_net_rules. Each MAC address (with some exceptions; see ...


2

Building on @mark-plotnick 's remark: The new hardware has a different mac address. The old mac address is still hard coded in /etc/udev/rules.d/70-persistent-net.rules. You could simply rename this file. In that case rebooting will recreate the file with the new mac address.


1

Set up sudo to preserve the HOME environment variable. Run visudo to edit the sudo configuration. Make sure that the option always_set_home is not set, and that HOME is present in the env_keep list. Add the following lines: Defaults !always_set_home Defaults env_keep+="HOME" Remove a line like Defaults always_set_home if there is one.


2

Use sudo -E to preserve your environment: $ export FOO=1 $ sudo -E env | grep FOO FOO=1 That will preserve $HOME and any other environment variables you had, so the same configuration files you started with will be accessed by the programs running as root. You can update sudoers to disable the env_reset setting, which clears out all environment variables ...


7

You can using fstab module. Its documentation here. Example: fstab = Fstab() for entry in fstab.entries: pprint.pprint(entry)


4

This will not work because /etc/fstab file doesn't conform to the format the ConfigParser supports. As man 5 fstab indicates, the /etc/fstab file is a whitespace separated file with 6 columns. The Python ConfigParser is a library for Parsing files commonly known as .ini files that, simplified, consist of sections that contain key/value pairs: ...


1

If you already use firewall software that fulfils its purpose and that you know how to use, but lacks this facility, I suggest you stick with it. The switch from, or addition to, an application using a single configuration file to a directory whose file contents are taken combined to be the configuration, is often made because of package maintainability. ...


2

In /etc/default/grub I changed this: GRUB_CMDLINE_LINUX_DEFAULT="text nomodeset acpi_backlight=legacy" to: GRUB_CMDLINE_LINUX_DEFAULT="text nomodeset" update-grub, reboot, and start mdm by hand: /etc/init.d/mdm start No idea why the backlight should suddenly break.


0

Start with eix -tT. Install app-portage/eix to get that.


2

This task is an example of "configuration management". As you might expect, many other people have also had the same questions as you. The general class of software that performs this function is called configuration management software. Some popular examples are: Chef Puppet SaltStack


0

I haven't looked in detail. The defconfig file was last editer 4 years ago; it's quite possible that some options have changed in the kernel source and nobody bothered to update this particular file. Try looking in the kernel logs to see if these options have disappeared. Compare with other msm*_defconfig, which have been updated more recently. The readme ...


0

Add these lines to your .vimrc: let s:hidden_all = 0 function! ToggleHiddenAll() if s:hidden_all == 0 let s:hidden_all = 1 set noshowmode set noruler set laststatus=0 set noshowcmd else let s:hidden_all = 0 set showmode set ruler set laststatus=2 set showcmd endif ...


2

I would recommend using augtool from augeas. Puppet and other configuration management tools integrate with augeas and allow you the safe and syntactically correct way to manipulate configuration files. Augeas is a tool to transfer configuration files into a tree, which you can query and modify. It ensures that the modification are syntactically correct ...


3

Take a backup as, cp /etc/nsswitch.conf /etc/nsswitch.conf.orignal Now you can use sed -i or open /etc/nsswitch.conf with some editor like vim and do the changes. If error occurs, you can revert back to the original version, cp /etc/nsswitch.conf.original /etc/nsswitch.conf I got this tool suggestion by Ulrich in the chat which is used for editing the ...


0

You may change "this host email name" (used in Received headers) defining confDOMAIN_NAME. https://www.sendmail.com/sm/open_source/docs/m4/whoami.html By default sendmail's masquerading changes only header sender (e.g. From: header). It may be configured to change envelope sender (MAIL FROM: in SMTP session) and/or header recipients (e.g. To: and Cc: ...



Top 50 recent answers are included