Skip to content

Instantly share code, notes, and snippets.

View dark452's full-sized avatar
🎯
Focusing

dark452

🎯
Focusing
View GitHub Profile
@dark452
dark452 / ase_db_usage.sql
Last active June 14, 2023 03:55
SAP ASE Database current usage
SELECT db_name(d.dbid) AS Database_Name,
( convert(char(9), ceiling (sum(case when u.segmap != 4 then u.size/1048576.*@@maxpagesize end )))) AS Data_Total_MB,
(convert(char(14), (convert(numeric(8,1),((sum(case when u.segmap != 4 then u.size/1048576.*@@maxpagesize end ))) - (sum(case when u.segmap != 4 then size - curunreservedpgs(u.dbid, u.lstart, u.unreservedpgs) end)/1048576.*@@maxpagesize))))) AS FREE_MB,
(convert(numeric(12,2), 100 * (1 - 1.0 * sum(case when u.segmap != 4 then curunreservedpgs(u.dbid, u.lstart, u.unreservedpgs) end) / sum(case when u.segmap != 4 then u.size end)))) AS '% Used'
FROM master..sysdatabases d, master..sysusages u
WHERE u.dbid = d.dbid AND d.status NOT IN (256,4096)
GROUP BY d.dbid
ORDER BY 4 DESC
@dark452
dark452 / hex_to_pdf.sh
Created April 9, 2020 00:31
Transform all the hex files stored in a folder to pdf
#!/bin/bash
#----------------------------------------------------------------------------
#-- description : Transform all the hex files in the folder to pdf
#----------------------------------------------------------------------------
#-- Script by Ingeborg Muñoz - imunoz@redeshost.cl
#----------------------------------------------------------------------------
T="$(date +%s)"
SOURCE_FOLDER="/home/some_home/PDFs_Files/"
TYPE="$1/"
EXTENSION=".pdf"