Skip to content

Instantly share code, notes, and snippets.

View mw866's full-sized avatar

Chris Wang mw866

View GitHub Profile
@mw866
mw866 / mongo
Last active July 1, 2024 01:25
#mongoDB
show dbs
use testdb
db.dropDatabase()
db.test.find( {} )
db.test.remove({ "_id" : ObjectId("622fe6b767d3cd1a9e5d5eec") })
@mw866
mw866 / client.js
Created February 9, 2022 07:27
#javascript #js
window.location.href = 'https://www.example.com';
location.href;
document.body.innerHTML;
@mw866
mw866 / headless_chrome.sh
Created January 24, 2022 01:15
#chrome
#!/bin/zsh
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --disable-gpu --remote-debugging-port=9222 https://www.example.com
echo "Connec to the remote target at chrome://inspect/#devices`
read -p "Press Return to Close..."
@mw866
mw866 / xargs.sh
Created January 11, 2022 07:40
#xarg #linux
# https://flaviocopes.com/linux-command-xargs/
cat ~/ips.txt | xargs -n1 whois -h whois.cymru.com
@mw866
mw866 / vagrant.sh
Last active January 13, 2022 06:40
#vagrant
# https://www.vagrantup.com/docs/cli
vagrant validate
vagrant provision
# find the SSH config for ~/.ssh/config
vagrant ssh-config
@mw866
mw866 / grep.sh
Created January 10, 2022 07:52
#grep
# Search lines
grep -nr 'yourString*' .
@mw866
mw866 / package-management.sh
Last active January 10, 2022 08:55
#linux #debian #ubuntu
# https://www.debian.org/doc/manuals/debian-faq/pkgtools.en.html#whatpackages
#install .deb
sudo dpkg -i file.deb
sudo apt-get install file.deb
#view content of a package
dpkg -c file.deb
# extract pacakge
dpkg -x somefile.deb somefolder
@mw866
mw866 / lua.sh
Last active December 30, 2021 13:44
#lua
#https://github.com/luarocks/luarocks/wiki/Using-LuaRocks
luarocks show lyaml # find rocks
luarocks which yaml # find files
@mw866
mw866 / make.sh
Last active December 30, 2021 06:50
#make
make -n # or --just-print
make --debug
make SHELL="sh -x"
@mw866
mw866 / aws-sso.sh
Last active March 2, 2025 13:19
#aws
aws sso login
aws configure list-profiles
set AWS_DEFAULT_PROFILE=management