Showing posts with label Tutorial/Tips and Tricks. Show all posts
Showing posts with label Tutorial/Tips and Tricks. Show all posts

Sunday, 30 July 2023

Got a New Mac? Do These 10 Things to Set It Up Perfectly

System Settings-MacOS
So you just bought a brand new Mac and can't wait to dive into the world of the Apple ecosystem. Congratulations! Whether you're a long-time Apple user or a first-time Mac user, setting up your new device can improve your experience and productivity. In this article, we'll walk you through ten important steps to ensure your new Mac is ready to reach its full potential. Let's get started!

1. MacOS Updates:

Once you've set up your Mac, check for macOS updates. Click on System Settings, then select General, then select Software Update. Install any pending updates to ensure your Mac is running the latest version of macOS, which includes bug fixes and new features.

2. Adjust System Preferences:

Customize your Mac's settings to your liking. Go to System Settings and explore options like Touchpad, Mouse, Keyboard, Desktop & Dock etc. Customize these settings to fit your workflows to personalize your Mac experience.

3. Customize your Dock:

The Dock is the quick access bar at the bottom of the screen. Customize for easy access by adding the apps you use most. To add an application to the Dock, simply drag its icon from the Applications folder or click and hold the application icon in the Dock, then select Save to Dock. 

4. Install Must Have Apps:

Go to the App Store and download essential apps like web browsers, communication tools (like Slack or Microsoft Teams), productivity apps, and media players. Some popular applications you might consider are Google Chrome, Microsoft Office, VLC Media Player, and Evernote.

5. Configure Time Machine (Backup):

It's important to back up your Mac regularly to protect your data from the unexpected. Connect an external hard drive and set up Time Machine (Apple's built-in backup solution). Go to System Settings > General>Time Machine and select an external drive as the backup destination.

6. Configure iCloud:

Take advantage of Apple's cloud services by setting up iCloud. Go to System Settings > Apple ID> iCloud. Enable iCloud Drive to sync files across devices, iCloud Photos to back up and access your photos and videos, and iCloud Keychain to keep your passwords safe. 

7. Security and privacy settings:

Make sure your Mac is protected by setting the necessary security and privacy settings. Go to System Settings > "Privacy & Security" to configure features such as FileVault (disk encryption), firewall, and gateways (application security). You can also manage app permissions to access your camera, microphone, and other sensitive data. 

8. Add email and social media accounts:

Integrate your email and social media accounts into your mail and calendar applications. This will help you stay organized and up-to-date without constantly switching between different platforms.


9. Personalize your desktop and screensaver:

Make your Mac feel more like home by personalizing the desktop wallpaper and screensaver. Simply right-click on the desktop, choose "Change Wallpaper," and select an image of your choice. For screensavers, go to System Settings > Screensaver and choose from the available options or add your own folder of images.

10. Learn useful keyboard shortcuts:

Finally, learn some useful Mac keyboard shortcuts to improve your workflow. Learn basic keyboard shortcuts like Command+C (copy), Command+V (paste), Command+Z (undo), and application-specific shortcuts that can dramatically speed up tasks. 

By following these ten steps, you can ensure that your new Mac is perfectly set up and tailored to your needs. From software updates to personalizing your desktop, every step helps create a smoother, more enjoyable Mac experience. Embrace the world of MacOS and explore the possibilities offered by the Apple ecosystem. 



Sunday, 16 April 2017

Step by Step Guide to install WordPress on AWS

AWS and WordPress

Over the last few days, I have shared information on Amazon Web Services (AWS) which is giving 1-year free cloud hosting, for a trial. In today's post, I'm linking all the resources in one place and providing you with the step-by-step guide for installing WordPress on AWS.

Step 1: Getting started with Amazon Web Services (AWS)–Create an EC2 Instance
Step 2: Connect to EC2 Instance
Step 3: Install WordPress on AWS

Just follow these above steps and in little, to no time you will be running your own WordPress blog that too for free.

Have you tried installing WordPress on AWS? What new things you discover, do share your experience with us in the comment section below.

Saturday, 15 April 2017

Install WordPress on AWS EC2 Instance

WordPress and AWS
After successful completion of first and second step i.e. creating an EC2 instanceand connecting to EC2 instance in AWS using PuTTY and Terminal respectively. Further moving ahead, it is time to install Apache, PHP, MySQL to run WordPress on an EC2 instance. If you are not familiar with command line / Linux commands just run these commands in same order.

NOTE: This instruction is for Amazon Linux and will not work if you are trying different machine image like Ubuntu or Windows Server.

Connect to your instance via PuTTY  (Windows) / Terminal (Mac OS) / Bash (Linux OS)

Just to make sure everything is up to date
sudo yum -y update

If you want, you may directly switch from ‘ec2-user’ user to root using sudo su command.

Install multiple software packages:
sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd

Start Apache Server:
sudo service httpd start

Create a page to check your PHP installation

a) vi test.php
b) Type i to start the insert mode
c) Type <?php phpinfo() ?>
d) Hit escape button and type :wq, now hit enter to exit
e) Open a browser and http://ec2-xxx-xxx-xxx-xxx.us-west-1.compute.amazonaws.com/test.php (use you public IP DNS followed by /test.php)

If you see a phpinfo page then you are good to move forward, otherwise you may want to start over.

Delete the test.php file as it is for the information only and you definitely don’t want to give away sensitive information about your server:

rm -f /var/www/html/test.php

Secure Start SQL service

Start MySQL service and run secure installation
sudo service mysqld start
sudo mysql_secure_installation

MySQL_Secure_installation
When prompted, enter a password for the root account. By default, the root account does not have a password set, so press Enter.

Type Y to set a password, and enter a secure password twice
1) Remove anonymous users? [Y/n] Y
2) Disallow root login remotely? [Y/n] Y
3) Remove test database and access to it? [Y/n] Y
4) Reload privilege tables now? [Y/n] Y

Restart MySQL to pick up the changes:
sudo service mysqld restart

Login into MySQL and Create a database for WordPress

Log in to the MySQL server as the root user and enter your MySQL root password when prompted
mysql -u root –p

Create a user name and password for your MySQL database.
CREATE USER 'aksgeek'@'localhost' IDENTIFIED BY 'aksgeekpassword';
Replace ‘aksgeek’ with your WordPress username and ‘aksgeekpassword’ with your strong password.


Create a database for WordPress:

 Create_database_for_wordpress


CREATE DATABASE `wordpressdb`;

(you can create a database with any name)

GRANT ALL PRIVILEGES ON `wordpressdb`.* TO "aksgeek"@"localhost";

FLUSH PRIVILEGES;
exit

Install WordPress
cd /var/www/html
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
cd wordpress/
mv wp-config-sample.php wp-config.php
nano wp-config.php

 edit_wp-config
Start editing wp-config.php. (user arrow keys to move around)

define('DB_NAME', 'wordpressdb');
define('DB_USER', 'aksgeek');
define('DB_PASSWORD', 'aksgeekpassword');
define('DB_HOST', 'localhost');

Visit https://api.wordpress.org/secret-key/1.1/salt/ to randomly generate a set of key values that you can copy and paste into your wp-config.php file.
Ctrl + X
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? Y
File Name to Write [DOS Format]: wp-config.php  hit Enter.

Move your WordPress installation to root or in subdirectory / folder

You may want to run your WordPress blog from root like your_public_dns.amazonaws.com/)  then
mv * /var/www/html/

Or

Most of you want to install it in a subdirectory or folder (for example, your_public_dns.amazonaws.com/blog, then
mkdir /var/www/html/blog
mv * /var/www/html/blog

To allow WordPress to use permalinks
sudo nano /etc/httpd/conf/httpd.conf

<Directory "/var/www/html">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

Find the section that starts with <Directory "/var/www/html"> and change the AllowOverride None line to AllowOverride All.

To ensure that the httpd and mysqld services start at every system boot
sudo chkconfig httpd on
sudo chkconfig mysqld on

Open a web browser and enter the URL of your WordPress blog, you should see the WordPress installation screen

Example for root installation:  http://ec2-xx-xxx-xxx-xxx-us-west-1.compute.amazonaws.com

or

for subdirectory / folder (blog): http://ec2-xx-xxx-xxx-xxx-us-west-1.compute.amazonaws.com/blog.

Wordpress_installation_finished

Enter your site name, username, password and email address and hit submit.



Congratulations!! You are running WordPress blog on Amazon Web Services (AWS) EC2 instance.



Troubleshooting

Having trouble updating and downloading themes/plugin in WordPress blog as it is asking for FTP credentials then run this command:
sudo chown -R apache:apache /var/www/html

Friday, 14 April 2017

How to Connect to EC2 Instance using PuTTY and Terminal

1_connect to instanceIn our last post, we learned how to create EC2 instance in AWS. After successfully launching our EC2 Linux instance, today we will connect to our instance so we can install and run WordPress. There are two methods via which we can connect to our Amazon EC2 Linux instance:
  1. A standalone SSH Client
  2. A Java SSH client directly from my browser (Java required)
2_standaloneinstance
Later seems easy to connect as most of the computer have java installed, let's get started and see how to connect our EC2 instance directly from browser.
First check whether you have java installed or your browser supports java or not?
chrome not supportted
All of you have encountered with error/problem while connecting to your instance in Chrome browser as the Chrome browser version 42 and above disabled the standard way their browser supports plugin.
firefox_java not supported
Now it’s Firefox turn: While trying on Mozilla Firefox 64-bit, I got a message saying it is 64-bit and will not run java. Another failed attempt.
win10_edge_java not supported
Our Last hope?: Using Microsoft Edge browser didn’t help either as it doesn’t have support plugin. My bad!
Old is Gold!? While checking for java on internet explorer (IE11), a pop-up window appeared mentioning “the page you are viewing uses java”. Finally a positive response, now it’s time to connect our instance  by
  1. Sign-in to AWS console –> EC2 dashboard-> running instance-> select running instance –> click on Connect button
  2. Select “A Java SSH client directly from my browser (Java required)”
  3. Your username will be mentioned by default as “ec2-user”. Now enter the location of private key path (which you have downloaded in step 7 of creating ec2 instance) C:\folder\location\private_key.pem and select save key location
  4. Now click on “Launch SSH client” button .
IE not connecting


Wait! Nothing happened, the same pop-up appeared and didn’t connect. Looks like IE 11 on 64bit Windows 10 won’t work.

firefox-32bit limited support for plugin

This time around installing and running on  32-bit Firefox, I have had encountered with a different message (gladly) but – Limited support for the plugin, therefore will not run java.  There are other browser options like opera, safari which I didn’t try and leaving up to you to try it using above steps and leave a comment below whether they worked for you or not.

It’s time to go with the first option of connecting instance via standalone SSH client:

Connect to Amazon EC2 Linux Instance using PuTTY

For Windows user
  1. Download PuTTY, PuTTYgen

    PuTTYgen

  2. Open PuTTYgen –> click “Load” button –>  Windows explorer will open browse to the .pem file location (private key that you have downloaded while creating EC2 instance) and select “All Files (*.*)” otherwise you won’t be able to see your .pem –> click “open”

    PuTTYgen_2

  3. Select “save private key”. PuTTYgen warning window appear to ask you to save this key without a passphrase key? If you want to then you may choose otherwise it’s not necessary. In short press “yes” and save the .ppk file.

    PuTTY Alert


    PuTTY_hostname

  4. Now start PuTTY and enter hostname username@public_dns_name. e.g. ec2-user@52.xx.xxx.xxx48 or ec2-user@ec2-xx-xxx-xxx-xxx.us-west-1.compute.amazonaws.com. 
    (The username may vary depending on which AMI you have installed. You may find this information in example when you click Connect button in console) –> Connection type SSH and port 22

    PuTTY_auth


  5. In Category pane, expand connection, then expand SSH, click on Auth –> Browse your .ppk and click Open.

    PuTTY Alert-auth

  6. If you connect for the first time, PuTTY display security alert –> choose “Yes”.

    puTTY_login_success
  7. Connected!


For Mac OSX/Linux User:


EC2 Connect via Terminal
  1. Open Terminal

  2. Locate your private key (.pem) key. (In my case, private key is in download folder)

    cd ~/Downloads

  3. Your key must not be publicly viewable for SSH to work. Use this command:

    chmod 400 your_privatekey.pem

    or

    chmod 400 /location/private_key.pem

  4. Now connect to your instance using below command:

    ssh -i "your_privatekey_name.pem" ec2-user@ec2-52-xx-xxx-xxx.us-west-1.compute.amazonaws.com You will see message like this:
    The authenticity of host xxx:xxx:xx:xx:xx can't be established.
    RSA key fingerprint is xx:xx:xx:xx:x:xx:xx:xx:xx:xx:xx:xx:xx:xx
    Are you sure you want to continue connecting (yes/no)?


  5. Type Yes and enter

  6. Now you are successfully connected your EC2 Linux instance using Terminal.
On next, we will see how to install WordPress in AWS.

Wednesday, 12 April 2017

Getting started with Amazon Web Services (AWS)–Create an EC2 Instance

As you are already aware of Amazon Web Services (AWS) that offer on-demand cloud computing solution with a pay-per-use approach. As Amazon offer 12 months free trial to check out their services, we exactly going to do that and also recommend you sign up for AWS Free tier. If you already did then let’s get started and learn together on how to create an EC2 instance in AWS.


First, take a quick look at Amazon Free Tier benefits:

Amazon EC2 (Compute)
  • 750 hours per month of Linux, RHEL, or SLES t2.micro instance usage
  • 750 hours per month of Windows t2.micro instance usage
Amazon S3
(Storage)
  • 5GB of standard storage (20,000 Get Requests, 2,000 Put Requests)
Amazon RDS
(Database)
  • 750 Hours per month of database usage
  • 20 GB of DB Storage: any combination of General Purpose (SSD) or Magnetic
  • 20 GB for Backups (with RDS Magnetic storage; I/Os' on General Purpose [SSD] are not separately billed)
  • 10,000,000 I/Os'
Amazon QuickSight
(Analytics)
  • 1 GB of SPICE capacity 1 user perpetual free tier
  • 10GB of SPICE capacity the first 2 months for free for a total of 4 users
Offers that won’t expire after 12 months
  • AWS Lambda, DynamoDB, AWS Database Migration Service etc..

A. Log in to your AWS-console;
aws console

B. Go to Services on top left corner and select EC2, to enter in EC2 dashboard;


ec2_launch instance

C. Now click on “Launch Instance”


To successfully launch an EC2 instance you have to follow 7 steps:


1. Choose Amazon Machine Image (AMI)

aws choose ami
  • You can choose any AMI from amazon marketplace as per your requirement but in this tutorial, I will focus only on free tier eligible products and services. Therefore, I am selecting Amazon Linux AMI (64-bit)
2. Choose an Instance type
 aws instance type
  • Select General purpose t2.micro (free tier eligible) instance and click on “next Configure Instance Details”
3. Configure Instance Details
 configure instance aws
  • You may leave the setting to default but I want you to look into the settings:
    • Subnet: you may choose any one default subnet available or may create a new subnet;
    • Auto-assign Public IP: keep it as default (use subnet setting (enable). If needed, you may enable elastic IP to connect it to your domain;
    • Enable termination protection: check this to protect against accidental termination;
  • Click on “Add Storage” button.
4. Add Storage
 add storage aws
  • You may go ahead with the default setting by clicking on “Add Tags” button or you may increase storage size up to 30GB for Volume type General Purpose SSD or Magnetic storage. (increase storage as per your requirement, make sure don’t decrease it from 8GB)
5. Add Tags 
 add tags ec2 aws
  • Skip this step and continue with clicking on “Configure Security Group”
6. Configure Security Group
 security group ec2
configure security group ec2
  • In Assign a security group: Select “create a new security group” (if you don’t have any) or “choose from existing one”;
  • Provide Security Group name or leave it as default ( launch-wizard-1) – I recommend you to add name which may later help you in identifying the security group;
  • Add description – enter description which makes this security group explanatory for you;
  • In SSH select source My IP (recommended option), so it will allow only your IP to connect to SSH or you can assign custom IP address or just select “Anywhere” (least secure option);
  • Add HTTP to connect to server port to make your instance accessible;
  • For the last step click on “Review Instance Launch”.
7. Review Instance Launch
 review ec2 instance
  • You may go through the summary of your instance. In case you want to make any changes, just do it.
  • Once you go through all the details available on Review instance launch, click on “Launch” button, new window pop-up - “Select an existing key pair or create a new pair window”.
  • Now create a new key pair (never proceed without a key pair, otherwise you won’t be able to connect your instance) and enter key pair name;
ec2 key pair
  • Download the key pair and keep it in a secure location as you will NOT be able to download the file again after it's created.
  • Finally, click Launch Instances.
ec2 instance launched 

You have successfully launched an EC2 instance on AWS, now go to your EC2 dashboard and view running instance. This guide may be used for creating a different EC2 instance with different machine image.
On next post, we will move further any see how we can connect to our instance and install WordPress.