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
| $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 |
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/mime.types | |
| Target = usr/share/webapps/nextcloud/resources/config/mimetypemapping.dist.json | |
| [Action] | |
| Description = Updating Nextcloud's mime type mapping... | |
| When = PostTransaction |
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
| ACTION=="add|change", KERNEL=="sd[a-z]", RUN+="/usr/bin/hdparm -q -A 1 /dev/%k" | |
| # A value of 127 should be used, except for servers where 254 should be used instead. | |
| ACTION=="add|change", KERNEL=="sd[a-z]", ATTRS{queue/rotational}=="1", RUN+="/usr/bin/hdparm -q -B 127 /dev/%k" | |
| ACTION=="add|change", KERNEL=="sd[a-z]", RUN+="/usr/bin/hdparm -q -c 3 /dev/%k" | |
| ACTION=="add|change", KERNEL=="sd[a-z]", RUN+="/usr/bin/hdparm -q -d 1 /dev/%k" | |
| ACTION=="add|change", KERNEL=="sd[a-z]", RUN+="/usr/bin/hdparm -q -D 1 /dev/%k" | |
| ACTION=="add|change", KERNEL=="sd[a-z]", RUN+="/usr/bin/hdparm -q -m 16 /dev/%k" | |
| ACTION=="add|change", KERNEL=="sd[a-z]", RUN+="/usr/bin/hdparm -q -M 254 /dev/%k" | |
| ACTION=="add|change", KERNEL=="sd[a-z]", RUN+="/usr/bin/hdparm -q -R 0 /dev/%k" | |
| # This should only be set for servers. |