Skip to content

Instantly share code, notes, and snippets.

View RobbiNespu's full-sized avatar
:octocat:
Wut?

Robbi Nespu RobbiNespu

:octocat:
Wut?
View GitHub Profile
import java.util.*;
import java.util.logging.*;
import java.util.stream.Collectors;
public class WRTVCalculationV2 {
// ========== LOGGER SETUP ==========
private static final Logger logger = Logger.getLogger(WRTVCalculationV2.class.getName());
private static LogLevel verbosity = LogLevel.INFO;
@RobbiNespu
RobbiNespu / PalletBillingPivot.java
Last active May 22, 2026 01:45
MSTO - HP1,M2,4,6 Exclude WRTV
import java.util.*;
import java.util.stream.Collectors;
public class PalletBillingPivot {
// ---- Raw inventory row from "WH68 Product Expiry" sheet ----
static class InventoryRow {
String billable; // "Y" / "N"
String billFreq; // "MTH" / "WKLY - PICK" / "WKLY - RESERVE" / ...
String zone; // HP1, M2, M4, M6, WRTV, FP, R312, ...
import java.util.*;
import java.util.stream.*;
public class WeeklyStoragePivot {
// Record representing one row from the source data
record SnapshotRow(
String billableLocation,
String billType, // Bill (Mth/Wkly)
String zoneGroup,
@RobbiNespu
RobbiNespu / file.sql
Created July 9, 2024 01:10
MSQL : Find location of DATA and LOG
SELECT
d.name AS DatabaseName,
mf.type_desc AS FileType,
mf.physical_name AS FilePath
FROM
sys.master_files mf
JOIN
sys.databases d ON mf.database_id = d.database_id
WHERE
d.name NOT IN ('master', 'model', 'msdb', 'tempdb') -- Exclude internal databases
{
"type": [
"h-entry"
],
"properties": {
"summary": [
"Want to read: Bergaji dan pokai by Suraya Zainudin, ISBN: 9789672459552"
],
@RobbiNespu
RobbiNespu / sp_KillDeadlocks.sql
Created December 27, 2023 22:15
MSSQL store procedure - kill deadlock
USE YourDatabaseName; -- Replace 'YourDatabaseName' with your actual database name
CREATE PROCEDURE sp_KillDeadlocks
AS
BEGIN
SET NOCOUNT ON;
DECLARE @deadlockID INT;
-- Create a temporary table to store deadlock information
Release notes of 5.15.2 (18096)
Resolved Issues
-Minor bug fixes
-Security enhancements
Release notes of 5.15.1 (17948)
Resolved Issues
-Minor bug fixes
Release notes of 5.15.0 (17890)
@RobbiNespu
RobbiNespu / Move TempDB.sql
Created May 26, 2023 04:02 — forked from FlogDonkey/Move TempDB.sql
Moves SQL TempDB files to designated location, and sizes them appropriately. If there are multiple instances hosted on the same SQL Server, divide the drive size by the instance count, and create folders for each instance name on the destination drive.
/*
Snippet is nuts and bolts for creating/moving to an isolated tempdb drive.
After you run this, SQL Server must be restarted for it to take effect
*/
DECLARE @DriveSizeGB INT = 40
,@FileCount INT = 9
,@RowID INT
,@FileSize VARCHAR(10)
,@DrivePath VARCHAR(100) = 'T:\' + @@SERVICENAME + '\';
@RobbiNespu
RobbiNespu / TOS_DI-win-x86_64.ini
Created February 14, 2023 00:07
Default talend
-vmargs
-Xms512m
-Xmx1536m
-Dfile.encoding=UTF-8
-Dosgi.requiredJavaVersion=1.8
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:MaxMetaspaceSize=512m
@RobbiNespu
RobbiNespu / find.sh
Created December 26, 2022 14:01
Posix - Speed up "find" + "exec" command (recursive)
# let see how many files we have
$ find . -type f | wc -l
36367
# lets check every file status
$ time find . -type f -exec stat {} \; > /dev/null
real 0m40.107s
user 0m14.381s
sys 0m26.410s