Linux: различия между версиями

Материал из MediaWikiWelcom
Перейти к навигации Перейти к поиску
 
(не показано 13 промежуточных версий этого же участника)
Строка 1: Строка 1:
<h3>Configuration Debian Linux:</h3>
+
<h3>Configuring Debian Linux:</h3>
<h5>Step 1</h5>
 
<h5>Step 2</h5>
 
  
<b>Step 1</b>
+
<h5>Step 1. Install apt</h5>
<li>apt install sudo vim  
+
<li>apt install vim  
 
<li>export PATH=$PATH:/sbin
 
<li>export PATH=$PATH:/sbin
 
<li>export PATH=$PATH:/usr/sbin
 
<li>export PATH=$PATH:/usr/sbin
 
<li>apt install htop tcpdump mc ncdu pydf pwgen nmap nmon atop hwinfo curl aptitude screen locate -y
 
<li>apt install htop tcpdump mc ncdu pydf pwgen nmap nmon atop hwinfo curl aptitude screen locate -y
 
<br>
 
<br>
<h5>Step 2</h5>
+
 
<br>
+
<h5>Step 2. Change default editor</h5>
<h3>Change default editor</h3>
 
 
<li>ls -l /etc/alternatives/editor
 
<li>ls -l /etc/alternatives/editor
 
<li>update-alternatives --config editor
 
<li>update-alternatives --config editor
Строка 18: Строка 15:
  
 
<h3>Confluence postgres examples queries</h3>
 
<h3>Confluence postgres examples queries</h3>
 +
 +
<li>SELECT version(); - версия postgres
 
<li>\dt все таблицы активной базы
 
<li>\dt все таблицы активной базы
 
<li>SELECT * FROM cwd_user; вся таблица пользователей cwd_user
 
<li>SELECT * FROM cwd_user; вся таблица пользователей cwd_user
Строка 29: Строка 28:
 
<li>SELECT id, user_name, display_name, lower_display_name, external_id FROM cwd_user; по полям... из таблицы cwd_user
 
<li>SELECT id, user_name, display_name, lower_display_name, external_id FROM cwd_user; по полям... из таблицы cwd_user
 
<li>SELECT successdate, prevsuccessdate, faileddate, username FROM logininfo li WHERE successdate > '2022-01-01' ORDER BY successdate;
 
<li>SELECT successdate, prevsuccessdate, faileddate, username FROM logininfo li WHERE successdate > '2022-01-01' ORDER BY successdate;
 
+
<br>
 
+
<li>SELECT cd.directory_name, cu.user_name, prevsuccessdate, li.successdate, faileddate, display_name FROM logininfo li
<li>SELECT li.successdate, li.prevsuccessdate, li.faileddate, cu.user_name, display_name, cd.directory_name FROM logininfo li
+
JOIN user_mapping um ON um.user_key = li.username JOIN cwd_user cu ON um.username = cu.user_name JOIN cwd_directory cd ON cu.directory_id = cd.id
JOIN user_mapping um ON um.user_key = li.username JOIN cwd_user cu ON um.username = cu.user_name JOIN cwd_directory cd ON cu.directory_id = cd.ID
+
WHERE cd.directory_name = 'tps.local' and successdate > '2022-01-01' ORDER BY successdate;
WHERE successdate > '2022-01-01' ORDER BY successdate;
+
<br>
 
 
 
 
 
<li>SELECT cu.user_name, cd.directory_name, prevsuccessdate, li.successdate, faileddate, display_name FROM logininfo li
 
<li>SELECT cu.user_name, cd.directory_name, prevsuccessdate, li.successdate, faileddate, display_name FROM logininfo li
 
JOIN user_mapping um ON um.user_key = li.username JOIN cwd_user cu ON um.username = cu.user_name JOIN cwd_directory cd ON cu.directory_id = cd.id
 
JOIN user_mapping um ON um.user_key = li.username JOIN cwd_user cu ON um.username = cu.user_name JOIN cwd_directory cd ON cu.directory_id = cd.id
 
WHERE cd.directory_name = 'tps.local' and successdate < '2022-01-01' ORDER BY successdate;
 
WHERE cd.directory_name = 'tps.local' and successdate < '2022-01-01' ORDER BY successdate;
 +
<br>
 +
<h3>Other cases</h3>
 +
<ol>
 +
  <li>Microsoft</li>
 +
  <li>Google</li>
 +
  <li>Apple</li>
 +
  <li>IBM</li>
 +
</ol>
 +
 +
<ul>
 +
<li>Пункт 1.</li>
 +
  <li>Пункт 2.
 +
    <ul>
 +
      <li>Подпункт 2.1.</li>
 +
      <li>Подпункт 2.2.</li>
 +
        </ul>
 +
  </li>
 +
</ul>

Текущая версия на 13:19, 11 апреля 2022

Configuring Debian Linux:

Step 1. Install apt
  • apt install vim
  • export PATH=$PATH:/sbin
  • export PATH=$PATH:/usr/sbin
  • apt install htop tcpdump mc ncdu pydf pwgen nmap nmon atop hwinfo curl aptitude screen locate -y
    Step 2. Change default editor
  • ls -l /etc/alternatives/editor
  • update-alternatives --config editor
  • Press <enter> to keep the current choice[*], or type selection number: 3 <choose 3>

    Confluence postgres examples queries

  • SELECT version(); - версия postgres
  • \dt все таблицы активной базы
  • SELECT * FROM cwd_user; вся таблица пользователей cwd_user
  • SELECT * FROM cwd_user WHERE active = 'F'; вся таблица активных пользователей cwd_user
  • SELECT id, user_name, display_name, lower_display_name, external_id FROM cwd_user; вся таблица пользователей cwd_user со столбцами...
  • SELECT * FROM logininfo; все данные таблицы logininfo
  • SELECT * FROM user_mapping; все данные таблицы user_mapping
  • SELECT * FROM cwd_user;
  • SELECT username FROM logininfo; username из столбца logininfo
  • SELECT successdate, username FROM logininfo WHERE successdate < '2022-01-01' ORDER BY successdate; List active users who have not logged in since a specific date
  • SELECT id, user_name, display_name, lower_display_name, external_id FROM cwd_user; по полям... из таблицы cwd_user
  • SELECT successdate, prevsuccessdate, faileddate, username FROM logininfo li WHERE successdate > '2022-01-01' ORDER BY successdate;
  • SELECT cd.directory_name, cu.user_name, prevsuccessdate, li.successdate, faileddate, display_name FROM logininfo li JOIN user_mapping um ON um.user_key = li.username JOIN cwd_user cu ON um.username = cu.user_name JOIN cwd_directory cd ON cu.directory_id = cd.id WHERE cd.directory_name = 'tps.local' and successdate > '2022-01-01' ORDER BY successdate;
  • SELECT cu.user_name, cd.directory_name, prevsuccessdate, li.successdate, faileddate, display_name FROM logininfo li JOIN user_mapping um ON um.user_key = li.username JOIN cwd_user cu ON um.username = cu.user_name JOIN cwd_directory cd ON cu.directory_id = cd.id WHERE cd.directory_name = 'tps.local' and successdate < '2022-01-01' ORDER BY successdate;

    Other cases

    1. Microsoft
    2. Google
    3. Apple
    4. IBM
    • Пункт 1.
    • Пункт 2.
      • Подпункт 2.1.
      • Подпункт 2.2.