Thursday, July 27, 2023

KVM installation in Ubuntu with these below commands

KVM installation in Ubuntu with these below commands

sudo apt install -y cpu-checker
sudo apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils
apt install qemu-system

Wednesday, July 12, 2023

Ansible syntax check with Python Module

The below commands will help us to check the ansible format.

#pip install ansible-lint
#ansible-lint playbook.yml --force-color
 

#ansible-playbook playbook.yml --syntax-check

Fixation of older CentOS8 repos

Follow the below steps to fix the broken Centos8 repo setup - works good in CentOS8

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Python overview

Using Python on your own

The best way to learn any programming language is to practice it on your own as much as you can. If you have Python installed on your computer, you can execute the interpreter by running the python3 command (or just python on Windows), and you can close it by typing exit() or Ctrl-D.

If you don’t already have Python installed on your machine, that’s alright. We’ll explain how to install it in an upcoming course.

In the meantime, you can still practice by using one of the many online Python interpreters or codepads available online. There’s not much difference between an interpreter and a codepad. An interpreter is more interactive than a codepad, but they both let you execute code and see the results.

Below, you’ll find links to some of the most popular online interpreters and codepads. Give them a go to find your favorite.

Additional Python resources

While this course will give you information about how Python works and how to write scripts in Python, you’ll likely want to find out more about specific parts of the language. Here are some great ways to help you find additional info: 

Python history and current status

Python was released almost 30 years ago and has a rich history. You can read more about it on the History of Python Wikipedia page or in the section on the history of the software from the official Python documentation.

Python has recently been called the fastest growing programming language. If you're interested in why this is and how it’s measured, you can find out more in these articles:

For loop

for i in range(10):

print(i)

Functions and Keywords

Functions and keywords are the building blocks of a language’s syntax.

Functions are pieces of code that perform a unit of work. In the examples we've seen so far, we've only encountered the print() function, which prints a message to the screen. We'll learn about a lot of other functions in later lessons but, if you're too curious to wait until then, you can discover all the functions available here.

Keywords are reserved words that are used to construct instructions. We briefly encountered for and in in our first Python example, and we'll use a bunch of other keywords as we go through the course. For reference, these are all the reserved keywords:

False

class

finally

is

return

None

continue

for

lambda

try

True

def

from

nonlocal

while

and

del

global

not

with

as

elif

if

or

yield

assert

else

import

pass


break

except

in

raise


You don't need to learn this list; we'll dive into each keyword as we encounter them. In the meantime, you can see examples of keyword usage here.

Arithmetic operators

Python can operate with numbers using the usual mathematical operators, and some special operators, too. These are all of them (we'll explore the last two in later videos).

  • a + b = Adds a and b

  • a - b = Subtracts b from a

  • a * b = Multiplies a and b

  • a / b = Divides a by b

  • a ** b = Elevates a to the power of b. For non integer values of b, this becomes a root (i.e. a**(1/2) is the square root of a)

  • a // b = The integer part of the integer division of a by b

  • a % b = The remainder part of the integer division of a by b

def greeting(name):

print("welcome, " + name)





# 1) Complete the function to return the result of the conversion

def convert_distance(miles):

    km = miles * 1.6  # approximately 1.6 km in 1 mile

    return km

my_trip_miles = 55


# 2) Convert my_trip_miles to kilometers by calling the function above

my_trip_km = convert_distance(my_trip_miles)


# 3) Fill in the blank to print the result of the conversion

print("The distance in kilometers is " + str(my_trip_km))


# 4) Calculate the round-trip in kilometers by doubling the result,

#    and fill in the blank to print the result

print("The round-trip in kilometers is " + str(round(my_trip_km)))



----

def lucky_number(name):

  number = len(name) * 9

  result = "Hello " + name + ". Your lucky number is " + str(number)

  return result

      

print(lucky_number("Kay"))

print(lucky_number("Cameron"))



-----

# This function compares two numbers and returns them

# in increasing order.

def order_numbers(number1, number2):

    if number2 > number1:

        return number1, number2

    else:

        return number2, number1


# 1) Fill in the blanks so the print statement displays the result

#    of the function call

bigger, smaller = order_numbers(10099)

print(smaller, bigger)

Thursday, April 20, 2023

Ubuntu 18.04 Older Notes.

uget
sudo apt-add-repository ppa:plushuang-tw/uget-stable
sudo apt-get update
sudo apt-get install uget aria2

vlc
$ sudo add-apt-repository ppa:videolan/master-daily

deb http://ppa.launchpad.net/videolan/master-daily/ubuntu focal main
$ sudo apt update
$ sudo apt install vlc qtwayland5
$ sudo apt install libavcodec-extra

sudo add-apt-repository ppa:umang/indicator-stickynotes
sudo apt-get update
sudo apt-get install indicator-stickynotes


Download it from here: https://sourceforge.net/projects/pinguy-os/files/ISO_Builder/pinguybuilder_18.4-1_all-alpha.deb/download

Once downloaded ‘CD’ to the folder where it is and run:

sudo dpkg -i pinguybuilder_18.4-1_all-alpha.deb
sudo apt-get install -f

add-apt-repository ppa:ubuntuhandbook1/audacity
apt update && sudo apt install audacity

git clone http://github.com/lwfinger/rtlwifi_new.git -b extended
cd rtlwifi
make
sudo make install
reboot

apt-get install ultracopier

sudo systemctl hibernate

This did not work for me. I try pm-hibernate which did not work for me either until I added missing package uswsusp

sudo apt install uswsusp  

install libelf-dev, libelf-devel or elfutils-libelf-devel"

apt install openshot

Things has to be done after installing Linux Lite 5.6

Remove Thunderbird
apt remove thunderbird

Remove libreoffice
sudo apt-get remove --purge libreoffice*
sudo apt-get clean
sudo apt-get autoremove

Go to folder  /home/<yourusername>/.local/share/applications and delete files Libreoffice-calc, Libreoffice-writer & Libreoffice-impress
Again go to the folder  /etc/skel/.local/share/applications and delete files Libreoffice-calc, Libreoffice-writer & Libreoffice-impress

Install Deluge / Transmission
apt install deluge
apt install transmission

Install testdisk for file recovery software
apt install testdisk

#Balena-etcher download for usb-flashing (startup disk)
apt install usb-creator-gtk

Install playonlinux for MS office etc
apt install playonlinux and install MS office 2016 - 32 bit
search the opt pacakge from virtualbox.com for ubuntu and install it for VMs.

Install pip3
apt install python3-pip

Install audacity - an audio editor
apt install audacity

Install openshot - a video editor
apt install openshot

#install cubic
apt install cubic

#Remastersys (optional)
apt-get install remaster-iso

Install Xtreme Download Manager
https://itsfoss.com/xtreme-download-manager-install/

Install Libreoffice
Download the latest Libre office and extract go to DEBS directory and run the below command
dpkg -i *.deb

Install neofetch
apt install neofetch

Install mouse server
dpkg -i mouseserver

Remove orphan packages
sudo apt-get install deborphan
deborphan
orphaner

wget https://go.skype.com/skypeforlinux-64.deb
apt install ./skypeforlinux-64.deb

pdfsam for pdf manipulations

Install brave browser
sudo apt install apt-transport-https curl
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list
sudo apt update
sudo apt install brave-browser

screen recorder
apt install simplescreenrecorder

Software Ubuntu Budgie 22.04.2 LTS

Remove Thunderbird
apt remove thunderbird

Remove libreoffice
sudo apt-get remove --purge libreoffice*
sudo apt-get clean
sudo apt-get autoremove

Libreoffice latest
Download latest package from Libreoffice, extract the deb packages
https://www.libreoffice.org/download/download-libreoffice/
dpkg -i *.deb

xdm Downloader setup
https://xtremedownloadmanager.com/#downloads

vlc player - install inside the snap
snap install vlc

Download the atom deb package from the portal
dpkg -i atom*.deb
apt install -f

Deluge Torrent
apt install deluge

playonlinux wine frontend Software
apt install playonlinux - Remove this from budgie, if it fails.
2013 Office installation test - Did not support office 2016 yet

Virtualbox
Download latest from
https://www.virtualbox.org/wiki/Linux_Downloads
apt install virtualbox
apt install -f

Audio editor
apt install audacity

Install testdisk for file recovery software
apt install testdisk

Install openshot video editor
add-apt-repository ppa:openshot.developers/ppa
apt update
apt install openshot-qt python3-openshot

Install pip3
apt install python3-pip

Remove orphan packages
sudo apt-get install deborphan
deborphan

Install neofetch
apt install neofetch

Install mouse server
dpkg -i mouseserver

screen recorder with voice
apt install obs-studio

pdf manipulations
https://download.qoppa.com/pdfstudio/PDFStudio_linux64.sh
chmod +x PDFStudio_linux64.sh
./PDFStudio_linux64.sh
PDF Sam
https://github.com/torakiki/pdfsam/releases/download/v5.0.3/pdfsam-5.0.3-linux.tar.gz