Get WSL2 IP in Windows:
wsl hostname -i
Get Windows IP in WSL2:
export hostip=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }')
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}"}} | |
] |
// ==UserScript== | |
// @name Coda Persian Fixes | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://coda.io/* | |
// @grant GM_addStyle | |
// ==/UserScript== |