This file contains 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
import logging | |
from datetime import datetime | |
import functools | |
# Setting up logging | |
logging.basicConfig(level=logging.INFO) | |
logger = logging.getLogger(__name__) | |
def measure_time(func): | |
@functools.wraps(func) |
This file contains 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
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 |
This file contains 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
$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 |
This file contains 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
param( | |
[string]$ApiKey, | |
[validatescript({ | |
if (-not (test-path -pathtype leaf $_)) { | |
throw "Certificate file '$_' does not exist." | |
} | |
$true | |
})] | |
[system.io.fileinfo]$Certificate | |
) |
This file contains 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
function Import-Script { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] | |
[String] $Path, | |
[Hashtable] $Parameters = @{}, | |
[Object[]] $Arguments = @(), | |
[String] $EntryPoint = 'Main' | |
) |
This file contains 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
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})'" |
This file contains 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
<?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 | |
* |