Skip to content

Instantly share code, notes, and snippets.

@wlib
wlib / LICENSE
Last active April 30, 2024 17:07
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
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:
@jborean93
jborean93 / Get-SmbShareInfo.ps1
Created May 6, 2020 19:55
Enumerates shares on a remote host
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
Function Get-SmbShareInfo {
<#
.SYNOPSIS
Enumerate shares on a remote host.
.DESCRIPTION
Enumerate shares on a remote host and returns the name, type, and special remark for those shares.
@jdhitsolutions
jdhitsolutions / MemUsagePrompt.ps1
Created December 13, 2018 15:37
A PowerShell Prompt function to display free memory percentage from a list of remote servers.
function prompt {
Try {
Get-Variable -Name rsHash -Scope global -ErrorAction Stop | Out-Null
}
Catch {
#create the runspace and synchronized hashtable
$global:rsHash = [hashtable]::Synchronized(@{Computername = $env:computername; results = ""; date = (Get-Date)})
$newRunspace = [runspacefactory]::CreateRunspace()
#set apartment state if available
@lemajes
lemajes / template.service
Created April 20, 2018 03:46
[Systemd Service Template] Skeleton for a new Systemd service #linux #systemd # service
#Put me in /lib/systemd/system/
[Unit]
Description=My Miscellaneous Service
After=network.target
[Service]
Type=simple
User=nanodano
WorkingDirectory=/home/nanodano
ExecStart=/home/nanodano/my_daemon --option=123
function ConvertTo-ChocoPackage {
<#
.SYNOPSIS
Convert a PowerShell module into a chocolatey package.
.DESCRIPTION
Convert a PowerShell module into a chocolatey package.
.EXAMPLE
Find-Module pester | ConvertTo-ChocoPackage
Find the module pester on a PS repository and convert the module to a chocolatey package.
@mricon
mricon / ff
Last active September 25, 2019 07:15
Convenient wrapper for firejail and firefox
#!/bin/bash
# ff: convenient wrapper for firejail and firefox
#
# You can mix and match most keywords. Anything that's not a keyword
# will become the name of the private profile.
#
# Examples:
# ff
# - use basic defaults (no private directory, system resolver)
# ff 1dns personal
@unixweb
unixweb / main.py
Last active January 15, 2018 20:21
main.py for Google-Assistant AIY Project
#!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@halkyon
halkyon / cleanup-win10.ps1
Last active September 28, 2025 18:46
Cleanup Windows 10 Powershell script
##
## Windows 10 cleanup script.
## Remove dodgy tracking settings, unneeded services, all apps, and optional features that come with Windows 10. Make it more like Windows 7.
## NOTE: this was tested on Creators Update (1703) and Fall Creators Update (1709). Some of this may not work as expected on newer versions.
##
## Instructions
## 1. Run this script (under Powershell as Administrator):
## powershell -ExectionPolicy Bypass .\cleanup-win10.ps1
## 2. Let it run through, you may see a few errors, this is normal
## 3. Reboot
@Stephanevg
Stephanevg / PsModulePathVariableManagement.ps1
Last active October 5, 2022 13:09
functions to add / remove paths to the $psmodulePath environment variable.
function Remove-FromPSModulePath{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)][String]$Path="C:\admin\modules"
)
if ($env:PSModulePath.split(";") -contains $Path){
$NewValue = (($env:PSModulePath).Split(";") | ? { $_ -ne $Path }) -join ";"
[Environment]::SetEnvironmentVariable("PSModulePath", $NewValue, "Machine")
$env:PSModulePath = [System.Environment]::GetEnvironmentVariable("PSModulePath","Machine")
write-verbose "$Path removed. Restart the prompt for the changes to take effect."
@ruario
ruario / appimage-vivaldi.sh
Last active September 30, 2024 18:44
A script to convert a Vivaldi rpm or deb into Appimage format.
#!/bin/sh
#
# appimage-vivaldi.sh (version 0.9)
#
# A script to convert a Vivaldi rpm or deb into AppImage format.
# Before you use this script, you may need to adjust the following
# variable, based on the name and location of AppImageTool on your
# system.
#