This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Monthly CSV Combiner | |
| Write-Host "Monthly CSV Combiner" -ForegroundColor Cyan | |
| # -------------------- FUNCTION DEFINITIONS -------------------- | |
| function New-OutputFolder { | |
| <# | |
| .SYNOPSIS | |
| Creates the output folder if it doesn't exist | |
| #> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function G2J(gDates) { | |
| // Handle arrays and single values | |
| if (Array.isArray(gDates)) { | |
| return gDates.map(row => row.map(cell => convertToJalaliSafe(cell))); | |
| } | |
| return convertToJalaliSafe(gDates); | |
| } | |
| function convertToJalaliSafe(gDate) { | |
| // Normalize input to a JS Date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #login as superuser into postgres super user | |
| .\psql.exe -u postgres | |
| #show all database | |
| \l | |
| #change the current database to the one that you want to show tables: | |
| \c testDb | |
| # command from the PostgreSQL command prompt to show tables in the selected database: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #check sign version v1 and v2 | |
| java -jar .\apksigner.jar verify --verbose --print-certs .\test-app.apk | |
| #check sign version v1, v2, v3, v4 which set by enableV3Signing, enableV4Signing | |
| java -jar .\apksigner.jar verify -v -v4-signature-file .\test-app.apk.idsig .\test-app.apk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ####################################################################################################### | |
| ##os-centos-7## | |
| #get centos version | |
| $cat /etc/centos-release | |
| #get system info | |
| $hostnamectl | |
| #get kernel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SWITCHOFFSET(CONVERT(datetimeoffset, [CreatedAt]), DATENAME(TzOffset, SYSDATETIMEOFFSET())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git clean -xdf --dry-run //to remove absolutely every file on the .gitignore list | |
| dotnet new gitignore //touch .gitignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- sys.dm_os_performance_counters is a system Dynamic Management View (DMV) that returns one row for each SQL Server performance counter. It's useful for obtaining information about current performance counter values. | |
| declare @cntr_value bigint | |
| Select @cntr_value=cntr_value | |
| from sys.dm_os_performance_counters | |
| where instance_name='Fabrics' and | |
| counter_name='Write Transactions/sec' | |
| waitfor delay '00:00:01' | |
| Select cntr_value -@cntr_value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --<sys.sp_MSforeachtable>: execute sp_spaceused for all of database table | |
| --<sp_spaceused>: return rows, index size and data size of table | |
| EXEC sys.sp_MSforeachtable 'sp_spaceused ''?'''; | |
| --or as table | |
| USE [Fabrics] | |
| GO | |
| CREATE TABLE #TableSpaceUsed( | |
| [name] [nvarchar](120) NULL, | |
| [rows] [nvarchar](120) NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Fabrics V1.2 | |
| -- Creating a SQL database from scratch | |
| USE Fabrics | |
| GO | |
| IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_Fabrics]') AND type in (N'P', N'PC')) | |
| DROP PROCEDURE usp_Fabrics | |
| GO | |
| CREATE PROCEDURE [dbo].usp_Fabrics | |
| (@CreateClients INT = 2500, | |
| @CreateOrders INT = 5000) |
NewerOlder