DECLARE @SearchValue NVARCHAR(255)
SET @SearchValue = ‘VALUE’— Create a temporary table to store results
CREATE TABLE #Results (
TableName NVARCHAR(128),
ColumnName NVARCHAR(128),
ColumnValue NVARCHAR(4000)
)— Dynamic SQL to search for the pattern in all tables (excluding views)
DECLARE @Sql NVARCHAR(MAX)
SET @Sql = N”SELECT @Sql = @Sql +
‘INSERT INTO #Results (TableName, ColumnName, ColumnValue) ‘ +
‘SELECT ”’ + t.TABLE_NAME + ”’, ”’ + COLUMN_NAME + ”’, ‘ + QUOTENAME(COLUMN_NAME) +
‘ FROM ‘ + QUOTENAME(t.TABLE_SCHEMA) + ‘.’ + QUOTENAME(t.TABLE_NAME) +
‘ WHERE (‘ +
‘ (‘ + QUOTENAME(COLUMN_NAME) + ‘ LIKE @SearchValue COLLATE DATABASE_DEFAULT)’ +
‘ OR (‘ + QUOTENAME(COLUMN_NAME) + ‘ LIKE @SearchValue COLLATE Latin1_General_BIN)’ +
‘);’ + CHAR(13)FROM INFORMATION_SCHEMA.COLUMNS c
JOIN INFORMATION_SCHEMA.TABLES t ON c.TABLE_NAME = t.TABLE_NAME
WHERE t.TABLE_TYPE = ‘BASE TABLE’ — Exclude views
AND c.DATA_TYPE IN (‘NVARCHAR’, ‘NCHAR’, ‘VARCHAR’, ‘CHAR’, ‘TEXT’)— Execute the dynamic SQL
EXEC sp_executesql @Sql, N’@SearchValue NVARCHAR(255)’, @SearchValue— Retrieve the results
SELECT * FROM #Results— Clean up the temporary table
DROP TABLE #Results
To find which tables have a field (column) called “Serial” in Microsoft SQL Server, you can query the information schema views. Specifically, you can query the INFORMATION_SCHEMA.COLUMNS view to search for tables that contain a column named “Serial.” Here’s a SQL query to accomplish this:
SELECT TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'Serial';
This query will return a list of table names and corresponding column names where the column name matches “Serial.”
Here’s a breakdown of what this query does:
SELECT TABLE_NAME, COLUMN_NAME: This part of the query selects the table name and column name from the INFORMATION_SCHEMA.COLUMNS view.
FROM INFORMATION_SCHEMA.COLUMNS: This specifies the source of the data, which is the INFORMATION_SCHEMA.COLUMNS view. This view contains metadata about columns in all tables within the database.
WHERE COLUMN_NAME = ‘Serial’: This is a filter condition that restricts the results to only those rows where the COLUMN_NAME matches ‘Serial.’
When you run this query, you’ll get a list of tables and columns with the name “Serial” in your SQL Server database. This information can be helpful for further analysis or database maintenance tasks.
Click on Ease of Access button at login prompt
Choose On-Screen Keyboard
Open Start
Click on Gear icon (Settings button)
Click on Ease of Access
go to Keyboard section
Enable Use the On-Screen Keyboard
Open Start and type Device Manager
Open Device Manager
Expand the Keyboards Section
Right click Update Driver
Select Browse my computer for for driver software
Select Let me pick from a list of available drivers on my computer
Select Standard PS/2 Keyboard, Press Next, then Yes to restart if prompted
If this did not work
try removing the PS/2 keyboard and rebooting
Settings -> Ease of Access -> Keyboard section
Located user filter key section
Enable OR disable it
open start and type: taskschd
Expand Task Scheduler Library -> Microsoft -> Windows -> TextServices Framework
on the Right select Enable, then Run
Restart computer
Open Start , type Task Manager
Open task manager
Click on More Details
Select Cortana and select End Task
Start -> Run
Open Run
“C:\Windows\system32\ctfmon.exe”
go to Device manager -> Keyboard -> Update Driver
Search automatically for updated driver software
Restart
Start -> Settings -> update and Security -> Troubleshoot
Keyboard on right panel -> Run the troubleshooter
Start -> Settings -> update and security -> recovery
Enable or disable the keyboard on notebook that can be folded into tablet
You can change the position of your x360 notebook to enable or disable the keyboard and power key (depending on the model).
To enable the keyboard and the power button key on an x360 notebook, place the notebook in clamshell mode.
To disable the keyboard on an x360 notebook, place the computer in stand mode, tent mode, or tablet mode.
Forgot password to LTS or HikVision NVR (Network Video Recorder), cannot remember template pattern to login to NVR as admin.
In order to recover the NVR password you would need to have physical access to the recorder and have it connected it to a network.
In order to access NVR via network, download SADP Tool from https://www.hikvision.com/en/support/tools/hitools/
Copy/paste the link
Once installed, scan the network and you’d see your NVR on the list. You will find the NVR’s IP address. If the IP is dynamic, you can try connecting to it using SADP Tool. Click on the list to have is highlighted/selected and on the bottom right click Recover password.
Important: make sure you can leave the laptop running till the very end (keep reading) without disconnecting.
Should you encounter an error, change configuration of your laptop/computer to match IP network, but in your computer’s network settings make Gateway be your NVR’s IP address. For example: if you NVR network settings are:
IP: 192.168.0.170, Mask: 255.255.255.0, Gateway: 192.168.0.1
Change your computer’s network configuration to:
IP: 192.168.0.180, Mask: 255.255.255.0, Gateway: 192.168.0.170
DNS servers are not important in this case.
Once you are connected to the NVR, the main point is to export an XML file and have it sent to LTS’s technical/customer support. They’d send you another XML file back to you and you would have to import it into the NVR in order to reset the admin password.
When importing the file you might encounter different errors:
After many trials and errors the main solution seems to be:
Leave the computer/laptop and NVR running for the entire duration of the endeavor! Do not disconnect/power cycle the devices, do not turn off SADP Tool, do not disconnect network switches. WAIT until the customer service sends you the final password reset file. The turnaround is normally from an hour to a business day, depending when you catch the support rep.
Symtoms: WordPress Duplicator fails at the Host Build Interrupt stage. I get the same problem if I attempt a two part install packaging just the database.
Solution:
First of all increase the max time php scripts would run on your site. Edit .htaccess file and insert the following setting:
php_value max_execution_time 800
It might not work on some low budget hosts, or you might need to edit php.ini file and add/change a line max_execution_time 800
Should that not work, make sure your site is not over 500MB, or the free version of the duplicator would not work. We recommend opting in for transferring only the database. Move files manually using FTP.
You might encounter Host Build Interrupt if Dump Database mechanism fails:
Build Status
Host Build Interrupt
This server cannot complete the build due to host setup constraints.
DATABASE: ******************************************************************************** BUILD MODE: MYSQLDUMP MYSQLTIMEOUT: 5000 MYSQLDUMP: Is Supported MYSQL DUMP ERROR 2 ================================================================================== DUPLICATOR ERROR Please try again! If the error persists see the Duplicator 'Help' menu. --------------------------------------------------------------------------------- MESSAGE: Shell mysql dump error. Change Mysql dump engine in PHP mode DETAILS: mysqldump: unknown option '--no-tablespaces'
Most likely Duplicator plugin uses Mysqldump to copy the database. It might be even “Successfully found” in plugin settings and is working. However to solve ongoing problem go to
WordPress Admin => Duplicator => Settings. Click on Packages Tab.
Under SQL Script click PHP Code as per below:
Now the package should be able to get created.
Click Thank you! if it helped.
PHP 5+
(condition) ? /* value to return if condition is true */
: /* value to return if condition is false */ ;
syntax is not a “shorthand if” operator (the ?
is called the conditional operator) because you cannot execute code in the same manner as if you did:
if (condition) {
/* condition is true, do something like echo */
}
else {
/* condition is false, do something else */
}
PHP 7+
As of PHP 7, this task can be performed simply by using the Null coalescing operator like this :
<?php // Fetches the value of $_GET['user'] and returns 'nobody' // if it does not exist.$username = $_GET['user'] ?? 'nobody';
// This is equivalent to:$username = isset($_GET['user']) ? $_GET['user'] : 'nobody';
// Coalescing can be chained: this will return the first // defined value out of $_GET['user'], $_POST['user'], and // 'nobody'.$username = $_GET['user'] ?? $_POST['user'] ?? 'nobody';
?>
Midnight Commander has ability to connect to ftp in a pane, so it’s possible to use it to connect to a remote FTP server.
Go to Shell, execute mc
and press F9 to call the menu. Select Left
/Right
window, select FTP Link
Enter FTP server details in one of the following formats:
username:password@host #for non-anonymous login; host #for anonymous login; !username:password@host #for servers behind the firewall, through proxy servers; username:password@host:port #for servers using non std port; username:password@host/directory #to go to specific directory.
Once you’ve connected to your remote FTP server, you can copy any files or folders between the panes in your Midnight Commander and any directory on your remote FTP server.
First check the status of your queue:
# /var/qmail/bin/qmail-qstat
messages in queue: 6751
messages in queue but not yet preprocessed: 56
After you find and stop the spammer, you now have a bunch of email on your QMail queue. Here’s how to remove it
take a “user@domain.com” that happens in emails from the spammer (usually the sender) and run this command:
grep -R user@domain.com /var/qmail/queue/mess/* | awk -F”:” ‘{print “rm -f ” $1}’ | sh
make sure the quotes and single quotes are straight, not round upon copy/paste
That will delete the emails that contain that user@domain.com
but it would leave behind various indexes and later on your users would start receiving bouncebacks for emails they’ve never sent!
BETTER USE:
qmHandle/qmhandle-1.3.2/qmHandle -Fuser@domain.com
this removes not only messages, but all the mentioning of those messages from everywhere. (sasa4uk)
Hsphere file paths
Mysql:
======
Socket file: /var/lib/mysql/mysql.sock
Database file: /var/lib/mysql
mysql password file: /var/lib/mysql/.my.cnf
Error log: /var/log/mysql/error.log
Ftp:
=====
Proftpd is default with hsphere.
Configuration file: /hsphere/shared/config/ftpd/proftpd.conf
Log file: /hsphere/local/var/proftpd/xferlog
Php:
=====
The fatal error above will appear if your code contains two or more PHP functions that have the exact same name.
PHP Fatal error: Cannot redeclare function_name() (previously declared in /path/to/domain.com/file.php:12) in /path/to/domain.com/another_included_file.php on line 73
Check if the function name has already been used.
If you find yourself in a situation where the function name may or may not exist, then you can check to see if the name of the function has already been defined.
function function_name(){ //do something } if(!function_exists('function_name')){ function function_name(){ //do something } }
In the code snippet above, I used the function_exists function to check if function_name already exists as a function. Because it does exist in the example above, the second function is never created.