Category Archives: Reference

Short references for personal… reference. Basically a howto for the tech-savvy.

My tweaks to Kali Linux (note to self)

Here are some of the things I did to make Kali Linux 2016.1 suit my taste, mostly intended as a note to myself, but posted here in case it helps anyone else. General checklist Install aptitude and update everything Add settings icon to left panel Enable mouse tap to click in “Settings => Mouse & […]

Enabling Quick Launch in Windows 10

I have my taskbar set to “Use small taskbar buttons” and “Never combine”, probably as much out of habit as anything else. This means that when I pin programs to the taskbar, opening one of them, suddenly making it display a title for one or more windows, will push any pinned programs to its right […]

Find and kill long running MS SQL Server queries

I have to admit this is cargo cult SQL to me, but here’s how to find running queries, sorted by their total elapsed time: SELECT [sqltext].[TEXT], [req].[session_id], [req].[status], [req].[command], [req].[cpu_time], [req].[total_elapsed_time] FROM [sys].[dm_exec_requests] [req] CROSS APPLY [sys].[dm_exec_sql_text](sql_handle) AS sqltext ORDER BY [req].[total_elapsed_time] DESC To kill a given query, use: kill <session_id> ..without the brackets <>, […]

Squid Compile with SSL support under Debian Jessie

Here’s how: apt-get update # install required dev packages apt-get install -y openssl devscripts build-essential libssl-dev # install debian squid3 source code apt-get source -y squid3 # install all required dependeny packages apt-get build-dep -y squid3 # reconfigure cd squid3-3.4.8/ vi debian/rules root@jessie:~/squid3-3.4.8# diff /tmp/rules debian/rules 46c46,48 < –with-default-user=proxy — > –with-default-user=proxy \ > –enable-ssl […]

A few group policies I use on Windows 10

Disable the lock screen, always showing a login prompt: Group Policy Editor (gpedit.msc) => Computer Configuration => Administrative Templates => Control Panel => Personalization => Do not display the lock screen Disallow the use of OneDrive: Group Policy Editor (gpedit.msc) => Computer Configuration => Administrative Templates => Windows Components => OneDrive => Prevent the usage […]

Wiping an (Azure) SQL Server database, deleting all tables

Just for personal reference USE [mydb] GO WHILE(EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE=’FOREIGN KEY’)) BEGIN DECLARE @sql0 NVARCHAR(2000) SELECT TOP 1 @sql0=(‘ALTER TABLE [‘ + TABLE_SCHEMA + ‘].[‘ + TABLE_NAME + ‘] DROP CONSTRAINT [‘ + CONSTRAINT_NAME + ‘]’) FROM information_schema.table_constraints WHERE CONSTRAINT_TYPE = ‘FOREIGN KEY’ EXEC (@sql0) PRINT @sql0 END GO DECLARE @sql1 NVARCHAR(2000) […]

Mounting and using KVM raw image files on the host system

Boldly stolen from David Champion at the University of Chicago, and archived for personal reference. All credits to that page. kpartx will scan a block device — e.g., your /dev/loop0 — and create device-mapped specials under /dev/mapper for the partitions. Then you can address individual partitions. (N.B.: When done, before you can losetup -d the […]