This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| from argparse import ArgumentParser | |
| from pathlib import Path | |
| import re | |
| def nameFixUp(name: str) -> str: | |
| """Fix up a name by replacing non-alphanumeric characters with _ and collapsing multiple _ to single _.""" | |
| if name == name.upper() or name == name.lower(): | |
| sep = '_' | |
| else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| from argparse import ArgumentParser, Namespace | |
| from typing import Any | |
| from pathlib import Path | |
| import json | |
| import re | |
| from collections import Counter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # | |
| """ | |
| requirements.txt : | |
| requests | |
| pydantic_settings | |
| glom | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| shopt -s nullglob | |
| lastgroup="" | |
| for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do | |
| for d in $g/devices/*; do | |
| if [ "${g##*/}" != "$lastgroup" ]; then | |
| echo -en "Group ${g##*/}:\t" | |
| else | |
| echo -en "\t\t" | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
| # | |
| git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
| git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
| if [ "${AZURE_CLI}" == "0" ]; then | |
| # Remove Azure CLI plugin | |
| set -i 's/ azure / /g' ~/.zshrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
| # Initialization code that may require console input (password prompts, [y/n] | |
| # confirmations, etc.) must go above this block; everything else may go below. | |
| if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
| source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
| fi | |
| # If you come from bash you might have to change your $PATH. | |
| # export PATH=$HOME/bin:/usr/local/bin:$PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generated by Powerlevel10k configuration wizard on 2024-04-11 at 12:05 AWST. | |
| # Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 49778. | |
| # Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode, | |
| # round separators, round heads, flat tails, 1 line, compact, many icons, concise, | |
| # transient_prompt, instant_prompt=verbose. | |
| # Type `p10k configure` to generate another config. | |
| # | |
| # Config for Powerlevel10k with powerline prompt style with colorful background. | |
| # Type `p10k configure` to generate your own config based on it. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for i in $(seq 1 5); do | |
| disk="md${i}p1" | |
| log="${0}.${disk}.txt" | |
| echo "${i}. ${disk} : ${log}" | |
| xfs_repair /dev/mapper/${disk} > ${log} 2>&1 | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def getRoman(theInteger : int, lcase : bool = False): | |
| mappy = [[1,"I"] | |
| ,[4,"IV"],[5,"V"] | |
| ,[9,"IX"],[10,"X"] | |
| ,[40,"XL"],[50,"L"] | |
| ,[90,"XC"],[100,"C"] | |
| ,[400,"CD"],[500,"D"] | |
| ,[900,"CM"],[1000,"M"] | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' | |
| ,'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner' AS ReportDefinition | |
| ) | |
| SELECT CATDATA.Name AS ReportName | |
| ,CATDATA.Path AS ReportPathLocation | |
| ,xmlcolumn.value('(@Name)[1]', 'VARCHAR(250)') AS DataSetName | |
| ,xmlcolumn.value('(Query/DataSourceName)[1]', 'VARCHAR(250)') AS DataSoureName | |
| ,xmlcolumn.value('(Query/CommandText)[1]', 'VARCHAR(2500)') AS CommandText | |
| FROM (SELECT ItemID -- Unique Identifier | |
| ,[Path] --Path including object name |
NewerOlder