Showing posts with label Mac OS. Show all posts
Showing posts with label Mac OS. Show all posts

Sunday, September 11, 2022

Make PPK to Pem using Mac terminal

sudo port install putty
or
brew install putty


This will also install puttygen. To get puttygen to output a .PEM file:
puttygen privatekey.ppk -O private-openssh -o privatekey.pem

Once you have the key, open a terminal window and:
ssh -i privatekey.pem user@my.server.com

The private key must have tight security settings otherwise SSH complains. Make sure only the user can read the key.

chmod go-rw privatekey.pem

Wednesday, November 17, 2021

How to install Composer in MacOS

Install download the composer using the following curl command in the terminal:
curl -sS https://getcomposer.org/installer | php
 
After the command, you will have composer.phar file in the current directory and the composer command is available as: 

 php composer.phar [composer commnad] 

In order to make composer available globally, you have to move the recently downloaded composer.phar to local user’s bin folder as follow: 

sudo mv composer.phar /usr/local/bin/

 go to /usr/local/bin folder . 
You can click Shift + Command + G to open the dialog to go to folder. move the recently downloaded composer.phar in the usr/local/bin folder. 

We want to run Composer with having to be root al the time, so we need to change the permissions:
 sudo chmod 755 /usr/local/bin/composer.phar
create a alias using command:

Next, we need to let Bash know where to execute Composer:

 nano ~/.bash_profile
Add this line below to bash_profile and save
alias composer="php /usr/local/bin/composer.phar"
and then run this command:

 source ~/.bash_profile

Finally, run: composer --version

Now, you can access the composer from the terminal simply using the composer command.




Install PhpStorm on Mac OSX

About the App
Install the App
  1. Press Command+Space and type Terminal and press enter/return key.
  2. Run in Terminal app:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2> /dev/null
    and press enter/return key. If you are prompted to enter your Mac's user password, enter it (when you type it, you wont see it on your screen/terminal.app but it would accept the input; this is to ensure no one can see your password on your screen while you type it. So just type password and press enter, even if you dont see it on your screen). Then wait for the command to finish.
  3. Run:
    brew install phpstorm

    Done!

    You can now use PhpStorm.

Sunday, August 29, 2021

Install Telnet on MacOS using Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install telnet

Tuesday, August 3, 2021

How to generate SSH keys in Mac OS

To generate SSH keys in Mac OS X, follow these steps:

1. Enter the following command in the Terminal window.ssh-keygen -t rsa
This starts the key generation process. When you execute this command, the ssh-keygen utility prompts you to indicate where to store the key.

2. Press the ENTER key to accept the default location. The ssh-keygen utility prompts you for a passphrase.

3. Type in a passphrase. You can also hit the ENTER key to accept the default (no passphrase). However, this is not recommended.
Please note that you will need to enter the passphrase a second time to continue.

After you confirm the passphrase, the system generates the key pair.

Your identification has been saved in /Users/user/.ssh/id_rsa.

Your public key has been saved in /Users/user/.ssh/id_rsa.pub.

The key fingerprint is:

ae:89:72:0b:85:da:5a:f4:7c:1f:c2:43:fd:c6:44:38 user@mymac.local

The key's randomart image is:

+--[ RSA 2048]----+

|                 |

|         .       |

|        E .      |

|   .   . o       |

|  o . . S .      |

| + + o . +       |

|. + o = o +      |

| o...o * o       |

|.  oo.o .        |

+-----------------+

Your private key is saved to the id_rsa file in the .ssh directory and is used to verify the public key you use belongs to the same cloud server. It's important to never share your private key with anyone, it is equivalent of your password!

Your public key is saved to the id_rsa.pub file and it is the key you'll upload to our cloud service. You can save this key to the clipboard by running this:

pbcopy < ~/.ssh/id_rsa.pub

or

cat ~/.ssh/id_rsa.pub


Thursday, April 15, 2021

Install Composer in MacOS Catalina

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Local or specific Directory: 
php composer-setup.php --install-dir=bin --filename=composer

Global: 
mv composer.phar /usr/local/bin/composer




Note: If the above fails due to permissions, you may need to run it again with sudo.
Note: On some versions of macOS the /usr directory does not exist by default. If you receive the error "/usr/local/bin/composer: No such file or directory" then you must create the directory manually before proceeding: mkdir -p /usr/local/bin.


You can also follow instruction from: https://getcomposer.org/download/






Friday, March 19, 2021

Disable Apacche in Mac

 sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist

How to get Ranking of the Students in Excel using RANK Function

=RANK(number,ref,[order]) To rank in descending order, we will use the formula =RANK(B2,($C$5:$C$10),0) If we want unique ranks, we can use...