On opening the /var/log/messages in vim , if logs are not presented in color , then executing the below command to add color
set filetype=messages
On opening the /var/log/messages in vim , if logs are not presented in color , then executing the below command to add color
set filetype=messages
There is a discussion thread on reddit about the flags being used for c code compilation, https://www.reddit.com/r/C_Programming/comments/ievcev/what_is_the_most_effective_set_of_gcc_warning/
CFLAGS += -std=c99 -Wpedantic -pedantic-errors
CFLAGS += -Werror
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Waggregate-return
CFLAGS += -Wbad-function-cast
CFLAGS += -Wcast-align
CFLAGS += -Wcast-qual
CFLAGS += -Wdeclaration-after-statement
CFLAGS += -Wfloat-equal
CFLAGS += -Wformat=2
CFLAGS += -Wlogical-op
CFLAGS += -Wmissing-declarations
CFLAGS += -Wmissing-include-dirs
CFLAGS += -Wmissing-prototypes
CFLAGS += -Wnested-externs
CFLAGS += -Wpointer-arith
CFLAGS += -Wredundant-decls
CFLAGS += -Wsequence-point
CFLAGS += -Wshadow
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wswitch
CFLAGS += -Wundef
CFLAGS += -Wunreachable-code
CFLAGS += -Wunused-but-set-parameter
CFLAGS += -Wwrite-strings
To get details of the each flag use "$ man gcc"
The info for each flag given in man page is as below
Issue all the warnings demanded by strict ISO C and ISO C++; reject all programs that use forbidden extensions, and some other programs that do not follow ISO C and ISO C++. For ISO C, follows the version of the ISO C standard specified by any -std option used. Valid ISO C and ISO C++ programs should compile properly with or without this option (though a rare few require -ansi or a -std option specifying the required version of ISO C). However, without this option, certain GNU extensions and traditional C and C++ features are supported as well. With this option, they are rejected.-Wall turns on the following warning flags: -Waddress -Warray-bounds=1 (only with -O2) -Wbool-compare -Wbool-operation -Wc++11-compat -Wc++14-compat -Wcatch-value (C++ and Objective-C++ only) -Wchar-subscripts -Wcomment -Wduplicate-decl-specifier (C and Objective-C only) -Wenum-compare (in C/ObjC; this is on by default in C++) -Wformat -Wint-in-bool-context -Wimplicit (C and Objective-C only) -Wimplicit-int (C and Objective-C only) -Wimplicit-function-declaration (C and Objective-C only) -Winit-self (only for C++) -Wlogical-not-parentheses -Wmain (only for C/ObjC and unless -ffreestanding) -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args -Wmisleading-indentation (only for C/C++) -Wmissing-attributes -Wmissing-braces(only for C/ObjC) -Wmultistatement-macros -Wnarrowing (only for C++) -Wnonnull -Wnonnull-compare -Wopenmp-simd -Wparentheses -Wpessimizing-move (only for C++) -Wpointer-sign -Wreorder -Wrestrict -Wreturn-type -Wsequence-point -Wsign-compare (only in C++) -Wsizeof-pointer-div -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtautological-compare -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wvolatile-register-var-Wclobbered -Wcast-function-type -Wdeprecated-copy (C++ only) -Wempty-body -Wignored-qualifiers -Wimplicit-fallthrough=3 -Wmissing-field-initializers -Wmissing-parameter-type (C only) -Wold-style-declaration (C only) -Woverride-init -Wsign-compare (C only) -Wredundant-move (only for C++) -Wtype-limits -Wuninitialized -Wshift-negative-value (in C++03 and in C99 and newer) -Wunused-parameter (only with -Wunused or -Wall) -Wunused-but-set-parameter (only with -Wunused or -Wall)
Warn if any functions that return structures or unions are defined or called. (In languages where you can return an array, this also elicits a warning.)
Warn when a function call is cast to a non-matching type. For example, warn if a call to a function returning an integer type is cast to a pointer type.
Warn whenever a pointer is cast such that the required alignment of the target is increased. For example, warn if a "char *" is cast to an "int *" on machines where integers can only be accessed at two- or four-byte boundaries.Warn whenever a pointer is cast so as to remove a type qualifier from the target type. For example, warn if a "const char *" is cast to an ordinary "char *". Warn if floating-point values are used in equality comparisons. Enable -Wformat plus additional format checks. Currently equivalent to -Wformat -Wformat-nonliteral -Wformat-security -Wformat-y2k. Warn about suspicious uses of logical operators in expressions. This includes using logical operators in contexts where a bit-wise operator is likely to be expected.
Warn if a global function is defined without a previous declaration. Do so even if the definition itself provides a prototype. Use this option to detect global functions that are not declared in header files.
Warn if a user-supplied include directory does not exist.
Warn if a global function is defined without a previous prototype declaration. This warning is issued even if the definition itself provides a prototype. Use this option to detect global functions that do not have a matching prototype declaration in a header file. This option is not valid for C++ because all function declarations provide prototypes and a non-matching declaration declares an overload rather than conflict with an earlier declaration. Use -Wmissing-declarations to detect missing declarations in C++.
Warn if an "extern" declaration is encountered within a function.
Warn if an "extern" declaration is encountered within a function.
Warn about anything that depends on the "size of" a function type or of "void". GNU C assigns these types a size of 1, for convenience in calculations with "void *" pointers and pointers to functions. In C++, warn also when an arithmetic operation involves "NULL". This warning is also enabled by -Wpedantic.
Warn if anything is declared more than once in the same scope, even in cases where multiple declaration is valid and changes nothing.
Warn about code that may have undefined semantics because of violations of sequence point rules in the C and C++ standards.
Warn whenever a local variable or type declaration shadows another variable, parameter, type, class member (in C++), or instance variable (in Objective-C) or whenever a built-in function is shadowed. Note that in C++, the compiler warns if a local variable shadows an explicit typedef, but not if it shadows a struct/class/enum. Same as -Wshadow=global.
Warn if a function is declared or defined without specifying the argument types. (An old-style function definition is permitted without a warning if preceded by a declaration that specifies the argument types.)
Warn if an undefined identifier is evaluated in an "#if" directive. Such identifiers are replaced with zero.
Pasting it here for to avoid searching for the same content ,
From <https://stackoverflow.com/questions/9637601/open-cygwin-at-a-specific-folder>
When you install Cygwin (or if you’ve already installed it, download it again and start setup again to run an update), make sure that you select the chere package under the "Shells" category. After Cygwin is launched, open up a Cygwin terminal (as an administrator) and type the command: chere -i -t mintty -s bash. Now you should have "Bash Prompt Here" in the Windows right-click context menu. (mintty is Cygwin's default terminal. If you don't choose it with the -t option, your "Bash Prompt Here" will use the same terminal as the Windows Command Prompt, which prevents horizontal resizing.)
On busy box where the "top" and "ps" command is built with basic feature it may not provide nice details of the process.
The below code can be used for getting the nice value of the a given process .
cat /proc/4013/stat | awk '{print "priority " $18 " nice " $19}'
In the above command "4013" is the process id and stat file will have various details about the process.
The details of the stat is available in "https://man7.org/linux/man-pages/man5/proc.5.html" under the section "/proc/[pid]/stat"
The command to list local branch on git is
$ git branch
The command to delete local branch on git is
$ git branch -d <branch_name>
For remote branch deletion
chere -i -t mintty -s bash