Thursday, December 27, 2018

Using Zypper and RPM to install ,uninstall and manage packages ,patches and updates on SUSE Enterprise Linux,Linux Teacher Sourav,Kolkata 08910141720

install something

sudo zypper install packagename

it will install the package with the dependancies

for example to install git-core

sudo zypper install git-core


now to remove the package

sudo zypper remove git-core


as you might seee when installing the git-core package
you have  a dependency called perl-error which was installed
but this is not removed when using sudo zypper remove git-core

so to remove it manually

 sudo zypper remove perl-Error

however let us do the proper way of removing a package with the dependencies

lets install git-core again

 sudo zypper install git-core

after installing we need to use this to remove git-core as well as
the dependency perl-error

sudo zypper rm --clean-deps git-core


to see all our missing dependecies

 sudo zypper verify

this will most likely solve any dependency issue the system is having

to get the necessary patches/updates

sudo zypper patch



to include the optionalpatches

sudo zypper patch --with-optional


to get a summary list of security patches recommended patches

and optional patches


sudo zypper patch-check

the difference between patches and updates is

patches which are mostly associated with kernel are generally
backward compatible

but updates are not always backward compatible

to list all the patches

sudo zypper list-patches

to update the system

sudo zypper update

after update to reflect the changes to some files

sudo zypper ps -s

to see if there is any more update to perform

sudo zypper list-updates

to get information about a package

rpm -q -i wget


to list all the files in the package

 rpm -q -l wget

to see all the documentation files in a package

rpm -q -d wget

to see all the configuration files in a package

rpm -q -c wget

to see the scripts those are used for installing and uninstalling

rpm -q --scripts wget











Managing repositories in SUSE Enterprise Server,Linux Teacher Sourav,Kolkata 08910141720

list repositories
zypper lr

the output will show the current repositories


to get more detailed out about repositories

zypper repos -d

to add your own or any generic repository

sudo zypper addrepo http://example.com/repo myrepo

here myrepo is the alias of this repo


now to see if this new repo is added

zypper lr


now to remove this repo

we can do this

sudo zypper removerepo 7

this number is for myrepo ,we can see this number by the command

zypper lr


to check if the new repo is removed or not

zypper lr

we could have removed the repo by using the alias in place of number

sudo zypper removerepo myrepo

Monday, December 24, 2018

Nice terminal trick if you forget to put sudo before a command,Linux Teacher Sourav,Kolkata 08910141720

Sometimes a command need sudo before it as it requires permissions,we can write 

sudo !!

that will run the last command with sudo appearing in front of it

Find the age of my suse enterprise linux system,Linux Teacher Sourav,Kolkata 08910141720

I have a trial of suse enterprise linux server which gives me two months to play around,I want to know how many days have gone by after installation ,this is the way worked for me

ls -alp /etc/ssh/ssh_host_dsa_key.pub | cut -d " " -f6


Source:https://serverfault.com/questions/221377/how-to-determine-the-age-of-a-linux-system-since-installation

Wednesday, December 5, 2018

Creating Dynamic Reports from Excel Data using VBA,VBA Teacher Sourav,Kolkata 08910141720

Dim sdsheet, ersheet As Worksheet

k = ActiveWorkbook.Sheets.Count

    For i = k To 1 Step -1
        t = Sheets(i).Name
        If t = "Emp_rpt_insurance" Then
            Application.DisplayAlerts = False
                Sheets(i).Delete
            Application.DisplayAlerts = True
          
        End If
    Next i
On Error Resume Next
  ActiveWorkbook.Sheets.Add(After:=ActiveWorkbook.Sheets(ActiveWorkbook.Sheets.Count)).Name = "Emp_rpt_insurance"
Set sdsheet = ThisWorkbook.Sheets("Sortsheet")
Set ersheet = ThisWorkbook.Sheets("Emp_rpt_insurance")
If sdsheet.Cells(Rows.Count, 1).End(xlUp).Row = 1 Then
sdlr = 2
Else
sdlr = sdsheet.Cells(Rows.Count, 1).End(xlUp).Row
End If
y = 2

ersheet.Cells(1, 1) = "Emp ID"
ersheet.Cells(1, 2) = "First Name"
ersheet.Cells(1, 3) = "Last Name"
ersheet.Cells(1, 4) = "Address"
ersheet.Cells(1, 5) = "Zipcode"
ersheet.Cells(1, 6) = "Mail"
ersheet.Cells(1, 7) = "Date Of Birth"
ersheet.Cells(1, 8) = "Phone"








For x = 2 To sdlr
If (UCase(sdsheet.Cells(x, 14)) = "A") And (CInt(sdsheet.Cells(x, 17)) >= 40) Then
ersheet.Cells(y, 1) = sdsheet.Cells(x, 1)

ersheet.Cells(y, 2) = sdsheet.Cells(x, 2)

ersheet.Cells(y, 3) = sdsheet.Cells(x, 3)

ersheet.Cells(y, 4) = sdsheet.Cells(x, 5)

ersheet.Cells(y, 5) = sdsheet.Cells(x, 9)

ersheet.Cells(y, 6) = sdsheet.Cells(x, 12)

ersheet.Cells(y, 7) = sdsheet.Cells(x, 15)

ersheet.Cells(y, 8) = "XXX-XXX-" & Right(sdsheet.Cells(x, 10), 4)

y = y + 1
End If



Next x


ersheet.Cells.Columns.AutoFit

'If ersheet.Cells(Rows.Count, 1).End(xlUp).Row = 1 Then
'erlr = 2
'Else
'erlr = ersheet.Cells(Rows.Count, 1).End(xlUp).Row
'End If
'