Skip to content

Instantly share code, notes, and snippets.

@rkitover
rkitover / irc-log.txt
Created September 30, 2022 01:21
docker explanation
07-04 23:51 <Crocodillian> ok, so let me explain a bit
07-04 23:51 <Crocodillian> if you don't mind
07-04 23:51 <blank> Okay.
07-04 23:53 <Crocodillian> sorry had to pee
07-04 23:53 <Crocodillian> have you used chroots for anything before?
07-04 23:53 <Crocodillian> or bsd jails
07-04 23:54 <blank> Nope.
07-04 23:55 <Crocodillian> so a chroot is when you open a shell in a directory that becomes the whole linux system in that shell
07-04 23:55 <blank> Yes, I remember that much.
07-04 23:56 <Crocodillian> it still runs on the same kernel, but it's kind of analagous to a virtual machine
@rkitover
rkitover / msys2_full_upgrade.ps1
Created August 7, 2022 22:01
PowerShell script to do a full MSYS2 upgrade
$erroractionpreference = 'stop'
if (-not (new-object security.principal.windowsprincipal(
[security.principal.windowsidentity]::getcurrent()
)).isinrole([security.principal.windowsbuiltinrole]::administrator)) {
write-error "Must be elevated."
}
$bash = resolve-path /tools/msys64/usr/bin/bash.exe
@rkitover
rkitover / publish.ps1
Last active March 28, 2023 17:27
script to publish ps module
param(
[string]$ApiKey,
[validatescript({
if (-not (test-path -pathtype leaf $_)) {
throw "Certificate file '$_' does not exist."
}
$true
})]
[system.io.fileinfo]$Certificate
)
@nohwnd
nohwnd / Import-Script.psm1
Created February 17, 2019 19:04
Importing self-contained scripts. Demo for PSPowerHour.
function Import-Script {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[String] $Path,
[Hashtable] $Parameters = @{},
[Object[]] $Arguments = @(),
[String] $EntryPoint = 'Main'
)
@u1735067
u1735067 / 1. i2c-rtc.sh
Last active March 11, 2021 15:28
Properly set-up i2c RTC ds1307 on ArchLinux
echo "dtoverlay=i2c-rtc,ds3231" >> /boot/config.txt
cat <<EOF > /etc/udev/rules.d/55-rtc-i2c.rules
#/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc"
#/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
# I2C RTC, when added and not the source of the sys clock (kernel), is used
ACTION=="add", SUBSYSTEMS=="i2c", SUBSYSTEM=="rtc", KERNEL=="rtc0", ATTR{hctosys}=="0", \\
RUN+="/sbin/hwclock '--rtc=\$root/\$name' --hctosys", \\
RUN+="/sbin/logger --tag systemd-udevd 'System clock set from i2c hardware clock \$name (\$attr{name})'"
@spivurno
spivurno / gw-edd-could-not-copy-file-fix-for-windows-servers.php
Created February 2, 2017 16:18
Easy Digital Downloads: "Could not copy file" Fix For Windows Servers
<?php
/**
* Easy Digital Downloads provides packages URLs that look something like this:
*
* http://mysite.com/edd-sl/package_download/MTQ4NjA1NTA0NjphMDA5MTkzZjQ0NGRiNmVmMzczY2JhNTFiZWIxMWZiYzo0NzM3MzphM2Q5ZDA3NDQwMjZjZDFmOWVhYTBiNzBjMjVlZjI0YjpodHRwQC8vbXVzaWNmZXN0aXZhbC5zY2hvb2wubno
*
* This generates a temporary filename for the update process that look something like this:
*
* MTQ4NjA1NTA0NjphMDA5MTkzZjQ0NGRiNmVmMzczY2JhNTFiZWIxMWZiYzo0NzM3MzphM2Q5ZDA3NDQwMjZjZDFmOWVhYTBiNzBjMjVlZjI0YjpodHRwQC8vbXVzaWNmZXN0aXZhbC5zY2hvb2wubno.tmp
*