refs.
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
# define function | |
function Get-NetworkAddress { | |
param([Parameter(Mandatory, ValueFromPipelineByPropertyName)][string]$IPAddress, [Parameter(Mandatory, ValueFromPipelineByPropertyName)][int]$PrefixLength); | |
process { | |
$bitNwAddr = [ipaddress]::Parse($IPAddress).Address -band [uint64][BitConverter]::ToUInt32([System.Linq.Enumerable]::Reverse([BitConverter]::GetBytes([uint32](0xFFFFFFFFL -shl (32 - $PrefixLength) -band 0xFFFFFFFFL))), 0); | |
[pscustomobject]@{ | |
Addr = $IPAddress; | |
Prfx = $PrefixLength; | |
NwAddr = [ipaddress]::new($bitNwAddr).IPAddressToString + '/' + $PrefixLength; | |
}; |
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 extractsrcrpm() { | |
rpm -ivh ${1} | |
rpmbuild -bp --nodeps ~/rpmbuild/SPECS/*.spec | |
mv ~/rpmbuild ${1}build | |
} | |
function extractbinrpm() { | |
mkdir -p ${1%.*} | |
pushd ${1%.*} | |
rpm2cpio ${1} | cpio -idmv |
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 unpin_taskbar([string]$appname) { | |
((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | Where-Object {$_.Name -eq $appname}).Verbs() | Where-Object {$_.Name.replace('&','') -match 'タスク バーからピン留めを外す'} | ForEach-Object {$_.DoIt()} | |
} | |
foreach ($taskbarapp in ("PowerPoint", "Excel")) { | |
Write-Host "Unpinning $taskbarapp" | |
unpin_taskbar("$taskbarapp") | |
} |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Virtual Channels\Seamless Windows] | |
"TopMostonFullScreen"=True | |
"TWIMode"=False | |
[HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Virtual Channels\Thinwire Graphics] | |
"TWIFullScreenMode"=True | |
"UseFullScreen"=True |
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
wsl.exe --distribution Ubuntu --user root --cd ~ -- /bin/zsh -c "sudo apt update; sudo apt upgrade -y; sudo apt autoremove -y; sudo apt autoclean" |
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
wsl --distribution Ubuntu --user root --cd ~ -- true | |
Get-NetIPInterface | | |
where {$_.InterfaceAlias -eq 'vEthernet (WSL)' -or $_.InterfaceAlias -eq 'vEthernet (Default Switch)'} | | |
Set-NetIPInterface -Forwarding Enabled |
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
<?xml version="1.0" standalone='no'?><!--*-nxml-*--> | |
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"> | |
<service-group> | |
<name replace-wildcards="yes">%h</name> | |
<service> | |
<type>_device-info._tcp</type> | |
<port>0</port> | |
<txt-record>model=Xserve</txt-record> | |
</service> | |
</service-group> |
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
#!/bin/zsh | |
USERNAME="" | |
PASSWORD="" | |
HOSTNAME="" | |
curl "https://$USERNAME:[email protected]/nic/update?hostname=$HOSTNAME&myip=$(curl https://ifconfig.me 2> /dev/null),$(curl https://ifconfig.co 2> /dev/null)" |
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
import os | |
basedir = os.path.abspath(os.path.dirname(__file__)) | |
# BASIC APP CONFIG | |
WTF_CSRF_ENABLED = True | |
SECRET_KEY = 'We are the world' | |
BIND_ADDRESS = '0.0.0.0' | |
PORT = 9393 | |
LOGIN_TITLE = "PDNS" |
NewerOlder