Uncommenting %wheel NOPASSWD in /etc/sudoers
Remove a line from a file
solution:
Insert text into a file at a specific line
solution:
sed -i -e '26i\ ' /etc/named.conf
sed -i -e '27i\ \ \ \ \ \ \ \ managed-keys-directory\ \"\/var\/named\/dynamic\";' /etc/named.conf
sudo sed -i -e 's/^#\s*\(%wheel\s\+ALL=(ALL)\s\+NOPASSWD:\s\+ALL\)/\1/' /etc/sudoers
Remove a line from a file
solution:
sed -i -e '/IPADDR/d' /etc/sysconfig/network-scripts/ifcfg-eth6
issue:
I was moving an interface from a Physical NIC (eth6) to a Bridge (brbkup) therefore, I obviously no longer wanted an eth6 IPADDR entry.
Insert text into a file at a specific line
solution:
sed -i -e '26i\ ' /etc/named.conf
sed -i -e '27i\ \ \ \ \ \ \ \ managed-keys-directory\ \"\/var\/named\/dynamic\";' /etc/named.conf
issue:
I needed to add a directive into my /etc/named.conf file. It could not simply be appended and YES, my proposed solution makes quite a few assumptions... most importantly that the location I want my new line is indeed line 26.
Before:
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
};
After:
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
Note: This is kind of a big deal for me. I don't really know why I feel a sense of accomplishment, but I am pretty stoked about this discovery.
Note: This is kind of a big deal for me. I don't really know why I feel a sense of accomplishment, but I am pretty stoked about this discovery.
Comments
Post a Comment