Monday, April 13, 2020

QlikSense - Query to Find Postgres DB Size


-=- Database Sizes
select datname, pg_size_pretty(pg_database_size(datname))
from pg_database order by pg_database_size(datname);

-=- Table Sizes Query
SELECT nspname || '.' || relname AS "relation", pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema') AND C.relkind <> 'i' AND nspname !~ '^pg_toast'
ORDER BY pg_total_relation_size(C.oid) DESC;

Friday, March 2, 2018

Query list of listening ports in Windows using PowerShell


Thanks to  Techibee for the Scripts:

http://techibee.com/powershell/query-list-of-listening-ports-in-windows-using-powershell/2344


Basic Codes & Calling Function:

Calling Function:

  • Get-ListeningTCPConnections | ft -AutoSize

CODE

Function Get-ListeningTCPConnections {            
[cmdletbinding()]            
param(            
)            
            
try {            
    $TCPProperties = [System.Net.NetworkInformation.IPGlobalProperties]::GetIPGlobalProperties()            
    $Connections = $TCPProperties.GetActiveTcpListeners()            
    foreach($Connection in $Connections) {            
        if($Connection.address.AddressFamily -eq "InterNetwork" ) { $IPType = "IPv4" } else { $IPType = "IPv6" }            
                    
        $OutputObj = New-Object -TypeName PSobject            
        $OutputObj | Add-Member -MemberType NoteProperty -Name "LocalAddress" -Value $connection.Address            
        $OutputObj | Add-Member -MemberType NoteProperty -Name "ListeningPort" -Value $Connection.Port            
        $OutputObj | Add-Member -MemberType NoteProperty -Name "IPV4Or6" -Value $IPType            
        $OutputObj            
    }            
            
} catch {            
    Write-Error "Failed to get listening connections. $_"            
}           
}

Thursday, January 11, 2018

Import all CSV files from a folder into separate sheets : Merge Multiple CSV to Excel


ORIGINAL Posts:
https://stackoverflow.com/questions/12162477/importing-multiple-csv-to-multiple-worksheet-in-a-single-workbook

Working Code:
Option Explicit
Sub ImportCSVs()
'Author:    Jerry Beaucaire
'Date:      8/16/2010
'Summary:   Import all CSV files from a folder into separate sheets
'           named for the CSV filenames

'Update:    2/8/2013   Macro replaces existing sheets if they already exist in master workbook

Dim fPath   As String
Dim fCSV    As String
Dim wbCSV   As Workbook
Dim wbMST   As Workbook

Set wbMST = ThisWorkbook
fPath = "C:\test\"                  'path to CSV files, include the final \
Application.ScreenUpdating = False  'speed up macro
Application.DisplayAlerts = False   'no error messages, take default answers
fCSV = Dir(fPath & "*.csv")         'start the CSV file listing

    On Error Resume Next
    Do While Len(fCSV) > 0
        Set wbCSV = Workbooks.Open(fPath & fCSV)                    'open a CSV file
        wbMST.Sheets(ActiveSheet.Name).Delete                       'delete sheet if it exists
        ActiveSheet.Move After:=wbMST.Sheets(wbMST.Sheets.Count)    'move new sheet into Mstr
        Columns.Autofit             'clean up display
        fCSV = Dir                  'ready next CSV
    Loop

Application.ScreenUpdating = True
Set wbCSV = Nothing
End Sub

Wednesday, February 29, 2012

Now,I am too far from my usual...

Now,I am too far from my usual...
The above lines, convey just 1 thing to me..

I am not the same..
I am not the same, who i was..
I am not the same, who i have to be..

I am a stronger Believer of words...
"Anything that happens that happens for a reason.."

My Inner Mind, will never accept a defeat...
Will Never Ever accept a defeat, for anything...

It just says 1 thing, 1 small thing every-time to me...
"Anything that happens that happens for a reason.."

///////////////////////////////////////////////////////////////////////////

FB Time Line: ( Not A New trend Setter.. Its my Time Line....)

My 1st Day. / Cute/Lovely Kid.. Enjoying from 7th Dec 1986 ... Taj Hosp.MDU
My Fun Edu. / Crying / Running away.. Exp. since 1989 ... Little Buds.STR
My Real Edu. / Radius of my Believing..Exp. since 1991 ... RKV.STR
My Edu. Life / Radius of my Learning ..Exp. since 15-Aug-2004... CEG.CHE
My Prof. Life/ Radius of my Earning .. Exp. since 31-Aug-2009... ACC.CHE
My Prof. Life(2)/ Radius of my Exposure.. Exp. since 31-Jan-2011... ICON.SG

//////////////////////////////////////////////////////////////////////////

Though things look compact and closed between the boundaries.. They are not..
The Expansion, keep progressing..
It's expanding its wave ..
The Wave of Interference , and Intersections...

Now,I am too far from my usual...
I accepted the Interference...
I accepted the Intersections..

And, Now,I am too far from my usual...
The definitions of Week Days ..Meaning of Working Days changed over the time line..
The definitions of Weekends .. Fun Weekends changed over the time line..

Now,I am too far from my usual...
Its now, Just me , my Fly Mobile and my Think-Pad..

Though , Years has rolled out::Month/Week has passed away..
My Days, are still waiting for the unwritten feelings of my life..
My Clock is waiting to stop, for the freezing moment of my life..

"The most wonderful moment...
In the life is just the second..
Which we breath.. Which make it
Hot as Chilly...
Cool as Ice Cream
Ever Tasty as the taste of Life." ..... 17-01-2010 19:05 PM

Now,I am too far from my usual...
I am now Grown up.. not that Cute/Lovely Kid.. , I am What i am ..!!
I am not Crying / Running away .., I am What i am ..!!
I am not Believer of un-believable things .., I am What i am ..!!
I am not stopped with My Learning .., I am What i am ..!!
I am not slaved to My Earning.., I am What i am ..!!
I am not addicted to My Exposure.., I am What i am ..!!
Though, Now,I am too far from my usual.., I am What i am ..!!


Achiever ...!!!
The Word that defines me..
The Word that drives me ..
The Word that make me happy all time,
The Word that create path for me..
The Word I Trust..

Future Time-lines, Exp. Since Now..!!

achiever-dreamz::

Sunday, April 11, 2010

Is it Right ...?

The last day of the previous week(Saturday / 10-04-2010), I dont know whether the thing that happened is right or wrong.?
I can't imagine people will behave so strange ..
I couldn't digest what people have done ..
How can they just pass on , knowing that some one is waiting there for them..
How can they just move on , when some one is just being there for them..
Is it Right for me to be there for them, or is it Right for them to leave..

I know that both can't be right together at any point of time..
But which is Right ..? Is it Right to stick on..?

Saturday, March 6, 2010

Never ever.....

I dont know what i am scribbling,


I dont know y i am scribbling,

i dont even know y i am doing this,

but i will never ever, forget that,

i should nver do what i ve done.

never ever...!!

Saturday, February 27, 2010

Just a voice that we never heard

Its just a voice we never heard,
never ever cared to hear,
Thats the one which we ignore at all time,
just pretending that we
never ever heard it.

That voice which we never heard,
Always speaks the truth,
The truth you have to hear,
The truth you have to follow,But
just pretending that we
never ever heard it.

The innver voice,
Which i have never ever heard,
Told me one and one only thing to me.

The one thing which i have listened,
The one thing which i have heared,
Tells me with all my life,
Never ever break a heart by not hearing to it,
Never ever break a heart by not understanding it.