IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

How to Setup WordPress Installation on Linux

  1. Create a directory for the new website (e.g., website1.com):

    mkdir website1
    
  2. Check the owner of the directory, if it’s set to root, you might want to change it to your username or at least www-data. To change the owner from root to myusername, type the following:

    sudo chown -hR myusername:myusername /var/www/html/website1
    
  3. Go to website1 directory.

    cd /var/www/html/website1
    
  4. Download wordpress.

    wget https://wordpress.org/latest.tar.gz
    

    or you can target a specific version. For example in this case, the latest version is 6.9.1, then you can download by specific version by typing:

    wget https://wordpress.org/wordpress-6.9.1.tar.gz
    
  5. Extract the file:

    tar -zxvf latest.tar.gz
    

    This will extract the files to a sub-directory wordpress with the full path /var/www/html/website1/wordpress.

You can then set up wordpress the same way as any other system.

Optional

If you do not want to have wordpress sub-directory, you can copy all files to the parent directory.

sudo cp -r /var/www/html/website1/wordpress/* /var/www/html/website1

We’re copying the content of wordpress directory and -r is to include all sub-directories (recursive).

Use copy instead of move so if you make mistake, you can redo.

After verifying all copied files, then you can delete the files from original directory:

sudo rm -r /var/www/html/website1/wordpress/*

Assumptions:

  • Web server is installed and the public html directory is in /var/www.

  • Basic knowledge of WordPress installation and configuration, which is not covered in this post.

February 24, 2026 Filed Under: How To, WordPress Tagged With: Linux, macOS

How to View Stored Procedure Code in SQL Server

The most common way to view the code of a stored procedure in SSMS is doing a right-click on the stored procedure and select Script Stored Procedure as and select CREATE To.

But this is not practical when you have several stored procedures to look at.

Another way to do it by using a script:

USE [DATABASENAME]
GO

EXEC sp_helptext STOREDPROCEDURENAME
GO

You might want to set the Results to Text for easy copy and paste for further editing.

Further Reading

How to view the stored procedure code in SQL Server Management Studio
How to Find a String in SQL Server Stored Procedures
How to Find All References to an Object in a SQL Server Database
How to Get Table Definition in SQL Server

March 13, 2024 Filed Under: How To Tagged With: Microsoft SQL Server, SQL Server

How to Find a String in SQL Server Stored Procedures

This is just quick tip found from this link and is actually good to use as a starting point:

USE DATABASE;
GO

SELECT [Schema] = schema_name(o.schema_id), o.Name, o.type
FROM sys.sql_modules m
INNER JOIN sys.objects o
ON o.object_id = m.object_id
WHERE m.definition LIKE '%YOUR-STRING%'
GO

Further Reading

How to Find All References to an Object in a SQL Server Database
How to Search for a String in All Tables in a Database
How to find a specific text string in a SQL Server Stored Procedure, Function, View or Trigger
How to Find a Column Name in SQL Server Database
How to Get Names of All Tables in SQL Server

February 1, 2024 Filed Under: How To Tagged With: Microsoft SQL Server, SQL, SQL Server

How to Remove Cached Credentials without Rebooting Windows

The typical situation is you’ve connected to a network share with a User ID and a password. Then for one reason or another, the password was changed.

As soon as you get asked to enter the User ID and password again, even after entering the latest password, you’re still getting an error message:

Open Folder

\\server_name\c$ is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.

The issue is after the password was recycled, the old password is still cached in your system, so we need to clear out the cache first.

You can check on what’s in the cache by opening a PowerShell or Command Prompt and type in the following:

C:\>net use

And you should see something similar to this:

C:\>net use
New connections will be remembered.


Status  Local    Remote                    Network
----------------------------------------------------------------------
OK      G:       \\Server1\Apps            Microsoft Windows Network
OK      H:       \\Server2\Customers       Microsoft Windows Network

Disconnected     \\server_name\c$          Microsoft Windows Network
The command completed successfully.

The network drive you’re looking for is the one that is disconnected and we need to delete it.

We can do so by typing the following command:

net use \\server_name\c$ /delete

And you will get confirmation that it was deleted successfully.

C:\>net use \\server_name\c$ /delete
\\server_name\c$ was deleted successfully.

Once you see this, you can close the PowerShell or Command Prompt windows and try to reconnect to the network share drive again.

Further Reading

How do I remove login credentials for a network location in Win7?
How to delete cached temporarily credentials for a network share on a Windows machine without rebooting or logging off

July 27, 2023 Filed Under: How To Tagged With: PowerShell, Windows

How to Search for a String in All Tables in a Database

If you want to look where a string is in all tables in a database, how do you do that?

Here’s a very helpful SQL to run:

DECLARE @SearchStr nvarchar(100)
SET @SearchStr = '## YOUR STRING HERE ##'

-- Copyright © 2002 Narayana Vyas Kondreddi. All rights reserved.
-- Purpose: To search all columns of all tables for a given search string
-- Written by: Narayana Vyas Kondreddi
-- Site: http://vyaskn.tripod.com
-- Updated and tested by Tim Gaunt
-- http://www.thesitedoctor.co.uk
-- http://blogs.thesitedoctor.co.uk/tim/2010/02/19/Search+Every+Table+And+Field+In+A+SQL+Server+Database+Updated.aspx
-- Tested on: SQL Server 7.0, SQL Server 2000, SQL Server 2005 and SQL Server 2010
-- Date modified: 03rd March 2011 19:00 GMT
CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630))
 
SET NOCOUNT ON

DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
SET  @TableName = ''
SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')
 
WHILE @TableName IS NOT NULL

BEGIN
  SET @ColumnName = ''
  SET @TableName = 
  (
    SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)) 
    FROM INFORMATION_SCHEMA.TABLES
    WHERE TABLE_TYPE = 'BASE TABLE'
    AND QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName AND OBJECTPROPERTY(
      OBJECT_ID(
        QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)
      ), 'IsMSShipped'
    ) = 0
  )

  WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)
         
  BEGIN
    SET @ColumnName =
    (
      SELECT MIN(QUOTENAME(COLUMN_NAME))
      FRO M INFORMATION_SCHEMA.COLUMNS
      WHERE TABLE_SCHEMA = PARSENAME(@TableName, 2)
        AND TABLE_NAME = PARSENAME(@TableName, 1)
        AND DATA_TYPE IN ('char', 'varchar', 'nchar'
          , 'nvarchar', 'int', 'decimal')
        AND QUOTENAME(COLUMN_NAME) > @ColumnName
    )
 
    IF @ColumnName IS NOT NULL
         
    BEGIN
      INSERT INTO #Results
      EXEC
      (
        'SELECT ''' + @TableName + '.' + @ColumnName + ''', 
        LEFT(' + @ColumnName + ', 3630) 
        FROM ' + @TableName + ' (NOLOCK) ' +
        ' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2
      )
    END
  END   
END
 
SELECT ColumnName, ColumnValue FROM #Results
 
DROP TABLE #Results

Further Reading

How to Get Names of All Tables in SQL Server
How to Find a Column Name in SQL Server Database
Search all tables, all columns for a specific value SQL Server
How to Find a String in SQL Server Stored Procedures

April 3, 2023 Filed Under: How To Tagged With: Microsoft SQL Server, SQL, SQL Server

Next Page »
Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to Setup WordPress Installation on Linux
  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency

Recent Posts

  • How to Setup WordPress Installation on Linux
  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2026 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure