Thursday, February 22, 2018

Alias command in Ubuntu 16,linux Teacher Sourav,Kolkata 09748184075

aliases can be any name other than reserved word ,it can even be same name as a command with different options,aliases can be applied on global basis or per user basis


for global basis we have to modify the file
called /etc/bashrc

for user basis the file is 
/home/username/.bashrc

let's create a custom command


the alias command will show you the already set aliases

set a alias

alias ls='ls -l'

now using the alias command you will see 
the new alias set

when we use ls using the alias it will run 
ls -l

we can perform the same thing 

by changing df to df -h

alias df='df -h'

h is for human readable format,the output of df will be shown in human readable format by default from now instead of block sizes



now let's create a command which does not exist


alias delete='rm -i'

by defining the alias delete will be available to bash will also help in tab complition when typing delete

these aliases are also going to available to shell scripts

to remove the alias

unalias delete

to make these aliases permanenet we have to aliases to the /etc/bashrc(for parmanent) or /home/username/.bashrc for just the user

firefox or chrome can not run swf files solved on ubuntu 16,Linux Teacher Sourav,Kolkata 09748184075

Edit /usr/share/mime/packages/freedesktop.org.xml as root and replace the following:


With:


And then run:

sudo update-mime-database /usr/share/mime

Friday, February 2, 2018

Create a dynamic chart automatically and change it's value dynamically when the original data is filtered or sorted using VBA,VBA Teacher Sourav,Kolkata 09748184075

Sub Macro1()

Dim ch As Shape

    Range("B13").Select
    Selection.CurrentRegion.Select
    ActiveSheet.Shapes.AddChart.Select
  
    Set ch = ActiveSheet.Shapes(1)
    ch.Name = "Chart 3"
    ActiveChart.ChartType = xlColumnClustered
    ActiveChart.SetSourceData Source:=Range("'(2)'!$B$12:$C$36")
    ActiveChart.Legend.Select
    Selection.Delete
    ActiveSheet.ChartObjects("Chart 3").Activate
    ActiveChart.PlotArea.Select
    ActiveChart.Axes(xlValue).MajorGridlines.Select
    Selection.Delete
    ch.Placement = xlFreeFloating
    Range("B13").Select
    Selection.AutoFilter
    ActiveSheet.Range("$B$12:$C$36").AutoFilter Field:=2, Criteria1:="5", _
        Operator:=xlTop10Items
    ActiveSheet.ChartObjects("Chart 3").Activate
    ActiveChart.Axes(xlCategory).Select
    ActiveChart.Axes(xlCategory).CategoryType = xlCategoryScale
    Range("C19").Select
    ActiveWorkbook.Worksheets("(2)").AutoFilter.Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("(2)").AutoFilter.Sort.SortFields.Add Key:=Range( _
        "C19"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
        xlSortNormal
    With ActiveWorkbook.Worksheets("(2)").AutoFilter.Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    ActiveSheet.ChartObjects("Chart 3").Activate
    ActiveChart.SeriesCollection(1).Select
    ActiveChart.SeriesCollection(1).ApplyDataLabels
    ActiveChart.SeriesCollection(1).DataLabels.Select
    ActiveChart.SeriesCollection(1).Select
    ActiveChart.ChartGroups(1).VaryByCategories = True
End Sub