Skip to content

Instantly share code, notes, and snippets.

@azuravian
azuravian / zip.bat
Created December 10, 2024 04:38
Compress each file in a folder to its own 7z file
@ECHO OFF
FOR %%i IN (*.*) DO (
ECHO "%%i" | FIND /I "zip.bat" 1>NUL) || (
"c:\Program Files\7-Zip\7z.exe" a -t7z "%%~ni.7z" "%%i"
)
)
@azuravian
azuravian / profile-snippet-sshargcomplete.ps1
Created October 1, 2024 14:31 — forked from backerman/profile-snippet-sshargcomplete.ps1
Enable tab completion for ssh hostnames in PowerShell
using namespace System.Management.Automation
Register-ArgumentCompleter -CommandName ssh,scp,sftp -Native -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
$knownHosts = Get-Content ${Env:HOMEPATH}\.ssh\known_hosts `
| ForEach-Object { ([string]$_).Split(' ')[0] } `
| ForEach-Object { $_.Split(',') } `
| Sort-Object -Unique
# For now just assume it's a hostname.
@azuravian
azuravian / .bash_profile
Last active September 22, 2023 05:03 — forked from franz-josef-kaiser/.bash_profile
QNAP Entware opkg command not found
# .bash_profile
# /share/CACHEDEV1_DATA/.qpkg/container-station/bin location of `docker`/ `docker-compose` binaries
# /opt/bin location where `opkg` binary is installed to.
export PATH=\
/bin:\
/sbin:\
/usr/bin:\
/usr/sbin:\
/usr/bin/X11:\
#####################
# PREREQUISITES
#####################
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarSmall
# Console
cinst PowerShell
cinst oh-my-posh
@azuravian
azuravian / shell-setup.ps1
Last active April 24, 2022 20:30 — forked from mikepruett3/shell-setup.ps1
Packages to install via scoop
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018