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
$ProgressPreference='SilentlyContinue' | |
wget https://download.visualstudio.microsoft.com/download/pr/86df96bb-384c-4d7a-82ce-2e4c2c871189/045870c1ab4004219cb312039c5a64d5/dotnet-hosting-2.1.5-win.exe -outfile .\dnc-hosting.exe | |
start-process -wait .\dnc-hosting.exe -args "/install /quiet /norestart" -nonewwindow | |
iisreset |
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
VS -> new solution -> .NET Core 2.1 web app (MVC) | |
untick HTTPS | |
restore packages | |
Run locally | |
Close | |
Right click | |
Publish | |
Choose folder-> publish | |
Publish immediately | |
Open publish folder |
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 "[Unit] | |
Description=My Service Name | |
[Service] | |
WorkingDirectory=$workingdir | |
ExecStart=$workingdir/binary-name | |
Restart=always | |
RestartSec=10 # Restart service after 10 seconds if it crashes | |
SyslogIdentifier=myservicename | |
User=root | |
Environment=\"ASPNETCORE_ENVIRONMENT=Production\" |
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
# set up a swapfile | |
dd if=/dev/zero of=/swap.file bs=1024 count=1048576 | |
mkswap /swap.file | |
chmod 0600 /swap.file | |
swapon /swap.file | |
echo " | |
/swap.file none swap sw 0 0" >> /etc/fstab | |
echo " | |
vm.swappiness=10" >> /etc/sysctl.conf |
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
#!/bin/bash | |
# called by influx-mon.sh which is called by cron every minute | |
curloutput=$(curl -A "influx-mon" -ss -L --connect-timeout 5 -w "\n%{http_code}" $1) | |
exitcode=$? | |
body=$(echo "$curloutput" | head -n -1) | |
httpcode=$(echo "$curloutput" | tail -n 1) | |
if [ $exitcode -ne 0 ]; then |
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
#!/bin/bash -e | |
# called by cron every minute | |
function postToInflux(){ | |
curl -ss -o /dev/null --connect-timeout 5 -X POST 'https://influxdb.trlsoftware.com/write?db=database&u=user&p=pass' --data-binary "web_up,site=$1 value=$2 $(date +%s%N)" | |
} | |
declare -A sites | |
declare -A check |
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
<powershell> | |
$windows_admin_password="mypassword" | |
function log { | |
echo $args[0] | out-file -append c:\bootstrap-status.log | |
} | |
log "Setting Windows password" | |
$admin = [adsi]("WinNT://./administrator, user") |
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
$vmname="server2016eval"; $snapname='server2016eval - (02/02/2018 - 15:12:33)'; stop-vm $vmname; if ((get-vm $vmname).State -eq 'Running') {stop-vm -turnoff $vmname}; restore-vmsnapshot -name $snapname -confirm:$false -vmname $vmname; start-vm $vmname |
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 off | |
rem A vs2017 folder must exist within this UNC | |
pushd %targetunc% | |
md %UserProfile%\Desktop\vs2017 | |
copy vs2017\vs_professional.exe %UserProfile%\Desktop\vs2017 | |
start /wait %UserProfile%\Desktop\vs2017\vs_professional.exe --layout %UserProfile%\Desktop\vs2017 --quiet | |
del /q /s vs2017 | |
rd /q /s vs2017 | |
robocopy /move /e %UserProfile%\Desktop\vs2017 vs2017 * | |
popd |
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
Status page | |
curl 'http://192.168.100.1/snmpGet?oids=1.3.6.1.4.1.4115.1.3.4.1.5.9.0;1.3.6.1.4.1.4115.1.3.3.1.1.1.3.1.0;1.3.6.1.4.1.4491.2.1.14.1.5.4.0;1.3.6.1.4.1.4115.1.20.1.1.1.7.1.3.1;1.3.6.1.2.1.10.127.1.1.5.0;1.3.6.1.2.1.126.1.1.1.1.1.2;1.3.6.1.2.1.69.1.4.5.0;&_n=21943&_=1515184469506' | |
Item Status Comments | |
Acquired Downstream Channel(Hz) 547000000 Locked | |
Ranged Upstream Channel(Hz) 39400000 Locked | |
Provisioning State Online | |
NewerOlder