Sysvinit Command | Systemd Command | Notes |
---|---|---|
service frobozz start | systemctl start frobozz | Used to start a service (not reboot persistent) |
service frobozz stop | systemctl stop frobozz | Used to stop a service (not reboot persistent) |
service frobozz restart | systemctl restart frobozz | Used to stop and then start a service |
service frobozz reload | systemctl reload frobozz | When supported, reloads the config file without interrupting pending operations. |
service frobozz condrestart | systemctl condrestart frobozz | Restarts if the service is already running. |
service frobozz status | systemctl status frobozz | Tells whether a service is currently running. |
ls /etc/rc.d/init.d/ | systemctl (or) systemctl list-unit-files --type=service (or) ls /lib/systemd/system/.service /etc/systemd/system/.service | Used to list the services that can be started or stopped. Used to list all the services and other units. |
chkconfig frobozz on | syst |
This file contains 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
obj-m += test_module.o | |
all: | |
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules | |
clean: | |
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean |
This file contains 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 | |
echo -e "\e[34m青い \e[31m赤い \e[32m緑 \e[93m黄色い \e[35m紫 \e[95mピンク \e[30m黒い \e[97m白い \e[33mオレンギ" |
This file contains 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 | |
set -e | |
# Usage: | |
# rsync_parallel.sh [--parallel=N] [rsync args...] | |
# | |
# Options: | |
# --parallel=N Use N parallel processes for transfer. Defaults to 10. | |
# | |
# Notes: |
This file contains 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
[16:25:27] root@na:~ # echo "A"|xxd -b | |
0000000: 01000001 00001010 A. | |
[16:25:30] root@na:~ # echo "A"|perl -e '$byte=shift(@ARGV);$bit=shift(@ARGV);undef $/; $in=<>; substr($in,$byte,1) = substr($in,$byte,1) ^ chr(1<<$bit); print $in' 0 1|xxd -b | |
0000000: 01000011 00001010 C. |
This file contains 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
Source material: | |
http://security.stackexchange.com/questions/24444/what-is-the-most-hardened-set-of-options-for-gcc-compiling-c-c | |
https://wiki.gentoo.org/wiki/Hardened_Gentoo | |
https://wiki.debian.org/Hardening | |
================================================================================================================> | |
GCC Security related flags and options: | |
CFLAGS="-fPIE -fstack-protector-all -D_FORTIFY_SOURCE=2" | |
LDFLAGS="-Wl,-z,now -Wl,-z,relro" |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
extern char** environ; | |
int main(int argc, char *argv[], char *envp[]) | |
{ | |
int i; | |
setenv("TESTVAR", "watvalue123", 1); | |
printf("From char *envp[]:\n"); |
This file contains 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
#include <stdio.h> | |
#include <limits.h> | |
int main() { | |
unsigned long long ulli; | |
printf("%d", sizeof(ulli)); | |
printf("%llu\n", ULLONG_MAX); | |
printf("%llu ... or \n", ~(unsigned long long)0); | |
printf("%llu\n", (unsigned long long)0 - 1); | |
return 0; |
This file contains 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 | |
DEBUGFS=`grep debugfs /proc/mounts | awk '{ print $2; }'` | |
echo $$ > $DEBUGFS/tracing/set_ftrace_pid | |
echo function > $DEBUGFS/tracing/current_tracer | |
echo 1 > $DEBUGFS/tracing/tracing_on | |
exec $* | |
echo 0 > $DEBUGFS/tracing/tracing_on |
OlderNewer