Counter of Festivals

Ashok Blog for SQL Learners and Beginners and Experts

Wednesday 29 November 2023

MYSQL basic commands and useful links and backup methods

 





Backup

How to Download and Install MySQL in Windows 11/10 (thewindowsclub.com)

https://dev.mysql.com/downloads/file/?id=523568


https://sqlbak.com/blog/how-to-backup-mysql-database-on-windows/


https://serverguy.com/servers/how-to-backup-mysql-database/


https://www.jotform.com/blog/how-to-backup-mysql-database/


https://dev.mysql.com/doc/mysql-backup-excerpt/5.7/en/mysqldump-sql-format.html


https://www.sitepoint.com/backing-up-mysqldump/


useful mysql and linux admin tool via website


https://webmin.com/


my sql commands:




To connect mysql instance:


open cmd or run command


Go to bin folder as above


C:\Windows\system32>c:  


C:\Windows\system32>cd C:\Program Files\MySQL\MySQL Server 8.0\bin  


C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -u root -p  


mysql> select version();  


mysql> show databases; 


mysql>create database testmysql;


mysql>use testmysql;


mysql> create table test(testid int,testdesc char); 


mysql> insert into test select 5,'t';  


mysql> select * from test;    


To take backup of my sql database


C:\Windows\system32>c:  


C:\Windows\system32>cd C:\Program Files\MySQL\MySQL Server 8.0\bin  


C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql --user root  testmysql > testmysql_bk.sql; 


C:\Program Files\MySQL\MySQL Server 8.0\bin>dir 

Monday 20 June 2022

Azure Fundamentals AZ-900

 

 

https://www.microsoft.com/en-us/trainingdays/azure

 


Join us at Microsoft Azure Virtual Training Day: Fundamentals for an introduction to cloud computing concepts, models, and services—from public to private to hybrid cloud. You’ll also learn the basics of infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (SaaS). Prepare to take full advantage of the key Azure pillars of security, privacy, compliance, and trust.

Who should attend:

  • Developers
  • Architects
  • IT professionals
  • Cloud novices

Technical level: For those who are just beginning to work with cloud-based solutions and services or are new to Azure.

After completing this training, you will be able to:

  • Prepare for cloud migration with the training to evaluate your existing on-premises environment.
  • Optimize your Azure-based workloads for maximum ROI.
  • Learn best practices for managing your virtual machines, applications, and data with Azure.
  • Take the Microsoft Azure Fundamentals certification exam at no cost.

Here’s what you can expect:

Part 1

Part 2

Introduction

Introduction

Azure Cloud Concepts

Azure Security and Network Security

Core Azure Services

Identity, governance, privacy and compliance

Break: 10 Minutes

Break: 10 Minutes

Azure Solutions and Management Tools

Azure Pricing and Lifecycle

Closing Question & Answer

Closing Question & Answer

Space is limited, so reserve your spot now!

Click here for the Microsoft digital event code of conduct.

For questions about discounted exam eligibility, scheduling, or expirations, please refer to the FAQ.

Microsoft Azure Virtual Training Day: Fundamentals event, including the exam upon completing the event, is open to the public and offered at no cost. Prior to registering for this training, government employees must check with their employers to ensure their participation is permitted, and in accordance with, applicable policies and laws.

 

Microsoft Azure Fundamentals Certification



Azure Fundamentals (AZ-900 exam) is the foundational level exam in the new Azure certifications path. This exam is intended for those who want to demonstrate their basic knowledge of cloud services with Microsoft Azure. Even if you are from a non-technical background but if you have some basic understanding of the concepts of cloud, you can take this certification exam. You can check your preparation level with the AZ-900 practice test but before that we recommend you to try Free AZ-900 practice test.

Exam AZ-900: Microsoft Azure Fundamentals

AZ-900 Azure Fundamentals exam is considered as the first step in the associate level and expert level Azure certifications path. Although it’s an optional step, validating your foundational knowledge will benefit you to some extent. Also, it’s not mandatory but AZ-900 exam can be considered as the entry-point for all other associate and expert level Azure certifications. You can try out Azure fundamental practice tests to prepare for the AZ-900 exam.

Let’s have a look at the details of the Azure AZ-900 exam.

Prerequisites: There are no particular prerequisites for the Microsoft Azure Fundamental exam but one should be familiar and have a basic understanding of the cloud services and the Microsoft Azure platform.

Domains Covered in AZ-900 Exam are –

Domain

% Weight

Describe Cloud Concepts

15-20%

Describe Core Azure Services

30-35%

Describe Security, Privacy, Compliance, and Trust

25-30%

Describe Azure Pricing, Service Level Agreements, and Lifecycles

25-30%

Exam Languages: English, Japanese, Simplified Chinese, Korean, German, Spanish, and French

Certification Cost: USD 99


AZURE Practice exams:

Answer Sheet

  • Q1) You are working in a company that plans to migrate their application to Azure. This application will be responsible to host the banking records for its users. You have been asked to suggest a security information event management (SIEM) and security orchestration automated response (SOAR) solution.
    Which of the following Azure service will mee the requirement?

    1.  Azure CycleCloud
    2.  Azure Sphere
    3.  Azure Sentinel
    4.   Azure Security Center
  • Q2)

    Let us suppose ABC Ltd. plans to migrate all its data and resources to Azure. The company’s migration plan states that only platform as a service (PaaS) solutions must be used in Azure. Now you are required to deploy an Azure environment which supports the planned migration.

    Solution: In this case, you create an Azure App Service and Azure virtual machines that have Microsoft SQL Server installed.

    Does the solution meet the desired goal?

    1.   Yes, the solution meets the desired goal.
    2.  No, the solution does not meet the desired goal.
  • Q3) Let us suppose a company wants to try out some services that are being offered by Azure in Public Preview.

    In this case, should the company deploy resources which are part of Public Preview in their production environment?

    1.  Yes
    2.   No
  • Q4)

    For the statement given below, select Correct if the statement is true, else select Incorrect if it is false.

    “An Azure free account has a spending limit”.

    1.   Correct
    2.  Incorrect
  • Q5)

    You have plans to deploy several Azure virtual machines. You are required to ensure that the services running on the virtual machines are available, even if a single data center fails.


    Solution: You suggest deploy the virtual machines to two or more scale sets.


    Does the suggested solution meet the desired goal?

    1.  Yes, the solutions meets the desired goal
    2.   No, the solution does not meet the desired goal
  • Q6) An organization plans to migrate its application named QuickApp1 to Azure.
    As per the observed pattern QuickApp1 has a low usage during the second and fourth weeks and high usage during the first and third weeks of the month
    Which amongst the following benefit of Azure Cloud Services will support cost management for this kind of usage pattern?

    1.  Load balancing
    2.   Elasticity
    3.  High availability
    4.  Fault tolerance
  • Q7) Which of the following Azure Service would you suggest when you are planning to create an application with an event-based architecture that has the feature to ingest events from Blob storage and create custom topics?

    1.  Azure Logic Apps
    2.  Azure Functions
    3.  Azure Machine Learning Studio
    4.   Azure Event Grid
  • Q8)

    For the statement given below, select Correct if the statement is true, else select Incorrect if it is false.

    “Azure resources can only access other resources in the same resource group ”.

    1.   Correct
    2.  Incorrect
  • Q9) Your organization is planning to build a customized solution for uploading weather data to Azure using several million sensors. Which of the given service should the company use to connect, monitor, and control the sensors without managing the infrastructure?

    1.  Azure Files
    2.  Azure Virtual Machine
    3.   Azure IoT Hub
    4.  Azure App Service
  • Q10) ______________ offers real-time analytics and complex event-processing engine.

    1.  Azure Logic Apps
    2.   Azure Stream Analytics
    3.  Azure Data Lake
    4.  Azure Event Hub





Ref:

https://docs.microsoft.com/en-us/learn/certifications/azure-ai-fundamentals/?ocid=AID3032310_QSG_529835

https://www.whizlabs.com/learn/course/microsoft-azure-certification-az-900/256/quiz/19435/report/6498409

https://mktoevents.com/Microsoft+Event/344254/157-GQE-382

https://www.mindhub.com/p/MU-AI-900?utm_source=microsoft&utm_medium=certpage&utm_campaign=msofficialpractice

https://www.testpreptraining.com/microsoft-azure-fundamentals-az-900-free-practice-test


Thursday 19 August 2021

TSQL To assign DB ROLE BULK of particular databases

TSQL To assign DB ROLE BULK of particular databases 


  --SELECT * FROM dbo.dbRolesUsersMap ('db_role_name')

 --SELECT * FROM dbo.dbRolesUsersMap (DEFAULT)


use db_name


    Declare @CustomeRole varchar(8000)

    Declare @provideuserrolerole varchar(8000)

Declare @user varchar(30)

Declare @assignrole varchar(100)

Declare @i int

    Declare @j int


set @assignrole='db_role_name'


  Select Distinct Rno=ROW_NUMBER()over(Order by members.name), members.name as 'members_name'


  into ##providedbprivilgeobjects 


FROM sys.database_role_members rolemem


INNER JOIN sys.database_principals roles


ON rolemem.role_principal_id = roles.principal_id


INNER JOIN sys.database_principals members


ON rolemem.member_principal_id = members.principal_id


where roles.name not in (SELECT Login_Name FROM dbo.dbRolesUsersMap ('db_role_name'))

and members.name not like '%\%'

ORDER BY members.name


Select @i=1,@j=COUNT(*) from ##providedbprivilgeobjects    

  

While @i <= @j    

Begin    

 

 Select @user=members_name from ##providedbprivilgeobjects where Rno=@i  


  set @provideuserrolerole='Use db_name'+space(2)+'ALTER ROLE '+space(1)+'['+@assignrole+']'+space(2)+'ADD MEMBER '+space(2)+'['+@user+']'+''

  

  --select @provideuserrolerole


  Print @provideuserrolerole


    --Execute(@provideuserrolerole) 


SET @i=@i+1


 End


 drop table ##providedbprivilgeobjects



Note:


use db_name

CREATE FUNCTION dbo.dbRolesUsersMap (@dbRole SYSNAME = '%')
RETURNS TABLE
AS
RETURN (
      SELECT 
        User_Type = 
           CASE mmbrp.[type] 
           WHEN 'G' THEN 'Windows Group' 
           WHEN 'S' THEN 'SQL User' 
           WHEN 'U' THEN 'Windows User' 
           END,
         Database_User_Name = mmbrp.[name],
         Login_Name = ul.[name],
         DB_Role = rolp.[name]
      FROM sys.database_role_members mmbr, -- The Role OR members associations table
         sys.database_principals rolp,     -- The DB Roles names table
         sys.database_principals mmbrp,    -- The Role members table (database users)
         sys.server_principals ul          -- The Login accounts table
      WHERE Upper (mmbrp.[type]) IN ( 'S', 'U', 'G' )
         -- No need for these system account types
         AND Upper (mmbrp.[name]) NOT IN ('SYS','INFORMATION_SCHEMA')
         AND rolp.[principal_id] = mmbr.[role_principal_id]
         AND mmbrp.[principal_id] = mmbr.[member_principal_id]
         AND ul.[sid] = mmbrp.[sid]
         AND rolp.[name] LIKE '%' + @dbRole + '%'
      )
GO

  --SELECT * FROM dbo.dbRolesUsersMap ('db_role_name')

 --SELECT * FROM dbo.dbRolesUsersMap (DEFAULT)

Thursday 5 August 2021

Installation influxdb on Ubuntu 20.04 LTS

 

Installation influxdb on Ubuntu


InfluxDB can be installed by directly querying the official repositories of this tool. First, add them to your list, by typing the following commands:

 

sudo curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -

sudo echo "deb https://repos.influxdata.com/ubuntu bionic stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

sudo echo "deb https://repos.influxdata.com/ubuntu bionic stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

sudo apt update

 

Once the list of repositories has been updated, proceed with the installation of InfluxDB using the command:

sudo apt install influxdb

Once installed, check the status of the service via:

sudo systemctl status influxdb

 


 

Error detail info:

 

sudo apt update
 
Ign:1 http://archive.canonical.com/ubuntu bionic InRelease
Err:2 http://archive.canonical.com/ubuntu bionic Release
  404  Not Found [IP: 91.189.92.191 80]
Ign:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:6 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Err:7 http://archive.ubuntu.com/ubuntu bionic Release
  404  Not Found [IP: 91.189.88.174 80]
Err:8 http://archive.ubuntu.com/ubuntu bionic-updates Release
  404  Not Found [IP: 91.189.88.174 80]
Err:9 http://archive.ubuntu.com/ubuntu bionic-backports Release
  404  Not Found [IP: 91.189.88.174 80]
Err:10 http://archive.ubuntu.com/ubuntu bionic-security Release
  404  Not Found [IP: 91.189.88.174 80]
Reading package lists... Done
E: The repository 'http://archive.canonical.com/ubuntu bionic Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-backports Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

 

Solutions:

·  For some reason APT can not find the Release file in the specified repositories list.

To fix this, I would suggest the following:

·         Check if your connection to the Internet is behind a firewall, limited in any way or behind a proxy and configure your system and connection accordingly or change to a different connection if available.

·         Check if there is an APT proxy configuration file by running the following command:

    ls /etc/apt/apt.conf.d/*proxy*

If the command returns back any results, move these files out of the /etc/apt/apt.conf.d/ directory or delete them.

  • Revert your repositories list to the original Ubuntu Bionic Beaver list by running the following command in the terminal:
sudo nano /etc/apt/sources.list

A file editor will be opened. Delete all the lines in it and then copy and paste the following in the file editor:

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted
deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted

Then, save and close the file by pressing Ctrl + X then press Y then press Enter

To verify you saved the file correctly, please run the following command in the terminal:

cat /etc/apt/sources.list

The output should be exactly:

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted
deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted

Ubuntu repositories have a defined format. They should be for example something like deb http://archive.ubuntu.com/ubuntu bionic main.

Explanation:

deb: These repositories contain binaries or precompiled packages. These repositories are required for most users.

http://archive.ubuntu.com/ubuntu: The URI (Uniform Resource Identifier), in this case a location on the internet.

bionic: is the release name of your Ubuntu installation.

main & restricted ...etc: are the section names or components. There can be several section names, separated by spaces.


After that, please update your repositories list by running the following command in the terminal:

sudo apt update

You should now be able to install packages and update your system again.


Notice:

If you still get errors, please first back up /etc/apt/sources.list.d/ to your home directory by running the following command in the terminal:

mkdir ~/old_sources_list_d && sudo cp -r /etc/apt/sources.list.d/* ~/old_sources_list_d/

After that, please clear all existing PPAs and repository lists in /etc/apt/sources.list.d/ by running the following command in the terminal:

sudo rm -r /etc/apt/sources.list.d/*

Then, please update your repositories list by running the following command again in the terminal:

sudo apt update

 

  To resolve this we need to run with sudo like below

 

                        $ sudo chmod +x /usr/lib/influxdb/scripts/influxd-systemd-start.sh

 


                    Useful commands:

 

                    To add portal in repository as see below

            $ sudo add-apt-repository 'deb [arch=amd64]              https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse'

                    The repository will be appended to sources.list file.

                    You can now install an   y of the packages from the newly enabled repository:

            $ sudo apt install mongodb-org

                    If for any reasons you want to remove a previously enabled repository, use the --remove option:

                    $ sudo add-apt-repository --remove 'deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu             bionic/mongodb-org/4.0 multiverse'

 

                  To add repository manually

                      If you want to have more control over how your sources are organized you can manually edit the             /etc/apt/sources.list file and add the apt repository line to the file.

                    For demonstration, we will enable the CouchDB repository and install the software. CouchDB is a free                         and open-source fault-tolerant NoSQL database maintained by the Apache Software Foundation.

                    To add the repository open the sources.list file with your text editor :                              

                     $ sudo nano /etc/apt/sources.list

Add the repository line to the end of the file:

/etc/apt/sources.list

deb https://apache.bintray.com/couchdb-deb bionic main

 

Another option is to create a new the repository file under the /etc/apt/sources.list.d/ directory.

When manually configuring a repository you also need to manually import the public repository key to your system. To do that use either wget or curl :

curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -

The command above should output OK which means that the GPG key has been successfully imported and packages from this repository will be considered trusted.

Before installing the packages from the newly added repository you must update the package index:

sudo apt update

Once the package index is updated you can install packages from the newly added repository:

sudo apt install couchdb

 

 

                        To remove swap file

                        $ rm .MERGE_MSG.swp

                        To remove mal function file

                       $ sudo rm /etc/apt/sources.list.d/file.list

                        To vi editor

                            Command                                                                Purpose

                                    i                                                                  Switch to Insert mode.

 

                                    Esc                                                             Switch to Command mode.

 

                                    :w                                                              Save and continue editing.

 

                                    :wq or ZZ                                                  Save and quit/exit vi.

 

                    To edit file on Nano editor and save

   $ sudo nano /etc/apt/sources.list

 

    Add file/modify file Then, save and close the file by pressing Ctrl + X then press Y then press Enter

                        To edit file on vi editor and save

  $ sudo vi /etc/apt/files.list

 

Type a colon (:) to move the cursor to the bottom of the screen.

This is where final commands can be made.

7            Type wq.

 wq is two individual commands: w for Write (or Save) and q for Quit. This command combination returns you to the command line.

(i.e) $ :wq

 

 

                            Commands:

 

                        Installation

    InfluxDB can be installed by directly querying the official repositories of this tool. First, add them to your list, by typing the following commands:

 

    sudo curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -

   

sudo echo " deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted" | sudo tee /etc/apt/sources.list.d/influxdb.list

 

sudo echo " deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted" | sudo tee /etc/apt/sources.list.d/influxdb.list

 

sudo echo " deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted" | sudo tee /etc/apt/sources.list.d/influxdb.list

 

                     (or)

               

 

  • Revert your repositories list to the original Ubuntu Bionic Beaver list by running the following command in the terminal:

sudo nano /etc/apt/sources.list

A file editor will be opened. Delete all the lines in it and then copy and paste the following in the file editor:

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted

deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted

deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted

Then, save and close the file by pressing Ctrl + X then press Y then press Enter

To verify you saved the file correctly, please run the following command in the terminal:

cat /etc/apt/sources.list

The output should be exactly:

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted

deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted

deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted

 


 

sudo apt update

Once the list of repositories has been updated, proceed with the installation of InfluxDB using the command:

sudo apt install influxdb

Once installed, check the status of the service via:

sudo systemctl status influxdb

  

If, when typing this command, a result similar to the one shown in the screenshot above appears, the tool has been correctly installed, but is not running yet.

To start it and make sure that the service is always available every time the machine is restarted, type the command:

sudo systemctl enable --now influxdb

In this way, not only will it start on the spot, but it will be reloaded every time the server is restarted. To start it manually, run, as an alternative to the command shown above, the following:

sudo systemctl start influxdb

To stop the execution of InfluxDB use the command:

sudo systemctl stop influxdb

Configuring InfluxDB

The InfluxDB configuration file is located by default in the /etc/influxdb/influxdb.conf folder.

Many features are commented out. To enable them, simply open the configuration file and delete the "#" symbols from the relevant line.

To modify the configuration file use the command:

sudo nano /etc/influxdb/influxdb.conf

For example, to access via HTTP request (enabling endpoints), uncomment the "enabled" item in the "http" section, as shown in the following screenshot:


When the necessary changes are made, close and exit using the key combination CTRL + X / Y / Enter.

To apply the changes, the service has to be restarted. This operation that can be carried out using the commands described above:

sudo systemctl stop influxdb && sudo systemctl start influxdb

As with any database, after the installation the first thing to do is to create an administrator account. This can be done using the following command: 

curl -XPOST "http://localhost:8086/query" --data-urlencode "q=CREATE USER admin WITH PASSWORD 'password' WITH ALL PRIVILEGES"

Clearly replace:

  • admin: with the user name;
  • password: with the password for the database login.

Once the account is created, access the InfluxDB shell by using the command:

influx -username 'admin' -password 'password'

N.B. also in this case, the “admin” and “password” parameters have to be replaced with those previously declared.


In addition to running queries directly from the shell, your queries can be submitted to InfluxDB by using
tools such as "curl". The syntax to respect is the following:

curl -G http://localhost:8086/query -u ADMIN_NAME:PASSWORD_NAME --data-urlencode "q=QUERY"

Again, replace:

  • "ADMIN_NAME" with the name of the user created;
  • "PASSWORD_NAME" with the password associated with that user;
  • “QUERY” with the query to be executed.

For example, to access with the data used in this tutorial and view all the databases present, the command to execute would be:

curl -G http://localhost:8086/query -u admin:password --data-urlencode "q=SHOW DATABASES"

N.B. If the InfluxDB database is queried from a machine other than the one where the server is installed, instead of ‘localhost’, enter the IP address of the machine to query.

 

Enabling the Firewall

Since InfluxDB can also be queried from the outside, it may be necessary to update the firewall rules to allow it to connect.

If your firewall is  UFW just type the following commands:

sudo ufw allow 8086/tcp

This will allow TCP traffic on port 8086 used by InfluxDB for querying the database from outside.


 

 


 

                  Useful links:

                    Install influx on ubuntu

                    1)https://www.arubacloud.com/tutorial/how-to-install-influxdb-on-ubuntu-20-04.aspx

Fix issue

                    2)https://itectec.com/ubuntu/ubuntu-unable-to-update-or-install-anything-after-moving-to-another-country/

                    permission denied issue

                            3) https://unix.stackexchange.com/questions/209097/systemd-failed-at-step-exec-spawning-script-       permission-denied

 

                        Add repository on Ubuntu source list

                    4) https://linuxize.com/post/how-to-add-apt-repository-in-                            ubuntu/#:~:text=Adding%20Repositories%20with%20add%2Dapt%2Drepository,-The%20basic%20syntax&text=list%20file%20like%20deb%20http,apt%2Drepository%20in%20your%20terminal.

 

                    Beginners commands

                    5) https://techlog360.com/basic-ubuntu-commands-terminal-shortcuts-linux-beginner/

 

                    How do I remove a malformed line from my sources.list?

                    6) https://www.youtube.com/watch?v=X0FApmuZw98

$ sudo rm /etc/apt/sources.list.d/file.list


useful commands  and links


1)Display the current Ubuntu hostname

$ hostname


2)To know the which ubuntu version installed


$ lsb_release -a


Note:

LSB (Linux Standard Base)information about your specific Linux distribution, including version number, release codename, and distributor ID.


3) Install net tools if not available

$ Install net tools

sudo apt install net-tools


4)$ netstat -n -l


5) cat /lib/systemd/system/influxdb.service


6)usermod -aG sudo username


To give permission to file


sudo chmod +x /usr/lib/influxdb/scripts/influxd-systemd-start.sh


To add repository via command line and remove file in repository

sudo add-apt-repository 'deb [arch=amd64] http://archive.ubuntu.com /ubuntu focal InRelease'

sudo add-apt-repository --remove 'deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse'

sudo service influxdb start

sudo systemctl enable --now influxdb

sudo systemctl status influxdb


To vi editor 


Command Purpose


i Switch to Insert mode.


Esc Switch to Command mode.


    :w Save and continue editing.


    :wq or ZZ Save and quit/exit vi.


To remove swap file


rm .MERGE_MSG.swp


To remove mal function file


sudo rm /etc/apt/sources.list.d/file.list


$ sudo nano /etc/apt/sources.list

cat /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted

deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted

deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted

Ctrl + X then press Y then press Enter


Linux links

https://www.cyberciti.biz/faq/ubuntu-change-hostname-command/

https://techlog360.com/basic-ubuntu-commands-terminal-shortcuts-linux-beginner/

https://www.howtogeek.com/50787/add-a-user-to-a-group-or-second-group-on-linux/

https://docs.influxdata.com/influxdb/v1.8/introduction/install/

https://www.arubacloud.com/tutorial/how-to-install-influxdb-on-ubuntu-20-04.aspx

https://linuxize.com/post/how-to-add-user-to-sudoers-in-ubuntu/

http://old-releases.ubuntu.com/releases/focal/

https://repos.influxdata.com/ubuntu/dists/focal/stable/binary-amd64/Packages

https://www.influxdata.com/blog/influxdb-shards-retention-policies/

https://www.codegrepper.com/code-examples/shell/grant+all+the+permission+to+the+user+ubuntu

https://linuxize.com/post/how-to-add-apt-repository-in-ubuntu/#:~:text=Adding%20Repositories%20with%20add%2Dapt%2Drepository,-The%20basic%20syntax&text=list%20file%20like%20deb%20http,apt%2Drepository%20in%20your%20terminal.

https://itectec.com/ubuntu/ubuntu-unable-to-update-or-install-anything-after-moving-to-another-country/

http://old-releases.ubuntu.com/releases/focal/ubuntu-20.04-desktop-amd64.iso

https://www.dummies.com/web-design-development/web-hosting/how-to-edit-files-with-vi/