Get WSL2 IP in Windows:
wsl hostname -i
Get Windows IP in WSL2:
export hostip=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }')
| <div class="fixed inset-0 overflow-auto | |
| bg-yellow-200"> | |
| <div class="w-full h-full min-w-[500px] min-h-[500px] flex | |
| [--pattern-fg:black] bg-[size:50px_50px] bg-[image:repeating-linear-gradient(315deg,_var(--pattern-fg)_0,_var(--pattern-fg)_5px,_transparent_0,_transparent_50%),repeating-linear-gradient(45deg,_var(--pattern-fg)_0,_var(--pattern-fg)_5px,_transparent_0,_transparent_50%),radial-gradient(black,transparent)]"> | |
| <!-- Example content --> | |
| <div class="flex-1 flex bg-red-500 m-5 p-5"> | |
| <div class="flex-1/3 bg-blue-500"></div> | |
| <div class="flex-2/3 bg-blue-100"></div> |
Get WSL2 IP in Windows:
wsl hostname -i
Get Windows IP in WSL2:
export hostip=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }')
| { | |
| "name": "bookism", | |
| "version": "1.0.0", | |
| "main": "index.js", | |
| "license": "MIT", | |
| "scripts": { | |
| "scss": "node-sass --output-style compressed --watch src/scss -o dist/css", | |
| "serve": "browser-sync start --proxy 0.0.0.0:9999 --files 'dist/css/*.css'", | |
| "clean": "rimraf dist/{css/*,js/*}", | |
| "lint": "eslint src/js || true", |
| const queueSize = 10 | |
| const parallelWorkerCount = 3 | |
| const sampleQueue = ','.repeat(queueSize).split(',').map(()=>Math.floor(Math.random()*1000)) | |
| console.log('sampleQueue:', sampleQueue) | |
| const queueGenerator = (function *(){ | |
| for (const item of sampleQueue) yield item; | |
| })() |
| black="\033[0;30m" | |
| blackb="\033[1;30m" | |
| white="\033[0;37m" | |
| whiteb="\033[1;37m" | |
| red="\033[0;31m" | |
| redb="\033[1;31m" | |
| green="\033[0;32m" | |
| greenb="\033[1;32m" | |
| yellow="\033[0;33m" | |
| yellowb="\033[1;33m" |
| dbs=$( | |
| mongo --quiet --eval "db.adminCommand('listDatabases')" | | |
| jq ".databases[].name|select((.!=\"admin\") and (.!=\"config\") and (.!=\"local\"))" | | |
| sed "s/\"//g" | |
| ) | |
| for db in $dbs | |
| do | |
| collections=$( | |
| mongo $db --quiet --eval 'db.getCollectionNames()' | | |
| jq .[] | |
| (function () { | |
| const options = { | |
| text: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&*()_+`-={}|[]\\:";\'<>?,./', | |
| fontSize: 72, | |
| baseFont: 'monospace' | |
| } | |
| this.checkFont = (input) => { | |
| const fonts = (typeof input === 'string') ? input : (getComputedStyle(input).getPropertyValue('font-family') || input.style.fontFamily) | |
| const ctx = document.createElement('canvas').getContext('2d') |
having any kind of command prompt that allows you to run basic linux commands (e.g. CAT) you could do the following:
cat ~/.ssh/id_rsa.pub | ssh user@server "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys"
If you have no id_rsa.pub file you can create one like this:
ssh-keygen -t rsa
| module.exports = (people) => people.reduce((result, person) => { | |
| if (person.age>30 && person.age<40) | |
| result[person.gender].push(person.name) | |
| return result; | |
| }, {"Male": [], "Female": []}); |
| [ | |
| {"command": "insert_snippet", "args": {"contents": "${SELECTION/(?<1>\\x{661})|(?<2>\\x{662})|(?<3>\\x{663})|(?<4>\\x{664})|(?<5>\\x{665})|(?<6>\\x{666})|(?<7>\\x{667})|(?<8>\\x{668})|(?<9>\\x{669})|(?<10>\\x{660})|(?<11>\\x{64A})|(?<12>\\x{643})/(?{1}\\x{6F1}:(?{2}\\x{6F2}:(?{3}\\x{6F3}:(?{4}\\x{6F4}:(?{5}\\x{6F5}:(?{6}\\x{6F6}:(?{7}\\x{6F7}:(?{8}\\x{6F8}:(?{9}\\x{6F9}:(?{10}\\x{6F0}:(?{11}\\x{6CC}:\\x{6A9})))))))))))/gm}"}} | |
| ] |