Skip to content

Instantly share code, notes, and snippets.

View jkstill's full-sized avatar
🏠
Working from home

Jared jkstill

🏠
Working from home
View GitHub Profile
@jkstill
jkstill / proc_net_tcp_decode
Last active April 17, 2024 07:03
decode entries in /proc/net/tcp
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]
@jkstill
jkstill / gist:f731aa7eed90be2a9cda0d1bf47170ee
Created February 21, 2024 00:44
custom ad block hosts file for dnsmasq
#!/usr/bin/env bash
set -eu
echo
echo Pulling latest Steven Black hosts file
echo
# curl and openssl built
# openssl /usr/local/ssl
@jkstill
jkstill / pt-check.c
Created October 4, 2023 00:32 — forked from carter-yagemann/pt-check.c
Quick and dirty check for Intel Processor Trace (PT) features.
/*
* Copyright 2019 Carter Yagemann <yagemann@gatech.edu>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
-- showlock.sql - show all user locks
--
-- see ML Note 1020008.6 for fully decoded locking script
-- parts of the that script to not work correctly, but the
-- lock types are current
-- (script doesn't find object that is locked )
--
-- speeded up greatly by changing order of where clause,
-- jks 04/09/1997 - show lock addresses and lockwait
@jkstill
jkstill / c2.sql
Created March 26, 2016 18:42
Test table for Timestamp Math Blog
col c1_dump format a70
col c1 format a35
col funcname format a15
set linesize 200 trimspool on
set pagesize 60
drop table timestamp_test purge;
@jkstill
jkstill / 0_reuse_code.js
Created March 26, 2016 18:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
-- showdf.sql
-- get from dba_data_files and dba_temp_files rather that v$ views
-- jkstill - 10/29/2008 - changed method of getting free TEMP space
-- it was incorrect. currently still a compromise, but more correct
-- added pct_capacity
-- jkstill - 10/29/2008
-- 2 calculations had '/' on a line by itself
-- works in 9i, but not in 10g.
:
function usage {
echo $0
echo
echo -m info:oratab
echo
echo Get a report on missing oratab entries
echo $0 -m info
echo
@jkstill
jkstill / clear_for_spool.sql
Created December 9, 2010 19:52
clear sqlplus settings for spooled output
@@clears
set pages 0 lines 200 term on feed off
@jkstill
jkstill / get_all_privs.sql
Created December 9, 2010 19:51
Find all privileges granted to a user
-- get_all_privs.sql
-- for a user, find all privileges
-- even if assigned recursively through a role
@clears
set pagesize 50000
set linesize 120
col source_user new_value source_user noprint