Add Sudoers in Linux
The sudo privilege allows you to act with root privileges temporarily without becoming root. To use sudo, the user must be added to the sudoers file.
log in as root:
____ #su
____ #cd /etc
____ #nano sudoers
Under #User privilege specification add the user blow the root privilege:
____ <username> ALL=(ALL:ALL) ALL
____ Cntrl X to save and exit.
CMake
"What is CMake?"
As CMake would put it:
Welcome to CMake, the cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice.
CMake was created by Kitware in response to the need for a powerful, cross-platform build environment for open-source projects such as ITK and VTK. In addition to leading the development of this popular tool, Kitware also offers commercial consulting, support and training to help your organization effectively use CMake and the entire Kitware quality software process.
GSS CMake
Greensea uses the gss_cmake package to maintain a standard use of cmake. The following page will outline the steps necessary to setup and use gss_cmake. GSS CMake
CMake Boost Example
1: 2: 3: 4: 5: |
find_package( Boost 1.52.0 COMPONENTS date_time filesystem system ) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) target_link_libraries(${project_name} ${Boost_LIBRARIES}) endif() |
How Do I Compress a File?
To compress an entire directory software enter the command with your tar file name as follows:
$ tar cjvf software.tar.bz2 software
Un-compressing files:
Regardless of the file extension, the command is the same. For example: To un-compress a file titled software.tar.gz (note the extensions):
$ tar zxvf software.tar.gz
To un-compress a file titled software.tar.bz2 (note the extensions):
$ tar jxvf software.tar.gz
Un-Compress a Tar File
Regardless of the file extension, the command is the same to un-compress a tar file. For example: To un-compress a file titled software.tar.gz (note the extensions):
$ tar zxvf software.tar.gz
To un-compress a file titled software.tar.bz2 (note the extensions):
$ tar jxvf software.tar.gz
Useful Linux Commands
The Linux command line uses a multitude of keyboard commands at the prompt. Common commands used are 'ls', 'pwd', 'cp' and 'mv'. This section will cover the basic information for these commands. A detailed description can be viewed on the Linux 'man page' To find more details about a Linux command type the man command followed by the command you wish to use on the command line.
For example entering:
man ls
Will give you the man page for the 'ls' command.
Command |
Action |
Example |
ls |
The list command. This command will list the items in the current working directory or a specified directory. |
ls/home -this will list the contents of your home directory |
cd |
This command will move you from directory to directory. |
cd -This command by itself will bring you to your home directory. To move up a directory,use cd .. and for a specific directory add its name as an argument: cd MyDirectory |
pwd |
Print Working Directory. This command prints to the console screen the name of the directory the user is currently in. |
pwd -This command can be used as is without any arguments |
cp |
The copy command. This command copies files or directories. |
cp myfile.txt MyDirectory-This example makes a copy of myfile and places it in MyDirectory |
mv |
The move command. This command is used to either RENAME a file, or to move a file to a new directory. |
mv oldfile newfile – This example will rename oldfile to the name newfile mv oldfile MyDirectory -This command relocates oldfile to MyDirectory and preserves the filename. |
mkdir |
The make directory command will make a directory. |
mkdir My Directory -This example makes a directory (folder) called MyDirectory in the current working directory. |
scp |
The secure copy command. |
scp myfile /path/to/dir makes a secure copy of myfile in the dir path specified. |
Take Ownership of a Port on a Linux Machine
With a Linux machine, you need root or sudo privileges.
Open a command line and cd to the /dev folder. In here are a whole bunch of ttyxx ports. You can take ownership of all of them, if need be, by using the command:
$sudo chown <user> tty*
or select a specific port instead of using the *. You will have to take ownership again if you close the port.