Skip to content

Instantly share code, notes, and snippets.

@ivanhub
ivanhub / gist:53225a7723e1d8e52ea1466b28a971ed
Created September 29, 2025 09:37 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ivanhub
ivanhub / edge.debug.cmd
Last active April 18, 2023 06:35
Edge Debug Pac
C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --log-net-log=C:\temp\logFull.json --net-log-capture-mode=IncludeSocketBytes
# autoprox
# https://github.com/pierrecoll/autoprox
# https://emeaie.azurewebsites.net/pierrelc/autoprox.zip
# https://learn.microsoft.com/ru-ru/troubleshoot/developer/browsers/connectivity-navigation/optimize-pac-performance
@ivanhub
ivanhub / best_html_minifier
Created March 18, 2023 15:18
best_html_minifier
<?php
if (!isset($_GET['dev'])) {
$cid = $modx->resource->get('id');
//$exclude = $modx->getOption('exclude',$scriptProperties,'12');
if(empty($cid)) { return; }
if(in_array($cid,explode(',',$exclude))) { return; }
$output = &$modx->resource->_output;
//remove all comments
@ivanhub
ivanhub / remove-feature.ps1
Created February 27, 2023 16:22
Remove windows features, powershell
Get-WindowsFeature | Where-Object -FilterScript { $_.Name -Eq "NAME" }| Uninstall-WindowsFeature
@ivanhub
ivanhub / Single_user.sql
Created February 13, 2023 11:30
Single USER SQL
USE [master];
GO
ALTER DATABASE [WSS_Content1] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE [WSS_Content1] MODIFY NAME = [WSS_Content2];
GO
ALTER DATABASE[WSS_Content2] SET MULTI_USER;
GO
SELECT DB_NAME(database_id), last_user_seek = MAX(last_user_seek), last_user_scan = MAX(last_user_scan), last_user_lookup = MAX(last_user_lookup), last_user_update = MAX(last_user_update) FROM sys.dm_db_index_usage_stats GROUP BY database_id ORDER BY MAX(last_user_update)
@ivanhub
ivanhub / users_and_groups.ps1
Last active February 3, 2023 13:05
Export all users with their permissions Sharepoint
$web = Get-SPWeb http://SITE
$user=$web.AllUsers
$user|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}} | set-Content -Encoding UTF8 filename
or
get-SPUser -Web http://SITE|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}} | set-Content -Encoding UTF8 filename
or
@ivanhub
ivanhub / SP_REPAIR
Created January 11, 2023 08:02
SP_REPAIR
Repair-SPManagedAccountDeployment
Set-SPManagedAccount -UseExistingPassword -Identity DOMAINA\SPSAdmin
@ivanhub
ivanhub / last_db_access_LIST.sql
Created January 6, 2023 10:02
last touches to dbs (list)
SELECT DB_NAME(database_id), last_user_seek = MAX(last_user_seek), last_user_scan = MAX(last_user_scan), last_user_lookup = MAX(last_user_lookup), last_user_update = MAX(last_user_update) FROM sys.dm_db_index_usage_stats GROUP BY database_id ORDER BY MAX(last_user_update)
@ivanhub
ivanhub / runas_required_elevation.cmd
Created December 23, 2022 06:10
runas_required_elevation
runas.exe /noprofile /env /user:domain\login "cmd /c ^C:\app.exe^"