Main Page: Difference between revisions

From Newroco Tech Docs
Jump to navigationJump to search
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Welcome==
Welcome to the Docs Wiki hosted by [https://newro.co newroco]
Welcome to the Docs Wiki hosted by [https://newro.co newroco]


Please use the [[newroco docs wiki style guide]] when formatting pages. The style guide also contains basic tips on wiki markup. You can get more help on using wikis from the [//meta.wikimedia.org/wiki/Help:Contents User's Guide].
Please use the [[newroco docs wiki style guide]] when formatting pages. The style guide also contains basic tips on wiki markup. You can get more help on using wikis from the [//meta.wikimedia.org/wiki/Help:Contents User's Guide].


NB Some instructions documented on this server will reference sudo or visudo; while these are normally available as part of default installs, some server build templates for hosted servers may not include them, and if so they can be installed as a root user by:
==How-to pages==
 
<pre>apt-get install sudo</pre>
 
==Current topics==
[[Virtualisation]]
 
[[DatabaseBackupProcedure]]
 
[[SSHKeyAuth]]
 
[[SSH from Windows]]
 
[[SSH for multiple server management]]
 
[[Puppet]]
 
[[Creating a simple mail server]]
 
[[Nextcloud]]
 
[[Spreed.me]]
 
[[Joomla]]
 
[[PostgreSQL]]
 
[[Port forwarding]]
 
==Popular commands==
Some useful and therefore popular commands follow, with some commonly used options. Not a definitive list of either commands or options, but can refer to the individual command help files for other options by either adding a <pre>--help</pre> or using their manual <pre>man <command></pre> or info page <pre>info <command></pre>. Not all commands provide all (or any) type of additional documentation, and man/info commands and data in themselves need to be installed.
===ls===
This command lists the content of the current working directory or a specified directory, with various output options
<pre>ls -l</pre> Returns the long form of the directory, useful for seeing whether files are shortcuts or when they were last changed
<pre>ls -lh</pre> As above but returns file sizes in "h"uman readable format (kB, MB etc.)
<pre>ls -a</pre> Shows hidden files (ones whose name starts with a "."). Can be combined with other switches above.
===df===
This shows how much "d"iskspace is "f"ree.
<pre>df -h</pre> returns the info in "h"uman readable format
<pre>df -i</pre> shows available inodes (index pointers) - can be useful when disk acts as if full but df -h shows space available
===du===
This command is like df but for directories.
<pre>du -hs *</pre> probably the most common use. Returns the total space used by each subdirectory of the current working directory, useful for working out what's eating your disk space
===ssh===
For securely accessing remote servers
<pre> ssh <username>@<server></pre> most common usage form. Some servers or firewalls may use a non-standard port number, in which case use -p<portnumber> (no space) after the ssh part. For more see:
*[[SSHKeyAuth]]
*[[SSH_for_multiple_server_management]]
 
===tar===
To create a tar.gz archive
<pre>tar -czf new-tar-file-name.tar.gz file-or-folder-to-archive</pre>
To extract from a tar archive
<pre>tar -xzf tar-file-name.tar.gz</pre>
 
 
===grep===
This is a powerful way to find stuff in files, particularly useful for tracking stuff down in logs, or in complex multi-aprt configuration files
<pre>grep -i <thething> <thefileorpathwithwildcards></pre>
Finds all references, case "i"nsensitively, to the <thething> and returns them in a list within the line that contains them and the filename when searching multiple files
<pre>grep -iv <thething> <thefileorpathwithwildcards></pre>
As above but in"v"erted, i.e. returns all lines that don't contain <thething>
<pre>grep -ic <thething> <thefileorpathwithwildcards></pre>
Returns a "c"ount of the number of times <thething> occurs
You can also take advantage of the "|" to pass output from one grep to another to refine the results e.g.
<pre>grep -i <thething> <thefileorpathwithwildcards> | grep -v "#" </pre>
Would return all lines containing <thething> that have not got a comment marker (# often if not always used for commenting out lines in conf files, for example)


===less & more===
{|+ class="wikitable" style="width:90%; margin: 0 1em 1em 0; background: white; border: 0; border-collapse: collapse;"
===vi===
|
===cat===
  # cat filename
is a quick and easy way to display a text file on CLI. Particularly useful for smaller files and when you want to grab a line to copy elsewhere


===sudo===
* [[Auditd]]
This is used anytime you need additional privileges on a system. It assumes you are not just logging in as the anonymous "root" user (which we disable ssh access to normally) nor that your account has root powers (not recommended). Generally used in the form
* [[Apache]]
<pre>sudo <thecommandtorun></pre>
* [[Backup]]
* [[Cas]]
* [[Certbot]]
* [[Git info]]
* [[ISCSI]]
* [[Joomla]]
* [[Linux]]
|
* [[LTB Self Service Password]]
* [[Mail]]
* [[Installing mediawiki|MediaWiki]]
* [[Migration]]
* [[Installing Moodle|Moodle]]
* [[Nextcloud info]]
* [[Puppet]]
* [[PostgreSQL]]
* [[Samba]]
|
* [[SNMP]]
* [[SSH]]
* [[Teampass]]
* [[Timesheets]]
* [[Upgrade to PHP5.6]]
* [[Virtualisation]]
* [[Zabbix info]]
* [[X2go]]
* [[Zetavault]]
* [[MSP Anywhere via WINE|MSP Anywhere + WHINE]]
|
* [[Docker]]
* [[Ansible]]
|}


===find===
== Company-wide services ==
Does what it says on the tin, finds stuff. Lots of options available such as finding files modified/accessed by time passed or on a date or date range. Simplest form and most common use is to find a file by name or part name using find <path> name <name or name+wildcard> e.g.


<pre>find / -name ttnsub*</pre>
{|+ class="wikitable" style="width:90%; margin: 0 1em 1em 0; background: white; border: 0; border-collapse: collapse;"
|
* [[List of websites]]
|
* [[Monitoring]]
|}


How to delete files older than five days
== Contacts ==


<pre>find /path/to/files* -mtime +5 -exec rm {} \;</pre>
* [[Ticket]]
* [[IT staff contacts]]

Revision as of 08:51, 9 March 2018

Welcome

Welcome to the Docs Wiki hosted by newroco

Please use the newroco docs wiki style guide when formatting pages. The style guide also contains basic tips on wiki markup. You can get more help on using wikis from the User's Guide.

How-to pages

Company-wide services

Contacts