Wednesday, November 10, 2021

Dark Theme for Windows Outlook and SSMS

 Well Black is the new Red... What can I say.. I think it clears a lot of clutter and you feel focused on the right things. 

Right to the meat. 

nnn

For Switching Dark Mode in Windows 10. Just search for "Dark Theme" in Cortana and you should get the below option 

Just change the present setting to Dark and you should be golden. 


Next Outlook . Goto File->Options->General

Here you will find a setting Personalize your copy of Microsoft Office 


Next SSMS ->

First open a notepad with  "Run as Admin". Then open the file ssms.pkgundef and find the line "Remove Dark Theme". 




You should find the file in C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE. I have version 18 hence this path you can do a search for the file in "program files (x86) folder". Once you find the line just comment the line with "//" without the quotes as shown in the image below. 

Once done save the file and then open the SSMS. Goto

Tools->Options->Environment->General->Colour Theme-> Dark




So these are the three essential things I needed the black theme for.                                                        
Let know what application you need black theme for.                                                                              


Thanks,                                                                                                                                                        
Tushar                                                                                                                                                                

Thursday, October 28, 2021

AutoScroll using Python

 So there are times when you want your screen to autoscroll. Well I just have a function where I need to play a guitar and the song is too long for me to remember all the chords and I cannot scroll when I am playing the guitar. Hence the requirement. The solution was too naïve than what I thought it would. 


You pop up your favourite Python IDE and add import the package pyautogui  this is the Hero of our solution. 

For most of us using Windows with Powershell you should have python installed. So just goto your powershell and type py.exe 





Now install the pyautogui module. 

py -m pip install pyautogui

Now go to your python shell and write the below code. 



Hope this helps. 


Thanks,

Tushar


Thursday, September 30, 2021

Better than tempered glass for iPhone 12 Pro Max

 Hi Guys,

You must be going crazy to get your hands on a good tempered glass for your iPhone 12 Pro Max or 13 Pro Max. The only thing you get in the market is a tempered glass for front screen and a PU material for back cover. 

This is a place which I found over internet and then started using the cover for the last one month. 

https://millioncases.com/collections/iphone-12-pro-max/products/iphone-12-pro-max-luxury-square-metal-frame-case?variant=40447805063330


This is a very good cover with magnetic sides and protects both front and back cover. I have never used a cover before on any phone but this product has a glass back cover and there is no tempered glass available for back cover of iPhone Pro Max. Hence had to take this option. 


Hope this helps everyone. Bye till we meet again.

Thanks,

Tushar Kanti

Tuesday, June 15, 2021

Shayad Chords

Shayad is a very special song from the Movie Luv Aaj Kal 2(the movie should have been christened as Luv Aaj Kal 0.5  😈 )

Sung by Arijit where he also plays the Acoustic Guitar. Music by Pritam 


[Chords]: Em , Am , D , G , Bm , C

 [Intro]

C               D               G

Shayad kabhi na keh sakoon main tumko

Am        D             Em

Kahe bina samajh lo tum shayad

C           D               G

Shayad mere khayal mein tum ik din

Am         D             Em

Milo mujhe kahin pe ghum shaayad

          G                 C

Jo tum na ho... rahenge hum nahin

          Em            D

Jo tum na ho... rahenge hum nahin

  Bm            C                   G

Na chahiye kuch tum se zyada tum se kam nahin

          Em                D

Jo tum na ho... toh hum bhi hum nahi

          C                 D

Jo tum na ho... toh hum bhi hum nahi

  Bm            C                   G

Na chahiye kuch tum se zyada tum se kam nahin

 

 

[Verse 1]

Bm

Aankhon ko khaab dena

C

Khud hi sawaal karke

G                   D

Khud hi jawaab dena teri taraf se

Bm

Bin kaam kaam karna

C

Jaana kahin ho chaahe

G                   D

Har baar hi guzarna teri taraf se

   G                    C

Ye koshishein toh hongi kam nahin

   Em                   D

Ye koshishein toh hongi kam nahin

  Bm            C                   G

Na chahiye kuch tum se zyada tum se kam nahin

          G                 C

Jo tum na ho... rahenge hum nahin

          Em            D

Jo tum na ho... rahenge hum nahin

  Bm            C                   G

Na chahiye kuch tum se zyada tum se kam nahin


The Full Song Lyrics:

 Shayad kabhi na kehe sakoon main tumko


Kahe bina samajh lo tum shayad

Shayad mere khayal mein tum ik din

Milo mujhe kahin pe ghum shayad


Jo tum na ho... rahenge hum nahin

Jo tum na ho... rahenge hum nahin

Na chahiye kuch tum se zyada tum se kam nahin


Jo tum na ho... toh hum bhi hum nahi

Jo tum na ho... toh hum bhi hum nahi

Na chahiye kuch tum se zyada tum se kam nahin


Aankhon ko khaab dena

Khud hi sawaal karke

Khud hi jawaab dena teri taraf se

Bin kaam kaam karna

Jaana kahin ho chaahe

Har baar hi guzarna teri taraf se


Ye koshishein toh hongi kam nahin

Ye koshishein toh hongi kam nahin

Na chahiye kuch tum se zyada tum se kam nahin


Jo tum na ho... rahenge hum nahin

Jo tum na ho... toh hum bhi hum nahin

Na chahiye kuch tum se zyada tum se kam nahin


Jo tum na ho...

Jo tum na ho...

Jo tum na ho...

Saturday, April 24, 2021

Scripting Domain Logins , Server Roles , Database User and User Permissions.

 Hi Guys,

Been so long I did post something. Well I really need to work on my clould blog as well but for today it will be just a simple blog on user security. 


I had to run through a lot of hoops so thought I will share the scripts with you. The requirement was to script out the Logins and the related users in the databases from one environment to other. 

So here goes the script. You need to replace the  [domain\windowslogin] with you DomainLogin for which you want to script out the permission. 

IF  (SELECT OBJECT_ID('msdb.dbo.storepermission') ) IS  NULL

begin

CREATE TABLE msdb.dbo.storepermission  (

ServerName sysname,

DBName sysname,

USerName sysname,

TypeOfLogin nVARCHAR(100),

PermissionLevel NVARCHAR(100),

TypeOfRole NVARCHAR(100)

)

END 

TRUNCATE TABLE msdb.dbo.storepermission


DECLARE @@login_name sysname ='domain\windowslogin'

--SELECT @@login_name

DECLARE @dbname VARCHAR(50)   

DECLARE @statement NVARCHAR(MAX)


DECLARE db_cursor CURSOR 

LOCAL FAST_FORWARD

FOR  

SELECT name

FROM master.sys.databases

WHERE 1=1

AND state_desc='online' 

OPEN db_cursor  

FETCH NEXT FROM db_cursor INTO @dbname  

WHILE @@FETCH_STATUS = 0  

BEGIN  

--SELECT @@login_name

SELECT @statement = 'use '+@dbname +';'+ 'insert into msdb.dbo.storepermission(ServerName,DBName,USerName,TypeOfLogin,PermissionLevel,TypeOfRole)SELECT


 ServerName=@@servername, dbname=db_name(db_id()),p.name as UserName, p.type_desc as TypeOfLogin, pp.name as PermissionLevel, pp.type_desc as TypeOfRole 


FROM sys.database_role_members roles


JOIN sys.database_principals p ON roles.member_principal_id = p.principal_id


JOIN sys.database_principals pp ON roles.role_principal_id = pp.principal_id

where p.name=''domain\windowslogin''' -- Change the user name


EXEC sp_executesql @statement

PRINT @statement


FETCH NEXT FROM db_cursor INTO @dbname  

END  

CLOSE db_cursor  

DEALLOCATE db_cursor





 SELECT 'IF NOT EXISTS(SELECT principal_id FROM sys.server_principals WHERE name = ''domain\windowslogin'') BEGIN CREATE LOGIN [domain\windowslogin] FROM WINDOWS  END; '

 

SELECT

--R.name AS server_role

-- , P.name AS role_member ,

'EXEC master..sp_addsrvrolemember N' + '''' + P.name + '''' + ', N' + '''' + R.name + '''' + ';' AS command

FROM sys.server_role_members RM 

INNER JOIN sys.server_principals P ON RM.member_principal_id = P.principal_id

INNER JOIN (SELECT principal_id, name FROM sys.server_principals WHERE type_desc = 'SERVER_ROLE') R

ON RM.role_principal_id = R.principal_id

WHERE P.name NOT LIKE '#%'

AND P.name NOT LIKE 'NT %'

AND P.type_desc <> 'SERVER_ROLE'

AND P.name NOT IN ('sa')

AND P.name='domain\windowslogin'

ORDER BY R.[name], P.[name]


SELECT 'use '+DBName+' IF NOT EXISTS(SELECT principal_id FROM sys.database_principals WHERE name = '''+USerName+' '') BEGIN CREATE USER ['

+USerName+'] FOR LOGIN ['+ USerName+'] END ; EXEC sp_addrolemember N'''+PermissionLevel+''', N'''+USerName+''';'

 FROM msdb.dbo.storepermission


Hope this helps you. 


Thanks,

Tushar

Wednesday, February 24, 2021

Updating the Domain Credentials from Remote Desktop System

 Hi,

I have had so many opportunities when I had to change my passwords but I did not remember how to get the change password console in the remote system.

So without further adieu let me give you the shortcut to the password change console.

This works with Windows Server 2016 so I assume it will work with most of the newer versions.


The shortcut is [cntrl] + [alt] + [end]


So you will be able to see this console and then you just need to click on the Change a password option and the change password console will open up. 

Hope this helps you next time when you want to reset a password for your domain logon from a remote desktop system.


Thanks,

Tushar Kanti


Thursday, February 11, 2021

Getting Lazy is Getting Comfortable or Getting Old

 Hey,

Been a month already into new year and I have not put in anything in my favourite blog. You know what I think after sometime we start to find happiness everywhere and that is where we start getting mature and start behaving matured. One we understand that we need to get money to pay bills and two we know where to get easy money(keeping a day job) and where to get real money aka investment in real estate, travel blogging, basically following your passion not limited to your study or bathroom :)


So we all have developed some basic skills (IT Support is not a skill we develop it's like we were enslaved into it), like Technology, Music, Art; and it is good enough to pay for our real bills but we have put in so much of planning small things that we are losing the larger picture. 

Or may be just me.. lol.. 

So you wana get up early and strech out and then you see the guitar giving you the sad stare and then when you start tuning the guitar to play you start to think that the code you left running in production last night might have completed and you will need to enable the job which you disabled to check the issues in the data consistancy. And trust me by the time you login to the VPN to connect you realize your phone is out of juice and just when you plug in the charger you realise that the socket is still broken which you had to fix but then you forgot to get the screw driver which was broken.. and on and on... and suddenly you realise your kid is up. 


You get it right that we have been amazingly undisciplined in our life so when we try to work on something i.e. we want to take a step ahead in our life with anyone of our so called passions we need to take atleast a couple to steps back and then revise things and then take a step forward. This has been a gift of the habbit of fast food generation that we are. We need things super fast but we do not realise that patience is one thing that we need to have in anything that we want to achieve. 


So I think we need to slice our life (hey not literally just a time slice will do)  and then use those slices to make most of it. We need to make sure that every slice is fun and we need to have more of it. 


So initially it will all be boring and slow and may be it will not make sense but I think it will work out pretty well soon. I used to play the guitar and I still am there but now I do not play to go somewhere I just play to play and to enjoy what I can do with it. Singing is something I have lost the touch but I miss that the most. I mean so many things to do in just one life. 


Of all the things that I have lost I miss my time the most. But it's just been 10 years that I been like this and I think I will turn around, stronger than before. 


Tushar