Skip to content

Instantly share code, notes, and snippets.

View Clijsters's full-sized avatar

Dominique Clijsters Clijsters

View GitHub Profile
@Clijsters
Clijsters / rebuild-all-indices.sql
Created July 15, 2022 08:34
Get query to rebuild all indices by owner in oracle sql
with query as (
SELECT index_name FROM all_indexes where OWNER = '&owner'
)
select
'alter index &owner.'|| q.index_name || ' rebuild' || ';' cmd
from
query q;
@Clijsters
Clijsters / plot-blocking-issues.ps1
Last active September 10, 2018 12:54
Get a dependency Graph from blocking Jira Issues for all issues in epic
#=== Step 1: Download and Install (or just extract) GraphViz
#=== Step 2: Execute the following statements if you run this for the 1st time:
# Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
# Install-Module PSGraph -Scope CurrentUser -Force
# Install-Module JiraPS -Scope CurrentUser -Force
# Set-JiraConfigServer "https://jira.contoso.com"
#=== Step 3: Set the following variable to your GraphViz binary path:
$graphVizPath = "C:\path\to\your\folder\dot.exe"
#=== Step 4: Run this script by typing its path in PowerShell.
$enriched = @()
@Clijsters
Clijsters / Backup.ps1
Created November 13, 2017 11:20
Create Backups using snapshots and symlinks
Function snapshot() {
param(
[String]$Path,
[String]$Access,
[String]$BackupName
)
Write-Debug "Backing up $Path to $BackupName..."
#Create VSS Snapshot
$shadowCopy = (Get-WmiObject -List Win32_ShadowCopy).Create([System.IO.Directory]::GetDirectoryRoot($Path).ToString(), $Access)
@Clijsters
Clijsters / README.md
Last active January 6, 2023 13:01
tail color output

multiWatch.sh

An awk snippet for color highlighting Apache Logs pumped to the pipe with tail -f. Based on some basic awk RegEx and bash color codes. Keep in mind that this is generally really basic stuff and more than 10 years old. We don't do things like that anymore.

Example output

![Screenshot][example]

What's next

I want to make it more flexibel with json configuration. I'm thinking about an implementation with [npm Tail][npmtail], [jVectorMap][jvectormap] and some HTML websockets - An event based architecture which triggers a web app, console output, mail notifications and so on.

@Clijsters
Clijsters / removeCVS.ps1
Last active January 6, 2023 13:02
Everybody hates cvs
# "De-CVS's" a folder structure
$cd = (Get-Item -Path ".\" -Verbose).FullName
Write-Host "Are you sure you want to recursively delete all ""CVS""-Folders in ""$cd""?"
if ((Read-Host) -cin {"y", "yes"}) {
Write-Host "Deleting..."
Get-ChildItem -Force -Recurse | Where-Object { $_.Name -eq "CVS" } | ForEach-Object {
Write-Host $_.FullName;
Remove-Item $_.FullName -Recurse -Force
}
}
@Clijsters
Clijsters / openStartMenu.ps1
Created April 25, 2016 20:39
Create Start Menu with Shell4Core (PowerShell)
#Example call for powerShell startMenu: https://github.com/Clijsters/Shell4Core/blob/master/startMenu.ps1
#This illustrates how to create and show the Shell4Core Start Menu without an AppBar
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
. '.\startMenu.ps1'
$sm = startMenu((New-Object psobject -Property @{ABE=1;left=0;Bottom=0;}))
[System.Windows.Forms.Application]::Run(($sm))
#Use the following commit without parameter type definition: https://github.com/Clijsters/Shell4Core/commit/8d498052f0095028aadf74dbdd5ab4a4789bf8a7
@Clijsters
Clijsters / RunProcess.vb
Created April 17, 2016 17:35
RunProcess - executes process hidden, minimized, or shown
Module Module1
Sub Main(ByVal Args() As String)
Try
If Args.Length = 2 Then
Dim fileName As String = Args(1)
If Not String.IsNullOrEmpty(fileName) Then
If System.IO.File.Exists(fileName) Then
Dim startInfo As New ProcessStartInfo(fileName)
Select Case Args(0).ToLower()
Case "hide"
@Clijsters
Clijsters / LDAP_Query.vbs
Created October 19, 2015 19:32
Simple LDAP Query for cscript
'================
'Fragt ein LDAP-Verzeichnis ab.
'In dem Fall wird ein Domaincontroller nach den Domänenobjekten befragt.
'Unter "'Abfrage definieren" wird nach einer ObjectClass gefiltert
'================
'Option Explicit
Dim objRootDSE, strDNSDomain, adoCommand, adoConnection
Dim strBase, strFilter, strAttributes, strQuery, adoRecordset
@Clijsters
Clijsters / SupplementMail.vba
Created July 14, 2015 09:04
A (little messy) VBA-Script for Outlook to add Username to each Mail in Inbox.
Private WithEvents colItemsPersonal As Outlook.Items
Private WithEvents HotlineItems As Outlook.Items
Dim strUserField As String
Dim strPersonal As String
Dim strShared As String
'''Listen on two Mailboxes and supplement MailItem with senders Alias.
'''It's nice if you are using concern wide IDs (CWIDs) to identify your users.
Private Sub Application_Startup()
@Clijsters
Clijsters / ResolveRecipient.vb
Last active August 29, 2015 14:24
A simple VB solution to search for Users in Exchange via Outlook
Function ResolveRecipient(strSearch As String) As Outlook.Recipient
If String.IsNullOrEmpty(strSearch) Then
Throw New Exception _
("Empty string was given to ResolveRecipient Function.", _
New NullReferenceException("strSearch at ResolveRecipient IsNullOrEmpty"))
End If
Dim App As Outlook.Application = New Outlook.Application
Dim NS As Outlook.NameSpace = App.Session
Dim rec As Outlook.Recipient = NS.CreateRecipient(strSearch)
If rec.Resolve Then