Skip to content

Instantly share code, notes, and snippets.

@aimtiaz11
aimtiaz11 / readme.md
Last active March 7, 2024 04:58 — forked from thomasdarimont/readme.md
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Decoding a JWT Payload with your Shell (bash, zsh...)

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
 fi
@aimtiaz11
aimtiaz11 / compare-list.groovy
Last active September 13, 2023 14:47
Helpful Groovy Scripts
/**
* Usage: groovy compare-list.groovy first.txt second.txt
**/
def sourceList = []
new File( args[0] ).eachLine { line ->
sourceList << line.trim()
}
@aimtiaz11
aimtiaz11 / curl.sh
Last active February 26, 2025 08:12
Curl - Echo only HTTP status
curl -Iso /dev/null -w "%{http_code}\n" -k https://www.google.com.au
@aimtiaz11
aimtiaz11 / timer-vars.md
Last active August 2, 2024 01:13
Adding Timer Variables in Mule Flows

Adding Timer Variables in Mule Flows

Adding timer variables in Mule flows to check for performance bottlenecks.

Setting Timer Variable set-variable

<set-variable value="#[%dw 2.0 import currentMilliseconds from dw::util::Timer --- currentMilliseconds()]" 
              variableName="http_before" doc:name="http_before" mimeType="application/java"/>
@ArisAgnew
ArisAgnew / Big_O_Performance.md
Last active April 16, 2021 09:40
Big O performance

Big O performance of common functions of different Java Collections.

List Add Remove Get/Read Contains Next Data Structure
[] O(n) O(n) O(1) O(n) O(1) Array
List O(1)* O(n) O(n) O(n) O(1) Array
ArrayList O(1) O(n) O(1) O(n) O(1) Array
LinkedList O(1) O(1) O(n) O(n) O(1) Linked List
CopyOnWriteArrayList O(n) O(n) O(1) O(n) O(1) Array
@aimtiaz11
aimtiaz11 / readme.md
Last active December 12, 2018 12:33
Jasypt Encryption & Decryption

Jayspt Encryption & Decryption

Add the following functions to your ~/.bash_profile:

Encrypt

encrypt(){
    /Users/ai/jasypt-1.9.2/bin/encrypt.sh \
    input="$1" \
    password="somesupersecretpassword" \
 stringOutputType="hex"
@aimtiaz11
aimtiaz11 / delete-jobs.py
Last active October 1, 2019 18:01
Python script to delete jobs & nested views in Jenkins-CI
'''
Script to delete jobs and nested views in Jenkins CI including the parent view.
This currently works when you have two-level nested views with jobs under the child view.
Parent view
- Child view 1
- Job 1
- Job 2
- Child view 2
- Job 3
@aimtiaz11
aimtiaz11 / readme.md
Last active December 11, 2017 18:18
Spring Data and Kendo Grid Datasource Pagination

Spring Data and Kendo Grid Datasource Pagination

How to implement Kendo Grid pagination and sorting with Spring Data.

Angular

Setup Kendo grid options as below in controller or directive

$scope.publishHistoryGridOptions = {
@guycalledseven
guycalledseven / manual-uninstall-paragon-ntfs.sh
Last active February 7, 2025 03:30
Manually remove Paragon NTFS v15 leftovers MacOS
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
@JohnRoos
JohnRoos / Invoke-RestMethod with cookie and header.ps1
Last active June 19, 2024 18:30
Invoke-RestMethod with cookies and headers