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 | |
lin_ip4=$(ip -4 address show label eth0 | grep inet | sed 's/^.*inet //' | sed 's/\/.*$//') | |
touch /tmp/foo | |
f=/tmp/foo | |
/mnt/c/Windows/System32/ipconfig.exe | sed 's/.$//' > $f | |
a=$(cat $f | grep -n WSL | sed 's/:.*$//') | |
b=$(cat $f | wc -l) | |
c=$(( $b - $a )) | |
win_ip4=$(cat $f | tail -n $c | grep IPv4 | head -n 1 | sed 's/^.* : //') | |
echo $win_ip4 #above code is from here: https://www.reddit.com/r/bashonubuntuonwindows/comments/i4m90o/how_to_know_ip_address_of_windows_within_ubuntu/ |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Listen for Xdebug", | |
"type": "php", | |
"request": "launch", | |
"port": 9000, | |
"ignore": [ | |
"**/vendor/**/*.php" |
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
axios.get('http://httpbin.org/status/400') | |
.then(function (success) { | |
// response code is 2xx | |
console.log('success:', success.data); | |
console.log('success:', success.status); | |
console.log('success:', success.headers); | |
}) | |
.catch(function (error) { | |
//render the error for better UX | |
if (error.response) { |