Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

"Ghost" monitors in Windows 10


While using windows 10 operating system, sometimes you might see unnecessary monitors attached to your system in "Display Settings".
Steps to reproduce: Right click on your Desktop wallpaper > Click on "Display Settings"
Here you can see many monitors as follows. Normally these monitors are not attached to the system rather these popped up automatically.


What can these ghost monitor cause ?

If these 'Ghost' monitors are automatically enabled then if you are using 'Extended/Second Screen only' display then at sometimes the primary screen might alter up to the 'Ghost' monitors and thus you might not be able to see the screen. This will create confusion in setting up the display.

What is the root cause?

  • Intel(R) HD Graphics Driver is messed up.
  • Hyper-V is enabled in your windows 10
There might be different root causes for this, which can be known after detailed investigation.

What can be done?

If such monitors are displayed you can follow the following steps: 
  • Click on "Start" > Type "Run"
  • "Run" window will popup

  • In the "Run" window, Type "devmgmt.msc" and press "Enter/OK"
  • After that the "Device Manager" Screen pops up: 
  • Expand the "Display Adapters" and Right Click on the "Intel(R) HD Graphics xxxx" and then you can select the "Uninstall Device"
  • After clicking "Uninstall device" you can see the following screen which will assist in uninstalling the device.
Check the "Delete the driver software for this device" and then click on "Uninstall". This will uninstall the currently installed Intel(R) HD Graphics driver.
  • After performing the above steps kindly "Reboot" your machine. After rebooting Windows 10 will automatically resintall the Intel(R) HD Graphics driver and thus the 'Ghost' Screen will be fixed.

NOTE: Please note that the above steps worked for me. Kindly perform the above steps only if you are a technical person. I am not responsible for any brick in your device.

Recover Unallocated Partition of Hard disk

Testdisklogo clear 100.pngToday was a hectic day for me. Today suddenly while accessing my External hard disk in latest Windows 10 May 2019 update the disk was not initialising. While trying to initialise disk with GPT/MBR from the "Disk Management" suddenly my hard disk started displaying as "Unallocated".

It was such a frustrating situation for me as I was worried about loosing my data. I have tried many solutions to fix it out but unfortunately it was increasing my frustration. At last, I found a freeware named as "TestDisk" which saved me. Initially while running this command line utility, I was unable to understand the processing even if it had pretty easy instructions but later I was able to fix my hard disk access.

In the world of data recovery it happens that your Operating System stops detecting your external hard disk. I have tried to use Ubunut Live CD to access the hard disk but it also shows me the same issue as on Windows.

In my case it was corrupted/damaged partition table, which is the reason the Operating system stopped detecting the External hard disk partition properly. To make it easier in working with TestDisk command line utility, following are the steps to recover the data, hope this helps you guys:

Testdisk https://www.cgsecurity.org/wiki/TestDisk


  • In order to recover a damaged partition table, kindly follow the following steps: 



  1. Start testdisk_win.exe
  2. Create a new log file.
  3. Scroll down to drive which contains the damaged partition table > Proceed
  4. Intel/EFI GPT (Select the partition table type - usually the default value is the correct one as TestDisk auto-detects the partition table type.) > Analyse > Quick Search
  5. Should TestDisk search for partition created under Vista ? > Y
  6. If the lost partition was a primary partition, move arrows to change * to P and press Enter.[P may already be there, if it is, still go to the next step to 'Write partition table'.]
  7. Move arrows to Write and press Enter.
  8. Write partition table, confirm ? (Y/N) > Y
  9. You will have to reboot for the change to take effect.


  • To recover individual files / individual directories from a hard drive which cannot display them in Windows because of a damaged partition table: 



  1. Copy Testdisk to hard drive with enough space to recover the lost files/directories then start testdisk_win.exe
  2. Create a new log file
  3. Scroll down to drive which contains the files/directories to recover > Proceed
  4. Intel/EFI GPT (Select the partition table type - usually the default value is the correct one as TestDisk auto-detects the partition table type.) > Analyse > Quick Search
  5. Should TestDisk search for partition created under Vista ? > Y
  6. Instead of moving arrows to get to the letter P, physically press key P on your keyboard.This lists the files and directories 
  7. Now use arrows to move down to select any file or directory and press C on keyboard to copy selected file or directory. 
or
To copy all files and directories, move the arrow to the top marked with one dot: .Then press C on keyboard and all files and directories will be copied to the location where you ran TestDisk from.


  • Use instructions above to recover files/directories from a hard drive with a damaged partition table. If partitions already exist, it may be recovered to an image file. To create an image of the entire partition:



  1. Copy Testdisk to hard drive with enough space to store the image of the partition 
  2. Create a new folder inside which you want to save the image.dd file then start testdisk_win.exe
  3. Create a new log file
  4. Scroll down to drive which contains the partition to copy > Proceed
  5. Intel/EFI GPT (Select the partition table type - usually the default value is the correct one as TestDisk auto-detects the partition table type.) > Advanced > Scroll down to partition to recover 
  6. Use right arrow to get to Image Creation > Enter 
  7. Select where to store the image.dd file > Press Enter then press the Y key on keyboard.
  8. File image.dd will contain the recovered partition.

You can use freeware such as OSFMount to mount image.dd files to access files inside them directly.

MySQL and PostgreSQL identical commands

Both MySQL and PostgreSQL are databases which are used. There are many similar commands and functionalities used in both with some differences. Users working with both are always confused with the equivalent commands that are used in both SQL’s. The following is a cheat sheet which will help users:
MySQL (mysql)
Postgres (psql)
Extra Notes
\e 
\e 
Edit the buffer with external editor. Postgres also allows \e filename which will become the new buffer
\g 
\g 
Send current query to the server
\h 
\h
Gives help — general or specific
\n
\pset pager off
Turns the pager off. For PGSQL, the pager is only used when needed based on number of rows; to force it on, use \pset pager always
\d string 
No equivalent
Changes the delimiter
\c
\r 
Clears the buffer
\p 
\p 
Print the current buffer
\q or Quit or exit or [ctrl-c]
\q
Quit the client mysql> or psql>
\r [dbname] [dbhost]
\c [dbname] [dbuser]
Reconnect to server
\s 
No equivalent
Status of server. Some of the same info is available from the pg_settings table
\u dbname or  Use [db_name]
\c dbname
Connect to a database or use a different database.
\w
No equivalent
Do not show warnings. Postgres always shows warnings by default
\C charset Change the charset
\encoding encoding Change the encoding
Run \encoding with no argument to view the current one
\t Stop teeing output to file
No equivalent
However, \o (without any argument) will stop writing to a previously opened outfile
\G 
\x
Display results vertically (one column per line). Note that \G is a one-time effect, while \x is a toggle from one mode to another. To get the exact same effect as \G in Postgres, use \x\g\x
\R string
\set PROMPT1 string
To Change the prompt. Note that the Postgres prompt cannot be reset by omitting an argument. A good prompt to use is:\set PROMPT1 '%n@%`hostname`:%>%R%#%x%x%x '
\P pagername
Environment variable PAGER or PSQL_PAGER
Change the current pager program
\. filename 
\i filename
Include a file as if it were typed in.
\T filename
No direct equivalent
Sets the tee output file. Postgres can output to a pipe, so you can do: \o | tee filename
\W 
No equivalent
To Show warnings. Postgres always show warnings by default
\?
\?
Help for Internal Commands.
\# 
No equivalent
To rebuild tab-completion hash. Not needed in Postgres, as tab-completion in Postgres is always done dynamically
\! command 
\! command 
To execute a shell command. If no command is given with Postgres, the user is dropped to a new shell (exit to return to psql)
Timing is always on
\timing Toggles timing on and off

No equivalent
\t Toggles “tuple only” mode
This shows the data from select queries, with no headers or footers
show tables; List all tables
\dt or /dt+
Many also use just \d, which lists tables, views, and sequences
desc tablename; 
\d tablename
Display information about the given table.
show index from tablename; 
\d tablename
Display indexes on the given table. The bottom of the \d tablename output always shows indexes, as well as triggers, rules, and constraints
show triggers from tablename; 
\d tablename
Display triggers on the given table. The bottom of the \d tablename output always shows indexes, as well as triggers, rules, and constraints
show databases; 
\l 
List all databases
No equivalent
\dn
To List all schemas. MySQL does not have the concept of schemas, but uses databases as a similar concept
select version(); 
select version(); 
Show backend server version
select now(); 
select now(); 
Show current time. Postgres will give fractional seconds in the output
select current_user;
select current_user;
Show the current user.
select database(); 
select current_database();
Show the current database.
show create table tablename; 
No equivalent
Output a CREATE TABLE statement for the given table. The closest you can get with Postgres is to use
pg_dump --schema-only -t tablename
show engines; 
No equivalent
To List all server engines. Postgres does not use separate engines
CREATE object ... Create an object: database, table, etc.
CREATE object ... Mostly the same
Most CREATE commands are similar or identical. Lookup specific help on commands (for example: \h CREATE TABLE)
SHOW INDEX FROM some_table;
Show indices of some_table (in case of MySQL)
\di
Show all indices of database (PostgreSQL)
Display Indices.
mysqldump
pg_dumpall
pg_dumpall is designed to dump all the databases and invokes pg_dump to do it. It can also be used to dump global values like roles and tablespaces.
Example with mysql:
mysqldump –all-databases > /path/to/file.sql
Example with postgres:
pg_dumpall > /path/to/file.sql
mysqldump
pg_dump
pg_dump is used for dumping individual databases.
Example with mysql:
mysqldump mydatabase > /path/to/file.sql
Example with postgres:
pg_dump mydatabase > /path/to/file.sql
innodb_top
pg_top
innodb_top does not ship with mysql and is a third-party executable. It shows you things like inserts per second, updates per second, transactions per second and gives a good overview as to what is going on with the server pg_top shows similar things but is laid out more similarly to the native linux “top” program.
mysql
psql
These commands allow to access the CLI utility.
Passing query with mysql (-e for execute):
mysql -e “select * from table_name;”
Passing query with postgres (-c for command):
psql -c “select * from table_name;”
Passing sql into the utility.
show databases;
\l or \list
This lists the databases on the server instance you are connected to or that you have access to.
select * from mysql.user;
select * from pg_user; or\du
Shows all users and their global permissions. Postgres lists the permissions as a comma separated string under a filed called attributes. Mysql shows a boolean value for each of the possible permissions.
show full processlist;
select * from pg_stat_activity;
This will show all the queries that are currently running and how long they have been running for.
show variables;
show all;
This will show all the current values for the variables. Postgres even offers a brief description of what each variable is.
show engine innodb status\G
SELECT * FROM pg_stat_activity;
SELECT * FROM pg_stat_database;
SELECT * FROM pg_stat_user_tables;
SELECT * FROM pg_stat_user_indexes;
SELECT * FROM pg_locks;
There is no central place in postgres to get all the information obtained by running show engine innodb status in mysql. There are several queries you can run to get roughly equivalent data though.
show slave status\G
select * from pg_stat_replication;
select now() – pg_last_xact_replay_timestamp() AS replication_delay;
Shows replication information. On idle write masters you can errantly see replication report as behind or lagging. This is showing you the current timestamp minus the timestamp of the last item applied on the slave. If the master hasn’t written anything, the slave has not applied anything and can show you that it is behind. It is recommended to use a written timestamp from cron every minute to gauge replication. This achieves 2 things, it will guarantee regular writes to the master which will replicate to the slave, and monitoring can look to the timestamp in a location to know if the server is behind.
stop slave;
start slave;
select pg_xlog_replay_pause();
select pg_xlog_replay_resume();
Pause/resume/stop/start replication on the slave node
SHOW FULL TABLES IN database_name WHERE TABLE_TYPE LIKE 'VIEW';
\dv
\dv schema_name.*
List views
SHOW [EXTENDED] [FULL] {COLUMNS | FIELDS}
    {FROM | IN} tbl_name
    [{FROM | IN} db_name]
    [LIKE 'pattern' | WHERE expr]
\dt+
\dv+
\d+ table_name
Get extended information (add + to any command)
In MySQL, The optional EXTENDED keyword causes the output to include information about hidden columns that MySQL uses internally and are not accessible by users.The optional FULL keyword causes the output to include the column collation and comments, as well as the privileges you have for each column.

Feel free to add in a comment if some commands are not listed. I have not listed the other queries like SELECT, ALTER, DELETE and etc as most of the syntax are similar just follow the documentations mentioned in Postgresql and Mysql websites

"ADXTaskPane" popping out of outlook main window


Symptom:


Whenever Outlook is opened, the Azure Information Protection (AIP) toolbar pops up in another window named as "ADXTaskPane" other than Outlook windows. Which will look something like following:
 
When you put your Mouse cursor on the Outlook icon in the Windows Taskbar you can see something like following:

Cause:

This issue is related with Azure Information Protection (AIP) Toolbar compatibility.

Solution:

In Order to resolve the above issue, you can follow the following steps:

  1. Open the Office Application (Here it is Outlook) and navigate to File > Options > General > User Interface optionsYou can see the following option selected:
  2. Select Optimize for compatibility (application restart required)
  3. Restart Office Applications i.e Outlook and other office apps.
  4. Now Verify the issue will be fixed.