NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

make.txt

make VERBOSE=1


gedit.txt

ctrl+w close tab
ctrl+N tab number


cmake.txt

*Commands
cmake_minimum_required(VERSION major.minor[.patch[.tweak]] [FATAL_ERROR])
project(<PROJECT-NAME> [LANGUAGES] [<language-name>...]) // outputs: PROJECT_NAME, PROJECT_SOURCE_DIR,
// <PROJECT-NAME>_SOURCE_DIR, PROJECT_BINARY_DIR
// <PROJECT-NAME>_BINARY_DIR
message([<mode>] "message to display" ...) // message(status "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR})
set (OTHER_VAR "${MY_VAR} world!")
include(<file|module> [OPTIONAL] [RESULT_VARIABLE <VAR>][NO_POLICY_SCOPE])

add_compile_options(<option> ...)
add_definitions(-DFOO -DBAR ...) // outputs: COMPILE_DEFINITIONS
add_executable(<name> [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] source1 [source2 ...])
add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL])

include_directories([AFTER|BEFORE] [SYSTEM] dir1 [dir2 ...]) // outputs: INCLUDE_DIRECTORIES (append to)
find_file (<VAR> name1 [path1 path2 ...]) // paths: CMAKE_LIBRARY_PATH; outputs: <VAR>, <VAR>-NOTFOUND
find_package(<package> [version] [EXACT] [QUIET] [MODULE]
[REQUIRED] [[COMPONENTS] [components...]]) // paths: Find<package>.cmake in CMAKE_MODULE_PATH;
// outputs: <package>_FOUND
// <package>_VERSION
// FOO_INCLUDE_DIR, FOO_LIBRARY
// FOO_INCLUDE_DIRS, FOO_LIBRARIES
pkg_check_modules(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*) // checks for all the given modules
// <XPREFIX>_FOUND ... set to 1 if module(s) exist
// <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
// <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
// <XPREFIX>_LDFLAGS ... all required linker flags
// <XPREFIX>_LDFLAGS_OTHER ... all other linker flags
// <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
// <XPREFIX>_CFLAGS ... all required cflags
// <XPREFIX>_CFLAGS_OTHER ... the other compiler flags
find_path (<VAR> name1 [path1 path2 ...]) // Export include dirs to <VAR>
find_library (<VAR> name1 [path1 path2 ...]) // Export libraries (e.g. *.so) to <VAR>
file(GLOB <variable> [<globbing-expressions>...]) // List files into <variable>
file(GLOB_RECURSE <variable> [FOLLOW_SYMLINKS] [<globbing-expressions>...])



target_compile_definitions(<target> <INTERFACE|PUBLIC|PRIVATE> [items1...])
target_compile_features(<target> <PRIVATE|PUBLIC|INTERFACE> <feature> [...])
target_compile_options(<target> [BEFORE] <INTERFACE|PUBLIC|PRIVATE> [items1...])
target_include_directories(<target> [SYSTEM] [BEFORE] <INTERFACE|PUBLIC|PRIVATE> [items1...])
target_sources(<target> <INTERFACE|PUBLIC|PRIVATE> [items1...])
target_link_libraries(<target> [item1 [item2 [...]]] [[debug|optimized|general] <item>] ...)



* Variables
CMAKE_SOURCE_DIR
CMAKE_CURRENT_SOURCE_DIR
CMAKE_MODULE_PATH
PROJECT_NAME
CMAKE_INCLUDE_PATH
CMAKE_LIBRARY_PATH
CMAKE_PREFIX_PATH
UNIX / WIN32 / CYGWIN
CMAKE_COMPILER_IS_GNUCC
CMAKE_COMPILER_IS_GNUCXX
CMAKE_BUILD_TYPE
CMAKE_C_FLAGS / CMAKE_C_FLAGS_DEBUG / CMAKE_C_FLAGS_RELEASE
CMAKE_CXX_FLAGS / CMAKE_CXX_FLAGS_DEBUG / CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_COMPILER
COMPILE_DEFINITIONS

*Control commands
foreach(loop_var IN [LISTS [list1 [...]]] [ITEMS [item1 [...]]])
endforeach(loop_var)

if(expression)
elseif(expression2)
else(expression)
endif(expression)
if(<variable>)
if(NOT <variable>)
if(<expr1> AND <expr2>)
if(<variable|string> EQUAL <variable|string>)
if(<variable|string> STREQUAL <variable|string>)

while(condition)
endwhile(condition)

*Examples

Find<package>.cmake file located within your project. Something like this:

CMakeLists.txt
cmake/FindFoo.cmake
cmake/FindBoo.cmake

CMakeLists.txt content:

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(Foo REQUIRED) # FOO_INCLUDE_DIR, FOO_LIBRARIES
find_package(Boo REQUIRED) # BOO_INCLUDE_DIR, BOO_LIBRARIES

include_directories("${FOO_INCLUDE_DIR}")
include_directories("${BOO_INCLUDE_DIR}")
add_executable(Bar Bar.hpp Bar.cpp)
target_link_libraries(Bar ${FOO_LIBRARIES} ${BOO_LIBRARIES})


*Ref: https://cmake.org





common_cmd.txt

1) Get installed packages
List installed packages: dbkg -l
You can get the list of files installed with a package with e.g. dpkg -L gcc-arm-linux-gnueabi

2) Show package information
The simplest way to see the description of a package:

% apt-cache show postgresql
% apt-cache show iproute

3) Show package information
For packages that are in your repositories you can use:

dpkg --print-avail PACKAGE_NAME

or

apt-cache show PACKAGE_NAME

or

aptitude show PACKAGE_NAME

4) Search
grep "<pattern>" <location>
option:
-i (ignore case),
-v (find not content pattern),
-n (show line number)
-r (search in folder)
pattern can be regex
can use together with find <path> to search in file name

5) Process handle
Back Ground run: $<Program Name> &
List of background: $bg
Bring back to foreground: $fg
List process: $ps
Others: jobs
Dynamic list of process: $top
Kill process: $kill [-9] <PID>

6) Short key
Moving between tabs (Gedit): Ctrl+Alt+PgUp/PgDn
Moving between tabs (WebBrowser): Shift+Tab
Navigate to address bar: Alt+D
Close tab (Web Browser): Ctrl+W

7) OS information
cat /proc/sys/kernel/osrelease
uname -r
uname -a

8) Shortcut
sudo ln -s full_path_to_opt/LightTable/deploy/LightTable /usr/local/bin
sudo ln -s full_path_to_opt/LightTable/deploy/LightTable /usr/local/bin/lighttable

9) Create Laucher for Ubuntu
a) Press Ctrl+Alt+T on your keyboard to open terminal. When it opens, run below commands to install required package:

sudo apt-get install gnome-panel --no-install-recommends

b) Bring up the ‘Create Launcher’ dialog via below command:

sudo gnome-desktop-item-edit /usr/share/applications/ --create-new

Type in:

Name: Light Table
command: /opt/LightTable/LightTable
choose icon from /opt/LightTable/core/img/lticon.png
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.