Thursday, June 13, 2024

"Best speech ever": Roger Federer's address to graduates

Roger Federer offered three pieces….well four pieces…of advice in his Commencement address at Dartmouth

1: Effortless is a myth.

People often mean it as a compliment but “the truth is,” he said, “I had to work very hard to make it look easy.”

We should be proudest of the victories we earn when the competition is fierce.

“Because they prove that you can win not just when you are at your best, but especially when you aren’t. Most of the time it’s not about having a gift. It’s about having grit.”

2: It’s only a point—perfection is impossible.

“When you’re playing a point, it is the most important thing in the world. But when it’s behind you, it’s behind you. This mindset is really crucial, because it frees you to fully commit to the next point and the next one after that with intensity, clarity, and focus.”

He shared that a sign of becoming a champion “is overcoming hard moments.”

“The best in the world are not the best because they win every point. It’s because they know they’ll lose again and again, and have learned how to deal with it.”

3: Life is bigger than the court.

He underscored the importance of embracing the fullness of life and finding fulfillment in many ways.

“As a student at Dartmouth, you picked a major and went deep. But you also went wide. Engineers learned art history, athletes even sang a cappella, and computer scientists learned to speak German.”

And that “leaving a familiar world behind and finding new ones is incredibly, deeply, wonderfully exciting.”

4, His last lesson: For our forehand, we should use an Eastern grip while keeping our knuckles slightly apart without squeezing the grip too hard. And remember, it starts with footwork and the take-back is as important as the follow-through.

“It’s just good technique,” he said.

His full speech to our Class of 2024: 

https://www.youtube.com/watch?v=pqWUuYTcG-o

https://home.dartmouth.edu/news/2024/06/2024-commencement-address-roger-federer

 

Wednesday, April 26, 2023

Command to check if particular server URL supports forward secrecy

 These ciphers are employed if Forward Secrecy is supported by server

 openssl s_client -connect server.com:443 -cipher "ECDHE, EECDH"

 openssl s_client -connect server.com:443 -cipher "DHE, EDH"

If the command results in a “sslv3 alert handshake failure” error, the Forward Secrecy property is not supported by the server. 

Command to check ATS configuration of URL in mac

 The below terminal command helps us get detailed ATS check on specific URL

nscurl --ats-diagnostics <URL>

Wednesday, March 22, 2023

How to configure PHP and Apache with Mac OS Monterey and above

 PHP has been removed since Monterey 

So we're going to install latest PHP using Home brew and edit the configuration files of apache web server so PHP web hosting is supported from local machine.

 - If you don't have Homebrew installed , use the below terminal command to set up home brew

     /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

 - Once the brew set up is success , feed the below command in terminal to instal latest PHP 

    brew install php

- start php using below command

   brew services start php

 - create sites directory under current user root directory using below command

     sudo mkdir ~/Sites

- open apache folder and create username.conf using below terminal command

     cd /etc/apache2/users
     sudo nano username.conf

- Feed the below text into the file and press Ctrl+o to save
    
    <Directory "/Users/username/Sites/">
      AllowOverride All
      Options Indexes MultiViews FollowSymLinks 
      Require all granted
    </Directory>

 - Now let's open httpd.conf using the below command
     
     sudo nano /etc/apache2/httpd.conf

- Uncomment the below lines from the above file

   LoadModule authz_core_module libexec/apache2/mod_authz_core.so
   LoadModule authz_host_module libexec/apache2/mod_authz_host.so
   LoadModule userdir_module libexec/apache2/mod_userdir.so
   LoadModule include_module libexec/apache2/mod_include.so
   LoadModule rewrite_module libexec/apache2/mod_rewrite.so

- Add the following lines into the same above file
   
  LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so

  <FilesMatch \.php$>
  SetHandler application/x-httpd-php
  </FilesMatch>

- Uncomment the below line 

  Include /private/etc/apache2/extra/httpd-userdir.conf

- Search for AllowOverride None in the file and replace with below text

    AllowOverride All

- Save the file by pressing Ctrl+o

- Open one more apache file using below command

    sudo nano /etc/apache2/extra/httpd-userdir.conf

- Uncomment the below line and save it
  
    Include /private/etc/apache2/users/*.conf

- Restart the apache using below command

   sudo /usr/sbin/apachectl restart

- Check if webserver is running by opening the below url in browser

   http://localhost

- To check if PHP is supported , let's create a php file in webserver directory and try acessing it in the browser

   sudo touch /Library/WebServer/Documents/index.php
   sudo nano /Library/WebServer/Documents/index.php

and enter the below text and save it.

   <?php 
    phpinfo(); 
  ?>

- Check if PHP is supported by opening below url in browser
 
   http://localhost/index.php
 
- If PHP is not signed yet , then you might get an error. Find the exact error message using below command in terminal

 apachectl -t -D DUMP_VHOSTS 

- If you find code signing issue in the above response, then Create a CA for code signing and do code signing

- Now feed below command to sign the php using terminal 

      codesign --sign "your-authority-name" --force --keychain ~/Library/Keychains/login.keychain-db /opt/homebrew/opt/php/lib/httpd/modules/libphp.so

- Open the httpd.conf again and change the uncommented php line with below text

     LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so "your-authority-name"

- Restart the apache again with below command

    sudo /usr/sbin/apachectl restart

- Access the PHP file again through browser, you should be able to see a proper php web page now



Thursday, February 4, 2021

Reclaim your memory from mac SSD without using any third party software

I took following steps and saved over 100GB


1. Opened Devices & simulators from Xcode and removed all the unwanted simulators

2. Cleared all the unwanted simulator runtimes from the below path

    /Library/Developer/CoreSimulator/Profiles/Runtimes

3. Removed all the simulator logs from the below path

     ~/Library/Logs/CoreSimulator/

4. Removed the unwanted device support and all the device logs,derived data and user data from below path

    ~/Library/Developer/Xcode/iOS DeviceSupport

    ~/Library/Developer/Xcode/iOS Device logs

    ~/Library/Developer/Xcode/DerivedData

    ~/Library/Developer/Xcode/UserData

5. Remove the temporary files and caches from the below path

     /private/var/folders/

6. Remove the system caches from the below path

    ~/Library/Caches

FYI:

It's always good to take a back up in time machine before doing , just in case if something goes wrong.

Saturday, January 30, 2021

How to join and study a university in UK

 Documents needed

  1. Get a transcript of your marksheet
  2. Get SOP ( Statement of purpose )
  3.  Get LOR ( Letter of recommendation ) from your Indian university if applicable employer
  4. Get IELTS score


Process:

  • Look for good colleges (https://russellgroup.ac.uk/about/our-universities/) and apply with the above documents and you would get a response in weeks. 
  • If it's a positive response, they'd offer conditional offer letter 
  • With that they would ask list of other documents and initial tuition fee like 2000 pound. 
  • Once you have successfully uploaded the documents and paid the initial fees they would  offer unconditional offer letter
  • With this letter you have become student of the university and you may start the visa process.
  • For visa process you can go to VFS and this will redirect to UKVisa site.
  • You will have to pay for NHS and health insurance which will be like 40k INR I heard recently it has changed to 80k INR
  • You will have to pay visa fee which would be 30k INR.
  • Then you will get visa appointment and you will have to carry all the originals for verification and they will take biometrics and issue the visa.
  • Before that you will have to show your account with 2Million INR for financial security. 
  • If you have applied for Education loan then you will have to show loan sanction letter
  • With visa one can book flight and travel to UK and you will have to collect BRP from post office within 1 or 2 weeks.

P.S

  1. In case of education loan , you may use conditional offer letter and start applying for loan with that. 
  2. If you have decided to drop off for some reason , they you may ask for initial tuition fee refund and most universities do the refund.
  3. Always choose a college which is close to a city that offers more part time jobs.


Thursday, November 5, 2020

Unified logging in iOS

 One of most important use of unified logging is that it facilitates us to see the logs from extensions.

Using apple xcode doesn't show the logs in it from extension.

All we have to do is use the following import

    import os.log

If you want to log something use the below statement

  os_log("")

Now you can see all this logs printed in terminal. 


P.S:

It can be very useful while you are working with extensions. Because we have to attach the extension with xcode for us to actovate the breakpoint inside  extension. Till we attach lot of things can happen we may want to know that's when the unified logging comes to our rescue.