export PS1="\[$(tput setaf 2)\]┌──(\[$(tput setaf 4)\]\u@\h\[$(tput setaf 2)\])-[\[$(tput sgr0)\]\w\[$(tput setaf 2)\]]\n└─\[$(tput setaf 4)\]\\$\[$(tput sgr0)\]\[$(tput sgr0)\] "
This file contains hidden or 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 Get-PageFileInfo | |
{ | |
$compSysResults = Get-CimInstance Win32_ComputerSystem -Namespace 'root\cimv2' | |
$pageFileResults = Get-CimInstance -Class Win32_PageFileUsage -ComputerName $Computer | Select-Object * | |
$pageFiles = $pageFileResults.Description | |
$pageFileCurrentSizes = $([string]$pageFileResults.CurrentUsage).Split(" ") | |
For ($i = 0; $i -lt $pageFileCurrentSizes.length; $i++) | |
{ | |
$pageFileCurrentSizes[$i] = $pageFileCurrentSizes[$i] + "MB" |
This file contains hidden or 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
const skipCache = true | |
/* START OF {DE,EN}CODERS */ | |
async function b64urlDecode(data) { | |
return atob((data + '==='.slice((data.length + 3) % 4)) | |
.replace(/-/g, '+') | |
.replace(/_/g, '/')) | |
} |
This file contains hidden or 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
$invocPath = $(split-path $MyInvocation.MyCommand.Path) | |
ForEach ($i in (Get-ChildItem -Force -Path $invocPath | Where-Object { ($_.Attributes -Match "ReparsePoint") -And ($_.LinkType -Eq "SymbolicLink") -And (-Not $_.PSIsContainer) })) { If ($i.Name -ne "binexport.ps1") { Remove-Item $i.FullName } } | |
ForEach ($i in (Get-ChildItem -Force -Path $invocPath -Recurse -Include "*.bat", "*.dll", "*.exe", "*.ps1" | Where-Object { $_.Attributes -NotMatch "ReparsePoint" })) { If (( -Join ($invocPath, "\", $i.Name)) -Ne $MyInvocation.MyCommand.Path) { New-Item -ItemType SymbolicLink -Path ( -Join ($invocPath, "\", $i.Name)) -Target $i.FullName | Out-Null } } | |
# Exceptions | |
If (Test-Path -Path ( -Join ($invocPath, "\open_a_terminal_here.bat")) -PathType Leaf) { Remove-Item ( -Join ($invocPath, "\open_a_terminal_here.bat")) } | |
ForEach ($i in (Get-ChildItem -Force -Path $invocPath "restic_*_windows_amd64.exe")) { Move-Item $i.FullName ( -Join ($invocPath, "\restic.exe")) } | |
If (Test-Path -Path ( -Join ($invocPath, "\scrcpy-s |
This file contains hidden or 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 cryptoRandom() { | |
const cryptoObj = crypto || window.crypto || window.msCrypto; | |
const genArray = cryptoObj.getRandomValues(new Uint8Array(7)); | |
let tmpArray = []; | |
genArray.forEach(function(ele, index) { | |
tmpArray[index] = ele.toString(); | |
if (ele.toString().length < 3) { | |
if (((index === 0) && (Math.random() < 0.1)) || (Math.random() < 0.5)) { | |
tmpArray[index] = ("0" + ele); |
This file contains hidden or 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
// This snippet was based off https://gist.github.com/dperini/729294 by Diego Perini, | |
// and is licensed under the MIT license. My additions (notably, the IPv6 regex) | |
// preserve the same license with the addition that I, Diab Neiroukh, am included in | |
// the copyright notice. I'd also appreciate it if you could link back to this Gist. | |
// As usual, here's the copyright notice in full: | |
// Copyright (c) 2010-2018 Diego Perini | |
// Copyright (c) 2021 Diab Neiroukh | |
// |
This file contains hidden or 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
[Trigger] | |
Operation = Install | |
Operation = Upgrade | |
Type = Path | |
Target = etc/makepkg.conf | |
Target = usr/share/makepkg/buildenv/lto.sh | |
Target = usr/share/makepkg/executable/strip.sh | |
[Action] | |
Description = Modifying the Makepkg configuration... |
This file contains hidden or 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
for i in $(find . ! -name '*-keyring*' -name '*.gpg'); do echo "gpg --no-default-keyring --keyring ./$(basename $i .gpg)-keyring.gpg --import $(basename $i)"; echo "gpg --no-default-keyring --keyring ./$(basename $i .gpg)-keyring.gpg --export --output $(basename $i .gpg)-archive-keyring.gpg"; done |
This file contains hidden or 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
#! /usr/bin/env bash | |
# This script requires GNU Sed, Curl, Bash >= 4.0, and Unix tr. | |
feedArr=( | |
'dshield-v4.txt' '"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/dshield.netset"' 'DShield' | |
'spamhaus-drop-v4.txt' '"https://www.spamhaus.org/drop/drop.txt"' 'Spamhaus DROP' | |
'spamhaus-edrop-v4.txt' '"https://www.spamhaus.org/drop/edrop.txt"' 'Spamhaus EDROP' | |
'spamhaus-drop-v6.txt' '"https://www.spamhaus.org/drop/dropv6.txt"' 'Spamhaus DROP' | |
'iblocklist-level1-v4.txt' '-L "https://list.iblocklist.com/?list=ydxerpxkpcfqjaybcssw&fileformat=cidr&archiveformat=gz" | gzip -d' 'iBlocklist Level 1' |
This file contains hidden or 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
[Unit] | |
After = etc-ecryptfs.mount | |
Description = Mount eCryptFS Directories | |
[Service] | |
ExecStart = /usr/local/bin/mountecryptfs.sh | |
KeyringMode = shared | |
Type = oneshot | |
User = root |