• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Gokul Deepak

Gokul Deepak

GoCool and Debug

  • Home
  • Terraform
  • WordPress
  • Android
  • How to
  • About Me

Gokul Deepak S

Combine two separate files line by line in Notepad++

August 23, 2020 by Gokul Deepak S 2 Comments

Problem:

I need to combine two separate files line by line.

For Eg:
Consider I have two text files file 1 and file 2.
File 1 contains the following text

Start of Line 1
Start of Line 2
Start of Line 3
.
.
.
Start of Line N

File 2 Contains the following text

End of Line 1
End of Line 2
End of Line 3
.
.
.
End of Line N

Solution:

  1. Open a new tab ( Ctrl + N )
  2. Select the contents of File 1 and paste them in this new tab
  3. Write any symbols in a new line. Eg: ______ ( Type 3 _ characters )
  4. Select the contents of File 2 and paste them, in the new tab, BELOW the ___ line
  5. Open the Replace dialog ( Ctrl + H )
  6. SEARCH : (?s)^___.+|(?-s)^.*(?=\R(?:.*\R){n}(^.*)) ( Just replace n with the appropriate number of lines )
  7. REPLACE: ?1$0\1
  8. OPTIONS: Wrap Around and Regular expression set. All other options unticked
  9. ACTION: Click on the Replace All button

Result:

File 3

Start of Line 1End of Line 1
Start of Line 2End of Line 2
Start of Line 3End of Line 3
..
..
..
Start of Line NEnd of Line N


Filed Under: Notepad++

Vi and Vim Editor commands

August 23, 2020 by Gokul Deepak S Leave a Comment

Here I’m mentioning all the commands related to Vi and Vim editor that I learn

Command to delete all lines in Vi Editor:

:1,$d 

Delete a single line where the cursor is

dd

Find and /replace

:%s/find_word/replace_word/g

To search a word that has the character forward slash / or any special characters then simply include backward slash \ before that \/

:%s/find\/words\~/replacewords/g

Add Text to beginning of every line – use ˆ
Add Text to end of every line- use $

:%s/ˆ/text/
:%s/$/text/

Remove Blank Lines

:g/^$/d

Remove Blank Lines that contains space

:g/^ *$/d

Filed Under: Linux

Elementor Plugin and Nginx Configuration

June 17, 2020 by Gokul Deepak S 9 Comments

Error:

Permalinks for domain.com/post-name is working fine. All pages are working well and good. There was no other problem until I tried to edit a published page with Elementor.
The page isn’t loading and returns with the error
‘Preview Could Not Be Loaded’.

Search Hunt:

Elementor document asked me to try with safe mode. Even in safe mode, it is not working.
Finally, I have found another page asking me to make changes in .htaccess
As I’m using Nginx I have made this change into Nginx config file and it worked out.

Solution:

nginx config file location. It can be found in /etc/nginx/nginx.com or /etc/nginx/sites-available/domain.com.conf or /etc/nginx/conf.d/default.conf

sudo vi /etc/nginx/conf.d/default.conf

Find for the code

location /{
try_files $uri $uri/ /index.php?q=$uri$args;
}

Replace the above with

location /{
try_files $uri $uri/ /index.php$is_args$args;
}

save the configuration by pressing escape key and :wq

sudo systemctl restart nginx

In your WordPress admin panel of website go to Settings-> Permalinks

Change it to Plain and save. Again Change it to Post name and save.

Elementor Plugin and Nginx Configuration would work perfectly now.

Filed Under: Nginx Tagged With: Elementor, Wordpress plugin

How to Send Files from your localhost to Another Server through SSH

June 17, 2020 by Gokul Deepak S Leave a Comment

Objective: Upload Files/Folder from my local to server. (How to Send Files from your localhost to Another Server through SSH)

Challenge: I’m bored to use Filezilla. So just have to use putty or Git Bash or Windows Subsystem.

I have used Ubuntu Subsystem in my Windows 10 for SSH access.

Solution: Use Secure Copy Command from your local machine and login to server directly.

Command:

sudo scp -i key.pem -r /mnt/d/sourcefolder/ [email protected]:/var/html/destination/
  1. Sudo – So to not ask permission for each and every file.
  2. scp – Secure Copy command to copy files between servers. you should use scp so it would use SSH for transferring files and would use authentication like password or pem key.
  3. -i key.pem – this is the key for my server login authentication.
  4. -r -recursive files/subfolders inside the folder.
  5. /mnt/d/sourcefolder/ – Source folder in local.
  6. [email protected]: – user in the particular server and its IPv4. you can also use root or ubuntu.
  7. /var/html/destination – Destination folder

Task Completed Successfully.

Note: Remember that the folder copied to the server is under the user centos/root/ubuntu.

Filed Under: Linux

Genesis Sample Theme Full-Width Template

July 7, 2019 by Gokul Deepak S Leave a Comment

Front-page.php

<?php
// Template Name: Full Width
add_filter( 'genesis_attr_site-inner', 'be_site_inner_attr' );
/**
 * Adds the attributes from 'entry', since this replaces the main entry.
 *
 * @author Bill Erickson
 * @link http://www.billerickson.net/full-width-landing-pages-in-genesis/
 *
 * @param array $attributes Existing attributes.
 * @return array Amended attributes.
 */
function be_site_inner_attr( $attributes ) {
    // Adds a class of 'full-width' for styling this .site-inner differently
    $attributes['class'] .= ' full-width';
    // Adds an id of 'genesis-content' for accessible skip links
    $attributes['id'] = 'genesis-content';
    // Adds the attributes from .entry, since this replaces the main entry
    $attributes = wp_parse_args( $attributes, genesis_attributes_entry( array() ) );
    return $attributes;
}
// Displays header.
get_header();
genesis_do_breadcrumbs();
// Displays content.
the_post(); // sets the 'in the loop' property to true. Needed for Beaver Builder but not Elementor.
the_content();
// Displays comments (if any are already present and if comments are enabled in Genesis settings - disabled by default for Pages.
genesis_get_comments_template();
// Displays footer.
get_footer();

Style.css

/* Full Width Page
------------------------------------------------------ */
.site-inner.full-width {
    max-width: none;
    padding: 0;
    margin: 0;
}

Filed Under: Wordpress

All pages in my website works except wp-admin

December 3, 2018 by Gokul Deepak S Leave a Comment

I’m using wordpress. One day I have encountered this problem. I can access every page in my blog except /wp-admin.

The error said that there were too many redirects and error 500.

Many searches requested me to change the configuration in wp-config and modify that as SSL redirect as true/false. But that didn’t work. Finally I found that I can access wp-admin using: https://www.example.com/wp-admin/index.php

Try this format this will work.

If you want to make https://www.example.com/wp-admin work then simply modify in .htacess or nginx.conf

 

Filed Under: Wordpress

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • Page 6
  • Interim pages omitted …
  • Page 11
  • Go to Next Page »

Primary Sidebar

Popular Pages

  • Home
  • How to find the date of the Facebook group it was created
  • How to install OwnCloud on Bluehost
  • Combine two separate files line by line in Notepad++
  • Terraform
  • How to Stock ROM using SP flash

Archives

Categories

  • Android
  • Apache
  • AWS
  • Blogger
  • Computer Tips
  • DevOps
  • Docker
  • Earn
  • Facebook Tips
  • Git
  • Google Tips
  • Hosting
  • How to
  • Laptop Tips
  • Laptops
  • Linux
  • Mobile
  • MongoDB
  • Nginx
  • Node JS
  • Notepad++
  • PostgresQL
  • Terraform
  • Ubuntu
  • Wordpress
  • Xenforo

Tags

Android Android One AWS Bluehost Comparisions Custom ROM Elementor Facebook Genesis Genesis Sample Theme Google Drive How to Lineage OS Notes OnePlus One OwnCloud Rooting Smartphones Stock ROM Studiopress Tomcat Wordpress plugin

Copyright © 2025 · Maintained by GokulDeepak