Arquivo da tag: ubuntu 18.04

adicionar monitor de cpu e memória no painel superior do Ubuntu 18.04

dica: http://ubuntuhandbook.org/index.php/2019/03/display-cpu-memory-network-usage-in-ubuntu-18-04-panel/
https://askubuntu.com/questions/75530/how-do-i-install-and-manage-gnome-shell-extensions

The system monitor extension features:

  • Display informations for CPU, GPU, Memory, Swap, Net, Disk, Fan, Battery
  • Display resource usage in panel via digit or graph
  • A drop-down menu with detailed information.
  • Ability to set gragh width, background color, refresh time.
  • Show tooltips.

1. To install the extension, first open terminal either via Ctrl+Alt+T keyboard shortcut or by searching for ‘terminal’ from application menu.

When it opens, run command to install the necessary system libraries:

sudo apt-get install gir1.2-gtop-2.0 gir1.2-networkmanager-1.0  gir1.2-clutter-1.0

Type user password (no asterisk feedback due to security reason) when it prompts and hit Enter.

2. Open Ubuntu Software and then search for ‘system monitor extension’.

There are a few similar extensions available. In the case, I installed the last one.

3. You’ll see the indicator applet once you installed the extension. Click to show drop-down menu, then go to Preferences and change the applet appearance.

Anúncios

Instalando PostgreSQL e phpPgAdmin no Ubuntu 18.04

dica do site: https://www.howtoforge.com/tutorial/ubuntu-postgresql-installation/

PostgreSQL or Postgres is a powerful high-performance object-relational database management system (ORDBMS) released under a flexible BSD-style license. PostgreSQL is well suited for large databases and has many advanced features.

PostgreSQL is available for many operating systems including Linux, FreeBSD, Solaris, and Microsoft Windows. PhpPgAdmin is a PHP-based web application for managing PostgreSQL databases. With Phppgadmin, it is easy to create a database, create a role and create tables in Postgres.

This tutorial will show the installation of PostgreSQL and its web-based administration interface phpPgAdmin on Ubuntu 18.04 LTS (Bionic Beaver). I will use the Ubuntu minimal server as a basis for this setup.

Prerequisites

  • Ubuntu 18.04
  • Root privileges

What we will do?

  1. Install PostgreSQL and phpPgAdmin
  2. Configure Postgres User
  3. Configure Apache2
  4. Configure phpPgAdmin
  5. Testing

Step 1 – Install PostgreSQL, phpPgAdmin and All Dependencies

Before installing any packages on the Ubuntu system, update all available repositories.

sudo apt update

And now we’re ready for installing PostgreSQL, phpPgAdmin, and Apache2 packages.

PostgreSQL and PhpPgAdmin are available in the Ubuntu repository. So you just need to install them with the apt command.

sudo apt -y install postgresql postgresql-contrib phppgadmin

The above command will automatically install all packages needed by PostgreSQL and phpPgAdmin, like Apache2, PHP etc.

Step 2 – Configure Postgres User

PostgreSQL uses role for user authentication and authorization, it just like Unix-Style permissions. By default, PostgreSQL creates a new user called “postgres” for basic authentication. To use PostgreSQL, you need to login to the “postgres” account, you can do that by typing:

su - postgres

Now you can access the PostgreSQL prompt with the command:

psql

And then change the password for postgres role by typing:

\password postgres
TYPE THE POSTGRES PASSWORD

Then enter \q to leave the psql command line.

\q

Run the command “exit” to leave the postgres user and become root again.

exit

Set a PostgreSQL password

Step 3 – Configure Apache Web Server

You need to configure Apache virtual host configuration for phpPgAdmin.

Goto the ‘/etc/apache2/conf-available’ directory and edit the configuration file ‘phppgadmin.conf’ with vim by typing:

cd /etc/apache2/conf-available/
vim phppgadmin.conf

Comment out the line ‘#Require local’ by adding a # in front of the line and add below the line allow from all so that you can access from your browser.

Require all granted

Save and exit.

Configure Apache Web server

Step 4 – Configure phpPgAdmin

Go to the ‘/etc/phppgadmin’ directory and edit the configuration file ‘config.inc.php’ by typing :

cd /etc/phppgadmin/
vim config.inc.php

Find the line ‘$conf[‘extra_login_security’] = true;’ and change the value to ‘false’ so you can login to phpPgAdmin with user postgres.

$conf['extra_login_security'] = false;

Save and exit.

Configure phpPgAdmin

Now restart the PostgreSQL and Apache2 services.

systemctl restart postgresql
systemctl restart apache2

Step 5 – Testing Postgres

By default, PostgreSQL is running on port ‘5432’, and the Apache2 running on the default HTTP port ’80’.

Check using netstat command.

netstat -plntu

Check postgres network

Now access phpPgAdmin with your browser http://yourip/phppgadmin/.

Login to phpPgAdmin

and then try login to with user ‘postgres’ and your password.

Login with postgres user to phpPgAdmin

After logging in, you will get this phpPgAdmin dashboard interface:

phpPgAdmin dashboard interface

Installation of the PostgreSQL database with phpPgAdmin on Ubuntu 18.04 LTS has been completed successfully.

Conclusion

PostgreSQL is an advanced object-relational database management system (ORDBMS). It is Open Source and has a large and active community. PostgreSQL provides the psql command line program as primary front-end, which can be used to enter SQL queries directly or execute them from a file. phpPgAdmin is a web-based administration tool for PostgreSQL written in PHP that makes the administration of Postgres databases easier.

alterar o hostname do ubuntu

dica retirada do site: https://linuxize.com/post/how-to-change-hostname-on-ubuntu-18-04/

This tutorial will guide you through the process of changing the hostname on an Ubuntu 18.04 system.

The hostname is set at the time when the Ubuntu operating system is installed or if you are spinning up a virtual machine it is dynamically assigned to the instance at startup.

The method described in this guide will work without the need of restarting your system.

Although this tutorial is written for Ubuntu 18.04 the same instructions apply for Ubuntu 16.04 and any Ubuntu-based distribution, including Linux Mint and Elementary OS.

Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges.

A hostname is a label that identifies a machine on the network. You shouldn’t use the same hostname on two different machines on a same network.

To view the current hostname, enter the following command:

hostnamectl

Copy

As you can see in the image above, the current hostname is set to ubuntu1804.localdomain.

The following steps outline how to change the hostname in Ubuntu 18.04.

In Ubuntu 18.04 we can change the system hostname and related settings using the command hostnamectl.

For example, to change the system static hostname to linuxize, you would use the following command:

sudo hostnamectl set-hostname linuxize

Copy

The hostnamectl command does not produce output. On success, 0 is returned, a non-zero failure code otherwise.

Open the /etc/hosts file and change the old hostname to the new one.

/etc/hosts
127.0.0.1   localhost
127.0.0.1   linuxize

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Copy

If the cloud-init package is installed you also need to edit the cloud.cfg file. This package is usually installed by default in the images provided by the cloud providers such as AWS and it is used to handle the initialization of the cloud instances.

To check if the package is installed run the following ls command:

ls -l /etc/cloud/cloud.cfg

Copy

If you see the following output it means that the package is not installed and no further action is required.

ls: cannot access '/etc/cloud/cloud.cfg': No such file or directory

Copy

If the package is installed the output will look like the following:

-rw-r--r-- 1 root root 3169 Apr 27 09:30 /etc/cloud/cloud.cfg

Copy

In this case you’ll need to open the /etc/cloud/cloud.cfg file:

sudo nano /etc/cloud/cloud.cfg

Copy

Search for preserve_hostname and change the value from false to true:

/etc/cloud/cloud.cfg
# This will cause the set+update hostname module to not operate (if true)
preserve_hostname: true

Copy

Save the file and close your editor.

To verify that the hostname was successfully changed, once again use the hostnamectlcommand:

hostnamectl

Copy

   Static hostname: linuxize
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 6f17445f53074505a008c9abd8ed64a5
           Boot ID: 1c769ab73b924a188c5caeaf8c72e0f4
    Virtualization: kvm
  Operating System: Ubuntu 18.04 LTS
            Kernel: Linux 4.15.0-22-generic
      Architecture: x86-64

Copy

You should see your new server name printed on the console.

In this tutorial, we have shown you how to easily change your Ubuntu server hostname without restarting the machine.

Ubuntu 18.04 compatível com RAID 1

Precisei configurar dois HDs em Raid 1 e instalar o ubuntu 18.04, porém as versões normais do ubuntu server 18.04 não estavam reconhecendo o RAID 1 criado pelo hardware da máquina.

A versão de ubuntu que deu certo o reconhecimento corretamente foi a alternate 18.04.2:

http://cdimage.ubuntu.com/releases/18.04.2/release/ubuntu-18.04.2-server-amd64.iso

configurar ip manualmente no ubuntu server 18.04

fonte: https://askubuntu.com/questions/1036060/no-ethernet-connection-on-ubuntu-server-18-04-on-dell-power-edge-t300

 

essa dica me ajudou:

 

So, in my case, I would use the interface designation enp0s25.

Next, edit your netplan file:

sudo nano /etc/netplan/01-netcfg.yaml 

Amend the file to read:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s25:
        dhcp4: no
            addresses: [192.168.100.40/22]
            gateway4: 192.168.100.1
            nameservers:
            addresses: [8.8.8.8,8.8.4.4]

Of course, susbstitue your exact details here. Spacing, indentation, etc. are crucial. Proofread carefully. Save (Ctrl+o followed by Enter) and close (Ctrl+x) the text editor.

Next:

sudo netplan apply
sudo ip link set enp0s25 down
sudo ip link set enp0s25 up

Did you get the requested IP address?

ip addr show

Can you ping?

ping -c3 8.8.8.8
ping -c3 www.ubuntu.com

If you get ping returns, you are all set.

instalar anydesk no ubuntu

anydesk é uma alternativa ao teamviewer

fonte: https://tecadmin.net/install-anydesk-ubuntu/

testei no ubuntu 18.04 e funcionou

Install AnyDesk

Anydesk is available in both 64-Bit and 32-Bit formats. You can download it from its official websiteand install on Ubuntu, Debian, and LinuxMint operating systems.

wget https://download.anydesk.com/linux/anydesk_4.0.1-1_amd64.deb
sudo dpkg -i anydesk_4.0.1-1_amd64.deb

If the above commands faced issue for dependency issues, Execute below command to install Anydesk with required dependencies.

sudo apt-get install -f

 

Ativar/desativar hot corner (cantinho) do Ubuntu 18.04

fonte: https://medium.com/@luanlmd/ubuntu-18-04-enable-hot-corner-203b639e8484

ativar:

gsettings set org.gnome.shell enable-hot-corners true

desativar:

gsettings set org.gnome.shell enable-hot-corners false

hotcorner