Skip to content

Instantly share code, notes, and snippets.

View mostlydev's full-sized avatar

Wojtek mostlydev

View GitHub Profile
@mostlydev
mostlydev / defrag_all_indices.sql
Created February 10, 2023 03:55
Rebuild all indices in a SQL Server database
USE Patients
GO
DECLARE @NoOfPartitions BIGINT;
DECLARE @objectid INT;
DECLARE @indexid INT;
DECLARE @idxname NVARCHAR(255);
DECLARE @objname NVARCHAR(255);
DECLARE @partitionnum BIGINT;
DECLARE @schemaname NVARCHAR(255);
DECLARE @partitions BIGINT;
@mostlydev
mostlydev / windows_hardening.cmd
Created April 20, 2022 12:28 — forked from ricardojba/windows_hardening.cmd
A Windows hardening script
::##########################################################################################################################
::
:: This script can ruin your day, if you run it without fully understanding what it does, you don't know what you are doing,
::
:: OR BOTH!!!
::
:: YOU HAVE BEEN WARNED!!!!!!!!!!
::
:: This script is provided "AS IS" with no warranties, and confers no rights.
:: Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section,
@mostlydev
mostlydev / dp2-true-size-printing.md
Last active February 20, 2021 21:54
True-size printing using DICOM Printer 2

There are three steps to get true size output

Disable magnification.

In the configuration, you have to add or modify three elements:

Resolution should match your imager resolution, e.g., "320 x 320" for Drystar 520x.
MagnificationType needs to be set to NONE, and.
RequestedDecimateCropBehaviour needs to be set to CROP.

DEBUG [a46b80e4] Running if test ! -d /u/apps/cc-oscar-dev/current; then echo "Directory does not exist '/u/apps/cc-oscar-dev/current'" 1>&2; false; fi on cc-hyperflux
DEBUG [a46b80e4] Command: if test ! -d /u/apps/cc-oscar-dev/current; then echo "Directory does not exist '/u/apps/cc-oscar-dev/current'" 1>&2; false; fi
DEBUG [a46b80e4] Finished in 0.967 seconds with exit status 0 (successful).
INFO [2eeac74f] Running RBENV_ROOT=~/.rbenv RBENV_VERSION=1.9.3-p448 ~/.rbenv/bin/rbenv exec bundle exec unicorn -c /var/www/current/config/unicorn.rb -E development -D on cc-hyperflux
DEBUG [2eeac74f] Command: cd /u/apps/cc-oscar-dev/current && RBENV_ROOT=~/.rbenv RBENV_VERSION=1.9.3-p448 ~/.rbenv/bin/rbenv exec bundle exec unicorn -c /var/www/current/config/unicorn.rb -E development -D