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 | |
# NAS IP: 192.168.1.10 in this example | |
# DHCP scope reservation for macvlan: 192.168.1.208/28 (Details below) | |
## Network: 192.168.1.208/28 11000000.10101000.00000001.1101 0000 (Class C) | |
## HostMin: 192.168.1.209 11000000.10101000.00000001.1101 0001 | |
## HostMax: 192.168.1.222 11000000.10101000.00000001.1101 1110 | |
## Hosts/Net: 14 (Private Internet) | |
# Create a macvlan Docker network using eth0 |
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
# Did you forget to use "sudo" with a command? Use this alias to auto add sudo and re-run it. | |
# usage example: | |
# > apt update | |
# Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) | |
# > oops | |
# (now your previous command runs with sudo) | |
alias oops='sudo $(fc -ln -1)' |
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
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module |
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
let fnGetFileNameFromContentDispostionHeader = function (header) { | |
let contentDispostion = header.split(';'); | |
const fileNameToken = `filename*=UTF-8''`; | |
let fileName = 'downloaded.pdf'; | |
for (let thisValue of contentDispostion) { | |
if (thisValue.trim().indexOf(fileNameToken) === 0) { | |
fileName = decodeURIComponent(thisValue.trim().replace(fileNameToken, '')); | |
break; | |
} |