%sudo ALL=(ALL) ALL
#includedir /etc/sudoers.d
The first one allows all users from sudo group to do everything they want and the second one demonstrates a way to create a flexible sudo configuration.
%sudo ALL=(ALL) ALL
#includedir /etc/sudoers.d
#!/bin/sh
### BEGIN INIT INFO
# Provides: haltIfNousers
# Required-Start:
# Required-Stop:
# Should-Start: gdm
# Default-Start: 2 3
# Default-Stop: 4 5
# Short-Description: Execute the halt command.
# Description:
### END INIT INFO
#Powers off the system if no user is logged in in 30 seconds
BLOCK_FILE=/tmp/haltIfNousers
case "$1" in
start)
$0 wait &
;;
wait)
touch "$BLOCK_FILE"
sleep 30
[ -e "$BLOCK_FILE" ] || exit 0
if ! who|grep '.*' -q ; then
echo $0: No users are logged in. Halting now.
shutdown -h now
exit 0
fi
rm -f "$BLOCK_FILE"
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
rm -f "$BLOCK_FILE"
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
echo base_path/{subfolder1,subfolder2} | xargs -n 1 make clean -C
%_topdir .../rpm #Arbitrary
%_tmppath /tmp/rpm #Optional
#!/bin/sh
for d in _topdir _sourcedir _rpmdir _srcrpmdir _specdir _builddir _tmppath; do
mkdir -p `rpm --eval %{$d}`
done
# Doesn't override previously set value. See Parameter Expansion
SOURCES=${SOURCES:-`rpm --eval %{_sourcedir}`}
#Assumes your sources are in $PROJECTS/$PROJECT directory
tar --wildcards --exclude \*\.svn\* --exclude \*\~ \ -C "$PROJECTS" -zcf "$SOURCES/$PROJECT.tar.gz" $PROJECT
rpmbuild -ba "$PROJECTS/$PROJECT/$PROJECT.spec"
cp -i aaa/bbb/ccc/ddd/xxxx_{6,7}.tpl
cp -i aaa/bbb/ccc/ddd/xxxx_6.tpl aaa/bbb/ccc/ddd/xxxx_7.tpl
> ls
aaa/bbb/ccc/ddd/xxxx_4.tpl
aaa/bbb/ccc/ddd/xxxx_5.tpl
aaa/bbb/ccc/ddd/xxxx_6.tpl
> cp -i aaa/bbb/ccc/ddd/xxxx_{6,7}.tpl
> ls
aaa/bbb/ccc/ddd/xxxx_4.tpl
aaa/bbb/ccc/ddd/xxxx_5.tpl
aaa/bbb/ccc/ddd/xxxx_6.tpl
aaa/bbb/ccc/ddd/xxxx_7.tpl
cp filename{,_`date '+%F'`}
/**
* @brief Accumulate values in a range.
*
* Accumulates the values in the range [first,last) using operator+(). The
* initial value is @a init. The values are processed in order.
*
* @param first Start of range.
* @param last End of range.
* @param init Starting value to add other values to.
* @return The final sum.
*/
template
inline _Tp
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
{
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_requires_valid_range(__first, __last);
for (; __first != __last; ++__first)
__init = __init + *__first;
return __init;
}
//test.c
#include <stdio.h>
struct Temp0{};
struct Temp1{char a;};
int main() {
printf("Temp0 size: %d\n", sizeof(struct Temp0));
printf("Temp1 size: %d\n", sizeof(struct Temp1));
return 0;
}
$ gcc test.c -o test && ./test
Temp0 size: 0
Temp1 size: 1
$ g++ test.c -o test && ./test
Temp0 size: 1
Temp1 size: 1