Saturday, August 26, 2023

Shell script to find Public IP address in GCP

 Lets say you have a public ip that you bought and assigned to one of the instance in GCP project, you can use the below shell script to find:

In below code I am filtering the name of project that starts with cust. First login with below command:


gcloud auth login


#!/bin/bash


# Get a list of project IDs with names starting with "cust"

project_ids=$(gcloud projects list --format="value(projectId)" --filter="name:cust*")


# Loop over each project ID

for project_id in $project_ids; do

    echo "Checking project: $project_id"

    

    # Get a list of instance names in the current project

    instance_names=$(gcloud compute instances list --project "$project_id" --format="value(name)")


    # Loop over each instance in the current project

    for instance_name in $instance_names; do

        # Get the public IP address of the instance

        public_ip=$(gcloud compute instances describe "$instance_name" --project "$project_id" --format="value(networkInterfaces[0].accessConfigs[0].natIP)")

        

        echo "Instance: $instance_name, Public IP: $public_ip"

        echo "Instance: $instance_name, Public IP: $public_ip" >> /tmp/ip_details.txt

    done

done


Thursday, June 15, 2023

Sarjapur Road Apartment Price list 2023 - Bengaluru India

₹ Per SQFT Apartment SQFT
2.10 Cr 11345 Meridian Park Phase I at The Prestige City 1851
1.35 Cr 12582 Mana Capitol 1073
1.45 Cr 9680 Godrej Park Retreat 1498
90 L 12676 Godrej Park Retreat 710
61.50 L 7201 Engrace By Modern Spaaces 854
70 L 8413 Godrej Park Retreat 832
1.35 Cr 12500 Mana Capitol 1080
90 L 8160 Godrej Park Retreat 1103
80 L 9615 Godrej Park Retreat 832
1.40 Cr 9831 Godrej Park Retreat 1424
1.40 Cr 13333 Godrej Park Retreat 1050
82 L 6914 Engrace By Modern Spaaces 1186
2.15 Cr 9372 Tattvam Woodsvale 2294
1.70 Cr 9424 Tattvam Woodsvale 1804
1.55 Cr 11397 Sobha Primrose 1360
90 L 10135 Godrej Park Retreat 888
1.90 Cr 13828 SJR Palazza City 1374
85 L 11333 Mana Capitol 750
7.30 Cr 18393 NCC Urban Green Province 3969
84 L 7000 per Vakil Satellite Township 1200
1.35 Cr 12857 Mana Capitol 1050
1.21 Cr 11353 Assetz 63 Degree East 1072
1.15 Cr 10768 Godrej Park Retreat 1068
6.02 Cr 10033 per Ferns Rainbow Residency 6000
72 L 7500 SE Sunny Acura 960
47.50 L 10021 Godrej 24 474
1.25 Cr 11905 Assetz 63 Degree East 1050
1.63 Cr 19176 Assetz 63 Degree East 850
55.80 L 10449 DSR Parkway 534
2.10 Cr 10000 Assetz 63 Degree East 2100
39.99 L 7780 Eden Park at The Prestige City 514
44.24 L 4999 Om Sai Heritage 885
83.91 L 8123 Ahad Opus 1033
82.47 L 6561 Bricks & Milestones Wonderwall 1257
26.31 L 5002 Bavisha Gardeniaa Phase 3 526
50.96 L 8128 Ahad Serenity 627
55.65 L 4375 Sands Gateway 1272
56.49 L 7215 Eden Park at The Prestige City 783
36.50 L 4148 Tulasi Premier 880
88.72 L 8125 Ahad Serenity 1092
63.63 L 5250 Suvastu Kings Square 1212
55.65 L 5250 Suvastu Kings Square 1060
2.30 Cr 10455 Tattvam Woodsvale 2200
1.13 Cr 8124 Ahad Serenity 1393
44.37 L 4250 Sovereign Sri Nilaya 1044
40.47 L 4564 Shri Balaji Ocean 887
1.40 Cr 10034 Godrej Lake Gardens 1398
57 L 8120 Ahad Serenity 702
77 L 8415 Brigade Parkside East 915
40.12 L 4250 Sovereign Sri Nilaya 944
89.07 L 8540 Godrej Lake Gardens 1043
35.29 L 4560 Shri Balaji Ocean 774
47.43 L 4250 Sovereign Sri Nilaya 1116
52.32 L 8125 Ahad Serenity 644
39.64 L 4999 Om Sai Heritage 793
25.30 L 5001 Bavisha Gardeniaa Phase 3 506
15.57 L 4375 Bavisha Urban Homes 356
61.84 L 6565 Bricks & Milestones Wonderwall 942
33.91 L 4176 Tulasi Premier 812
23.97 L 4375 Bavisha Urban Homes 548
73.46 L 5748 Newark Springs 1278
39.90 L 5250 Suvastu Kings Square 760
54.43 L 7810 Godrej Lake Gardens 697
1.44 Cr 12098 Sobha Royal Pavilion 1196
82.47 L 7001 Bricks & Milestones Wonderwall 1178
85.43 L 8900 GRC Shreekrish 960
1.16 Cr 10219 GRC Shreekrish 1136
94.34 L 6999 Bricks & Milestones Wonderwall 1348
37.07 L 5334 Bavisha Gardeniaa Phase 3 695
1.35 Cr 12097 Sobha Royal Pavilion 1118
1.01 Cr 9476 DSR Highland Greenz 1067
86.47 L 9524 DSR Highland Greenz 908
85 L 8057 Godrej Park Retreat 1055
75.79 L 8662 Ahad Serenity 875
66.21 L 12733 Mana Capitol 520
1.71 Cr 12103 Sobha Royal Pavilion 1413
1.04 Cr 8667 Godrej 24 1200
73.51 L 8669 Godrej 24 848
57 L 8663 Ahad Serenity 658
25.30 L 5328 Bavisha Gardeniaa Phase 3 475
67.85 L 6288 Bhavya Lake Vista 1079
2.02 Cr 12103 Sobha Royal Pavilion 1674
81.97 L 8712 Bricks & Milestones Wonderwall Phase II 941
39.99 L 8297 Eden Park at The Prestige City 482
50.96 L 8667 Ahad Serenity 588
61.84 L 6996 Bricks & Milestones Wonderwall 884
90 L 10588 Godrej Park Retreat 850
49.18 L 9837 DSR Parkway 500
1.07 Cr 10899 DSR Parkway 989
37.07 L 4996 Bavisha Gardeniaa Phase 3 742
1.46 Cr 10765 DSR Parkway 1357
88.47 L 9524 DSR Highland Greenz 929
1.27 Cr 5100 per Odion The Woods of East Phase 3 2500
1.24 Cr 3100 per Golden Serenity 4000
23 L 1983 per ESCON Adithya Homes 1160
37.20 L 3100 per Golden Serenity 1200
59.98 L 3999 per Confident Platinum 1500
61.20 L 5100 per Odion The Woods of East Phase 3 1200
1.19 Cr 3999 per Confident Platinum 3000
77 L 8974 Brigade Parkside East 858
43.68 L 5295 Iconest 4 825
1.28 Cr 9734 Meda Heights 1325
33.28 L 4668 Bavisha Urban Homes 713
73.05 L 8655 Nikhar Aventino 844
1.39 Cr 9994 Meridian Park Phase I at The Prestige City 1399
47.65 L 5295 Iconest 4 900
64 L 7931 CLPD GR Sunshine 807
1.98 Cr 9949 JRC Wild Woods 1999
94.08 L 6533 Bricks & Milestone Wonderwall Phase III 1440
88.79 L 8662 Ahad Opus 1025
47 L 8333 Godrej Lake Gardens 564
90 L 10702 Brigade Gem 841
83.91 L 8669 Ahad Opus 968
28.01 L 6267 Bhavisha Bentley Goldberg 447
4.60 Cr 15727 Nambiar Bellezea 2925
4.49 Cr 23410 Mana Foresta 1918
62.70 L 5225 per Smaya Jade Nester 1200
78 L 2909 per Ozone KNS Oasis 2681
90 L 11392 Godrej Park Retreat 790
60 L 6865 Mythri Sapphire 874
58.56 L 7065 Green Home Anees Enclave 829
99.81 L 8481 Premier Inspira Maplewood 1177
1.32 Cr 10698 Godrej Lake Gardens 1234
44.99 L 9866 Godrej Park Retreat 456
52.67 L 5732 Bavisha Grey Stone 919
86 L 9110 Godrej Lake Gardens 944
80.02 L 8605 Premier Inspira Maplewood 930
33.14 L 4668 Bavisha Urban Homes 710
46 L 5111 RRL Nature Woods 900
23.90 L 4669 Bavisha Urban Homes 512
46.15 L 6262 Bricks & Milestone Wonderwall Phase III 737
34.91 L 5733 Bavisha Grey Stone 609
62.99 L 8410 Godrej Park Retreat 749
54 L 5104 RRL Nature Woods 1058
54.43 L 8337 Godrej Lake Gardens 653
26.91 L 5195 RRL Nature Woods 518
1.06 Cr 8481 Premier Inspira Maplewood 1252
1.11 Cr 10129 JRC Wild Woods 1098
36 L 4800 RRL Nature Woods 750
49.54 L 7927 CLPD GR Sunshine 625
30.81 L 5196 RRL Nature Woods 593
49 L 9280 Brigade Parkside East 528
1.10 Cr 7333 per Pionier Lake Dew Residency 1500
95 L 7197 per Pionier Lake Dew Residency 1320
50 L 5225 per Smaya Jade Nester 957
1.19 Cr 2989 per Ozone KNS Oasis 4000
78.37 L 5225 per Smaya Jade Nester 1500
1.09 Cr 11857 DSR Highland Greenz 923
70.53 L 11915 DSR Highland Greenz 592
1.35 Cr 9000 per Confident Prime 1500
3.45 Cr 7790 per Ranka PalmLakeside 4431
1.71 Cr 7678 per Ranka PalmLakeside 2233
1.56 Cr 4774 per Smaya Jade Nester 3268
89.07 L 9108 Godrej Lake Gardens 978
1.15 Cr 9939 Brigade Gem 1157
56.68 L 6263 Bhavisha Bentley Goldberg 905
1.09 Cr 9732 Meda Heights 1125
72.99 L 9732 Meda Heights 750
70.98 L 8667 Ahad Opus 819
41.68 L 6269 Bhavisha Bentley Goldberg 665
1.40 Cr 10700 Godrej Lake Gardens 1311
1.47 Cr 10598 ND Passion Elite 1387
5.17 Cr 15727 Nambiar Bellezea 3291
67.97 L 7117 Jhanavi Noreste 955
6.50 Cr 10156 per Shubh Enclave 6400
78 L 8041 Mana Karmel 970
58 L 6800 Ahad Serenity 853
5 Cr 10870 Sunny Brooks 4600
85 L 7727 Godrej Park Retreat 1100
94 L 7176 Engrace By Modern Spaaces 1310
70 L 7231 DSR Highland Greenz 968
48 L 9284 DSR Highland Greenz 517
1 Cr 8666 DSR Highland Greenz 1154
4.90 Cr 12250 Prestige Summer Fields 4000
1 Cr 10787 Assetz 63 Degree East 927
2.56 Cr 16853 Prestige Elm Sunnyside 1519
3.65 Cr 11812 Nambiar Bellezea 3090
7.25 Cr 24660 Prestige Summer Fields 2940
5.17 Cr 11804 Nambiar Bellezea 4380
1.72 Cr 12981 SJR Palazza City 1325
1.62 Cr 11196 DSR Parkway 1447
4 Cr 13889 Greenwood Regency 2880
2.16 Cr 7013 Akruti Ark 3080
89 L 9054 Golden Bhuvana Greens 983
1.19 Cr 9444 JRC Wild Woods 1260
44.87 L 4488 Mamtha Elite 1000
1.16 Cr 9060 JRC Wild Woods 1287
66.90 L 5661 Ahad Meadows 1182
87.10 L 8375 Sai Krishna Elite 1040
78.69 L 5246 per Tattvam Woodsvale 1500
1.50 Cr 12594 Godrej Park Retreat 1191
89.99 L 8107 Godrej Park Retreat 1110
1.40 Cr 9655 Godrej Park Retreat 1450
46 L 4792 RRL Nature Woods 960
77.40 L 7500 ND Passion Elite 1032
51.73 L 4460 Mamtha Elite 1160
94.08 L 6125 Bricks & Milestone Wonderwall Phase III 1536
1.44 Cr 11348 Sobha Royal Pavilion 1275
2.09 Cr 8904 JRC Wild Woods 2356
1.03 Cr 9368 Meridian Park Phase I at The Prestige City 1110
90.22 L 6435 Engrace By Modern Spaaces 1402
1.50 Cr 8523 Bricks & Milestones Wonderwall Phase II 1760
1.30 Cr 12683 Godrej Park Retreat 1025
61.14 L 5874 Bhavisha Bentley Goldberg 1041
2.70 Cr 13500 SJR Palazza City 2000
37.84 L 4527 Mamtha Elite 836
66.21 L 11952 Mana Capitol 554
38.43 L 3749 Sovereign Santhinivasa 1025
60 L 6054 Confident Snow Flake 991
58.83 L 5657 Akruti Ark 1040
53.54 L 4751 Abhee Lotus 1127
59.62 L 7056 Confident Snow Flake 845
42.37 L 4750 Abhee Lotus 892
27.61 L 5500 Ahad Serenity 502
1.25 Cr 10927 Assetz 63 Degree East 1144
62.70 L 5252 Upkar Vandana Spring Woods 1194
64.51 L 5249 Upkar Vandana Spring Woods 1229
74.42 L 6500 Ahad Serenity 1145
89 L 11266 Godrej Park Retreat 790
3.65 Cr 24779 Mana Foresta 1473
89.42 L 7643 Corporate Suncity Gloria Block B 1170
98.97 L 13595 Sattva Signet 728
3.81 Cr 12200 KMB La Palazzo 3126
10.16 Cr 19976 Nambiar Bellezea 5086
93 L 10941 Godrej Park Retreat 850
1.25 Cr 19231 Assetz 63 Degree East 650
1.90 Cr 15200 Assetz 63 Degree East 1250
2.70 Cr 13500 August Grand 2000

Jenkins Active Choice Parameter - PT_SINGLE_SELECT

 In Jenkins Active Choice Parameter, PT_SINGLE_SELECT is the simplest form where it returns the values in list. In UI it appears as a dropdown.


Example:

        parameters([

            [$class: 'ChoiceParameter', 

                choiceType: 'PT_SINGLE_SELECT', 

                description: 'Select the Environment to Run', 

                filterLength: 1, 

                filterable: false, 

                name: 'RunEnv', 

                script: [

                    $class: 'GroovyScript', 

                    fallbackScript: [

                        classpath: [], 

                        sandbox: true, 

                        script: 

                              "return['Could not get The environemnts']"

                    ], 

                    script: [

                        classpath: [], 

                        sandbox: true, 

                        script:

                              "return['NONE','prod1', 'prod2', 'prod3', 'prod4', 'prod5', 'prod6', 'prod7']"

                            

                    ]

                ]

            ]

)]


Above code is what I use in Declarative Jenkins Pipeline. You can just copy paste the code in a file and it should work fine. You don't need the pipeline{} code. 


Pipeline{} code will come under above code. Bit weird but works.

Also, you need approve the above. code in Jenkins -> Manage Jenkins -> In Process Script Approval.


If the Jenkins is managed by external team, then only way is to request them to approve. 

Thursday, July 12, 2018

Sync sync sync to clear cache RAM in Linux

If you want to clear the RAM in cache, which you can see in free command use the following.

sync; echo 1 > /proc/sys/vm/drop_caches

After issuing the command wait for 5 to 10 minutes. It will clear.

Free output when cache was full.


In above image we can see almost 112GB is cached.


Friday, June 29, 2018

Command to check partition in Linux

In Fedora Linux below command can be used to check storage partition.

cat proc partitions

Sample output:

Major is the driver version. Minor tells us which disk or which controller it is using. Blocks is the size of disk in blocks. We can see the storage sda has seven partition sda, sda1, sda2 to sda6.

Alternative command:

You can use fdisk and then p command to print info about the partition.


Thursday, June 28, 2018

Get SAR report in CSV

To get SAR report in CSV use sadf command.

To get memory report


sadf -d /var/log/sa/sa20 -- -r

In the above command sa20 is sar file of day 20. You can give any value between 1 to 31. 
-r gets you memory report.

Instead -r you can use following options:

To get report for CPU, Disk etc

# -d activity per block device
# -b IO and transfer rates
# -q load
# -u cpu
# -r memory utilization
# -R memory
# -B paging
# -S swap space utilization
# -W swap stats
# -n network
# -v kernel filesystem stats

# -w  context switches and task creation

CSV report will be needed if you wanted to visualize it in Excel or plotting in software such as Tableau, SAS, Python, PHP, JavaScript etc

Wednesday, June 27, 2018

Script to get name of the program running

Use the below line to get name of the program that you are currently running inside the script. This will be mostly used if you want to display how to run the script you have created.

To get current program name inside the script:

script_name=$(basename $0)

You can use it like below:

if [[ $# -eq 0 ]]; then
echo "$script_name -h for more information" 1>&2
exit 254
fi