Skip to content

Instantly share code, notes, and snippets.

View jagad89's full-sized avatar

Bhavin Jagad jagad89

  • Vadodara, Gujarat
View GitHub Profile
@jagad89
jagad89 / cpu_util.php
Created April 24, 2023 11:19
finding percentage cpu utilization and top 10 processes
<?php
$ideal = exec('echo ""$(vmstat 1 2|tail -1|awk \'{print $15}\')""');
$cpu = 100 - $ideal;
echo $cpu;
exec('ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10',$top);
echo '<pre>'.json_encode($top);
@jagad89
jagad89 / notes.md
Last active November 5, 2022 06:12
aws certified cloud practitioner notes

Cloud computing is delivering comuting services over the internet.

Types of Cloud services provided by Amazon

  • Computing example: EC2, Lambda
  • Netwroking example: VPC, Direct Connect
  • Storage example: S3, EBS
  • Analytics
@jagad89
jagad89 / composer helper.txt
Created December 9, 2020 10:22
composer memory exhausted
$ COMPOSER_MEMORY_LIMIT=-1 composer require <package name>
$ COMPOSER_MEMORY_LIMIT=-1 composer update
@jagad89
jagad89 / Docker
Last active August 23, 2020 13:49
docker notes
docker community installation
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
Basic docker commands
=======================
Run - Start a container
e.g
docker run nginx
Above command will download nginx latest image and run the container.
@jagad89
jagad89 / Kotlin Basics.md
Last active February 10, 2020 18:57
Kotlin learning notes

My Kotlin notes

Typical hello world program with kotlin

fun main(){
    // Print Hello Kotlin
    println("Hello Kotlin")
    // it's time to say, "GOOD BYE SEMICOLON(;)"

    /* TOPIC: Variable */
@jagad89
jagad89 / change php version ubuntu.txt
Last active July 4, 2019 10:20
change php version ubuntu
Switch php version from x.y to p.q in apache
sudo a2dismod php7.2
sudo a2enmod php5.6
sudo service apache2 restart
----------------------------------------
Switch php cli version
sudo update-alternatives --config php
There are 3 choices for the alternative php (providing /usr/bin/php).
@jagad89
jagad89 / ssl_install.txt
Created April 24, 2019 11:11
Letsencrypt cert installation
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python-certbot-apache
sudo certbot --apache
@jagad89
jagad89 / Angular note
Last active February 2, 2019 16:35
Angular note
Install angular cli
> npm install -g @angular/cli
Create project with Angual CLI
> ng new <project-name>
eg.
> ng new blog
Start Angular server and open app in browser
> ng serve --open
@jagad89
jagad89 / ts-class.ts
Created June 29, 2018 13:21
Typescript Class example
class Characters {
firstname: string;
lastname: string;
constructor(fs: string, ls: string) {
this.firstname = fs;
this.lastname = ls;
}
getFullname() : string {
@jagad89
jagad89 / Restoring large file in MSSQL
Created May 9, 2016 15:02
Restoring or Import large file in MSSQL using sqlcmd
sqlcmd -S <Servername> -U <Username> -P <password> -d <Databasename> -i <filename> -a 32767