# yum install imagemagickUbuntu/Debian
# apt-get install imagemagick
init=/bin/bashas illustrated on the screen-shot below:
$ uptime 09:43:17 up 247 days, 8:15, 1 user, load average: 0.21, 0.35, 0.37Uptime displays information relating to the number of days your system is up and running as well as an average system load. The same data as well as mo information regarding memory usage and processes can by obtained with top command.
$ vmstat procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 0 0 0 194760 176896 855416 0 0 12 78 2 0 7 2 83 1vmstat also accepts arguments.
$ vmstat 10 3 procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 0 0 0 187528 177472 855836 0 0 12 78 2 0 7 2 83 1 0 0 0 203996 177532 855848 0 0 0 107 126 208 4 2 89 1 0 0 0 194108 177540 855856 0 0 0 3 102 166 2 1 96 0Read more...
$ tar xvzf MasterPDFEditor-< version >.x86_64.tar.gzMove all binaries and support files to opt directory:
$ sudo cp -r MasterPDFEditor /opt/Create executable script within your $PATH:
$ sudo bash -c 'echo "/opt/MasterPDFEditor/master-pdf-editor" > ' $ sudo chmod +x /usr/local/bin/masterpdfeditorRead more...
Very often you may develop or host online project with a private information sitting on your filesystem available only for authorized access only. Simple way to disable direct file download for know URLs is to use .htaccess file. Within your DocumentRoot create a directory to contain your data:
# mkdir data # cd data
Move your data across to this new directory and create a .htaccess file with the following content:
<FilesMatch ".*"> Order Allow,Deny Deny from All </FilesMatch>Read more...
How do I find and replace all string occurrences within entire text file using vim editor?
Answer Vi editor is based on ex the original ex editor written back in 1976. One of the features inherited from this editor is a way simply search and replace any string withing either single line, first occurrences or in entire text. Here are few examples: Replace a first occurrence of word vim for the word vi on the current line.
Substitute first occurrence on each line of the word vim for the word vi
Lastly, substitute every occurrence of the word vim for the word vim on all linesRead more...
How can I find all files and directories with write permission turned on? I need to perform a recursive search also for all subdirectories.
The best tool for this job is find command. Find command allows you to search files and directories based on their permissions and various other factors. For example to find files and directories which have writable permissions turned on for user, group and other use the following command:
$ find /bin/ -perm /222
The above will recursively search entire /bin/ directory. If for instance we need to search only for a files which have writable permissions turned on only for others we modify our find command as follows:
$ find /bin/ -perm /002Read more...
getenforcecommand. This command without any options or arguments will simply print a current status SELinux operational mode.
# getenforce Permissive
Furthermore, the current status of SELinux operational mode can be set permanently or temporarily. The above
getenforce command only show current status however to see whether the status was set temporarily by
setenforce or by SELinux configuration file
cat /etc/selinux/config the
sestatus command should be used.
# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 29Read more...
setenforceor directly by editing SELinux configuration file.
disabled operational mode does not enforce any security rules or policies as it is simply disable and security checks are done only by traditional Discretionary Access Controls.
Permissive mode allows for testing new deployments as in effect it simply behaves like
disabled operational mode, however it logs any potentially denied access to a relevant log files thus allowing further testing and troubleshooting before the operational mode is switched to
enforcing. Lastly, the
enforcing mode all security policy rules a enforced. To change SELinux operaitonal mode from enforcing to permissive and vice versa use
setenforce command. Check current operational mode status:
# getenforce PermissiveRead more...
There may be a time that you wish to clear a Memory on your server. Normally you do not want to fiddle with it so do it only you are sure that it is necessary and that it would not affect your server's performance. For this we can use sysctl command which allows linux admins to configure kernel parameters at runtime.
This command will clear pagecache:
To clear dentries and inodes you can use:
To free memory of the all above use a following command:
What the above commands will do is that they will sync your memory and edit a following file with appropriate number entry. :
Do not edit this file directly !Read more...