This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
PATTERN="$ a\ | |
$(whoami) ALL=\(ALL\) NOPASSWD: /sbin/shutdown, /sbin/reboot | |
" | |
# Edit /etc/sudoers to allow current user to shutdown and reboot without password | |
# Your previous sudoers file will be backed as /etc/sudoers.bak | |
sed -i.bak -e "$PATTERN" /etc/sudoers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
USERS=($(cat /etc/passwd | grep /home/ | grep -v /bin/false | cut -d : -f 1)) | |
ALIAS=$(printf ",%s" "${USERS[@]}") | |
PATTERN="$ a\ | |
${ALIAS:1} ALL=\(ALL\) NOPASSWD: /sbin/shutdown, /sbin/reboot | |
" | |
# Edit /etc/sudoers to allow all physical users to shutdown and reboot without password | |
# Your previous sudoers file will be backed as /etc/sudoers.bak | |
sudo sed -i.bak -e "$PATTERN" /etc/sudoers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Edit /etc/sudoers to allow all users to shutdown and reboot without password | |
# Your previous sudoers file will be backed as /etc/sudoers.bak | |
sudo sed -i.bak -e '$ a\ | |
ALL ALL=\(ALL\) NOPASSWD: /sbin/shutdown, sbin/reboot | |
' /etc/sudoers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var abbr = 'ul>li*3>h2+p*2'; | |
try | |
{ | |
// expands abbreviation and inject results into 'my-element' | |
$('my-element').expandAbbreviation(abbr); | |
// returns an Elements object | |
var elements = ZenCoding.abbrToElements(abbr); | |
// expands abbreviation to an html string | |
var my_string = String.expandAbbreviation(abbr); | |
} |
NewerOlder