Skip to content

Instantly share code, notes, and snippets.

View bjarkirafn's full-sized avatar

Bjarki Rafn Gudmundsson bjarkirafn

View GitHub Profile
@bjarkirafn
bjarkirafn / Convert-AsciiToBinary.ps1
Last active November 12, 2020 18:52
posh:snippets
function Convert-AsciiToBinary {
[CmdletBinding()]
[Alias('ascii2bin')]
param ([Parameter(Mandatory)][string]$String)
return [byte[]][char[]]$String |
ForEach-Object { [convert]::ToString($_, 2).PadLeft(8, '0')
}
}
@bjarkirafn
bjarkirafn / ImageBase64.ps1
Last active September 29, 2020 16:12
ImageBase64
$base64 = [convert]::ToBase64String((Get-Content D:\Images\image1.jpg -Encoding byte))
@jhoneill
jhoneill / Profile-cd.ps1
Last active October 6, 2023 20:05
PowerShell to make a nicer CD.. Just add to profile.
#Profile addition to redefine cd as a proxy for push location (and cd- for Pop).
# cd ... is transformed into into cd ..\.. (extra dot is an extra level),
# cd ^ is transformed into cd <<script i.e. profile>> directory
# cd \*doc is transformed into cd \*\Doc*\
# cd = is transformed into an item from the stack. = is the first each extra = goes one deeper in the stack
# cd - will not tab expand but will pop an item from the location stack. 3 or more - will do an extra pop.
# -- means "all the rest are a strings", so two levels needs -- --
# cd ~ Now supports tab expansion
# cd ~~ Tab completes "Special" folders (e.g. MyDocuments, Desktop, ProgramFiles)
# cd ~~Name\ Transorms to or tab completes the special folder
@bjarkirafn
bjarkirafn / my-gitgist.json
Last active May 22, 2019 20:05
misc info
{
"first-entry": {"info": "something"}
}
@thomasnorris
thomasnorris / Raspberry Pi Kiosk Setup.md
Last active October 22, 2023 03:36
Instructions for installing a fresh image of Raspbian and turning the Pi into a kiosk (for google slides, google photos, etc)

Raspberry Pi Kiosk Setup

  • Install a fresh image of Raspbian and boot the Pi
  • Go through the prompts to finish initial setup
  • Open a Termial window
    • Type sudo apt-get install unclutter
    • Type sudo raspi-config
      • Select Boot Options with Enter
        • Select Wait for Network at Boot with Enter
        • Select Yes with Enter
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active June 17, 2024 04:00 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@Jaykul
Jaykul / HuddledTricks.psm1
Last active July 17, 2023 20:02
Stupid PowerShell Tricks
#Requires -version 2.0
## Stupid PowerShell Tricks
###################################################################################################
add-type @"
using System;
using System.Runtime.InteropServices;
public class Tricks {
[DllImport("user32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);