MS SQL DB Stuck Going Offline

declare @kill varchar(8000) = ''; select @kill=@kill+'kill '+convert(varchar(5),spid)+';' from master..sysprocesses where dbid=db_id('MyDB'); exec (@kill); …

PPTPClient Ubuntu commands

Setup new VPN Connection pptpsetup --create my_tunnel_name --server server.com --username user --password pass --encrypt Delete VPN Connection pptpsetup --delete my_tunnel_name Bring Tunnel Up pon my_tunnel_name Bring Tunnel Down poff my_tunnel_name Bring Tunnel Up and Debug sudo pon my_tunnel_name debug dump logfd 2 nodetach …

PowerShell sqlcmd with custom port

sqlcmd -S "database,1433" -d master -U username -P password -b -r -q "select * from tableā€ …

Shrink SQL Server Database

dbcc shrinkdatabase (DataBase) …

SQL Server Alter Database File Growth

ALTER DATABASE [DBNAME] MODIFY FILE ( NAME = N'LogicalFileName', FILEGROWTH = 10%) …

Execute Bash Script via PHP

<?php $message=shell_exec("/home/username/script.sh 2>&1"); print_r($message); ?> …