From 3a795699d982a20c569160a12e843104905efabd Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Wed, 31 Jan 2024 15:09:52 -0800 Subject: [PATCH] initial commit --- autoconfig.yml | 36 ++++ bookmarks/urls | 5 + config.py | 87 ++++++++++ dracula | 1 + greasemonkey/whitelist.user.js | 7 + qsettings/QtProject.conf | 5 + quickmarks | 284 ++++++++++++++++++++++++++++++++ userscripts/qute-bitwarden.py | 291 +++++++++++++++++++++++++++++++++ 8 files changed, 716 insertions(+) create mode 100644 autoconfig.yml create mode 100644 bookmarks/urls create mode 100644 config.py create mode 160000 dracula create mode 100644 greasemonkey/whitelist.user.js create mode 100644 qsettings/QtProject.conf create mode 100644 quickmarks create mode 100755 userscripts/qute-bitwarden.py diff --git a/autoconfig.yml b/autoconfig.yml new file mode 100644 index 0000000..c4b946f --- /dev/null +++ b/autoconfig.yml @@ -0,0 +1,36 @@ +# If a config.py file exists, this file is ignored unless it's explicitly loaded +# via config.load_autoconfig(). For more information, see: +# https://github.com/qutebrowser/qutebrowser/blob/master/doc/help/configuring.asciidoc#loading-autoconfigyml +# DO NOT edit this file by hand, qutebrowser will overwrite it. +# Instead, create a config.py - see :help for details. + +config_version: 2 +settings: + colors.webpage.darkmode.algorithm: + global: lightness-cielab + colors.webpage.darkmode.contrast: + global: 0.2 + content.geolocation: + https://tv.youtube.com: true + content.notifications.enabled: + http://192.168.4.77:3353: true + https://coinmarketcap.com: true + https://element.suda.codes: true + https://mail.google.com: true + https://mastodon.sudacode.com: true + https://medusa.suda.codes: true + https://navidrome.suda.codes: true + https://netdata.suda.codes: true + https://www.deezer.com: true + https://www.reddit.com: true + content.register_protocol_handler: + https://outlook.office.com?mailtouri=%25s: false + qt.highdpi: + global: true + spellcheck.languages: + global: + - en-US + statusbar.show: + global: always + tabs.show: + global: always diff --git a/bookmarks/urls b/bookmarks/urls new file mode 100644 index 0000000..4d4e1d1 --- /dev/null +++ b/bookmarks/urls @@ -0,0 +1,5 @@ +https://www.youtube.com/ YouTube +qute://help/img/cheatsheet-big.png cheatsheet-big.png (3342×2060) +http://theboxhole/admin/ Pi-hole - pihole +https://thebox.sudacode.com/gitea/ Kyle Yasuda - Dashboard - The Box Gitea: Just hit a lick with the box +http://metatube.sudacode.com/ MetaTube diff --git a/config.py b/config.py new file mode 100644 index 0000000..be8cd43 --- /dev/null +++ b/config.py @@ -0,0 +1,87 @@ +from os import getenv + +import dracula.draw + +HOME = getenv("HOME") + +# Load existing settings made via :set +config.load_autoconfig(True) + +c.zoom.default = "125%" +c.qt.highdpi = True +c.fonts.default_family = [ + "JetBrainsMono Nerd Font", + "NotoSansSymbols", + "PowerlineSymbols", + "DejaVu Sans Mono", + "Monospace", +] +# config.set("colors.webpage.darkmode.enabled", True) +# config.set("colors.webpage.darkmode.contrast", 0.45) + +c.content.blocking.method = "both" +c.content.default_encoding = "utf-8" +c.content.pdfjs = True # display pdfs +c.content.headers.do_not_track = True +c.content.headers.user_agent = ( + "Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0" +) +c.content.blocking.whitelist = ["suda.codes", "sudacode.com"] + + +# c.url.default_page = "https://dash.suda.codes" +c.url.start_pages = ["http://thebox:4000", "http://thebox:3341"] +c.editor.command = ["kitty", "-e", "nvim", "{}"] +# c.url.searchengines["DEFAULT"] = "https://duckduckgo.com/?q={}" +c.url.searchengines["DEFAULT"] = "https://google.com/search?q={}" +c.url.searchengines["a"] = "https://wiki.archlinux.org/?search={}" +c.url.searchengines["ap"] = "https://www.archlinux.org/packages/?sort=&q={}" +c.url.searchengines["aur"] = "https://aur.archlinux.org/packages/?K={}" +c.url.searchengines["r"] = "https://www.reddit.com/r/{}" +c.url.searchengines["py"] = "https://docs.python.org/3/library/{}" +c.url.searchengines["pi"] = "https://pypi.org/project/{}" +c.url.searchengines["yt"] = "https://www.youtube.com/results?search_query={}" +c.url.searchengines["ytc"] = "https://www.youtube.com/c/{}" + +c.aliases["gd"] = "open -t http://192.168.4.77:4000" + +c.spellcheck.languages = ["en-US"] + + +config.bind( + "", + "hint links spawn --detach kitty -e yt-dlp {hint-url}", +) +config.bind( + "", + "hint links spawn ~/.bin/metube '{hint-url}'", +) +config.bind( + "M", + "hint links spawn --detach mpv {hint-url}", +) +config.bind( + "", + "hint links spawn ~/.bin/metube '{hint-url}'", +) +config.bind( + "W", + "hint links spawn ~/.bin/wallabag-add.py '{hint-url}'", +) + +config.bind("Y", "hint links spawn kitty -e youtube-dlp {hint-url}") + +config.bind("'", "zoom-in") +config.bind("'", "zoom-out") + +config.bind("", "scroll-px 0 150") + +config.bind("", "scroll-px 0 -150") + +config.bind("ts", "config-cycle statusbar.show always never") +config.bind("tt", "config-cycle tabs.show always never") + +config.bind("", "spawn --userscript qute-bitwarden") + + +dracula.draw.blood(c, {"spacing": {"vertical": 6, "horizontal": 8}}) diff --git a/dracula b/dracula new file mode 160000 index 0000000..ba5bd65 --- /dev/null +++ b/dracula @@ -0,0 +1 @@ +Subproject commit ba5bd6589c4bb8ab35aaaaf7111906732f9764ef diff --git a/greasemonkey/whitelist.user.js b/greasemonkey/whitelist.user.js new file mode 100644 index 0000000..866c178 --- /dev/null +++ b/greasemonkey/whitelist.user.js @@ -0,0 +1,7 @@ +// ==UserScript== +// @match https://search.google.com/* +// ==/UserScript== +const meta = document.createElement("meta"); +meta.name = "color-scheme"; +meta.content = "dark light"; +document.head.appendChild(meta); diff --git a/qsettings/QtProject.conf b/qsettings/QtProject.conf new file mode 100644 index 0000000..911c25e --- /dev/null +++ b/qsettings/QtProject.conf @@ -0,0 +1,5 @@ +[FileDialog] +history=@Invalid() +lastVisited=file:///home/sudacode/Desktop/exodus-exports +qtVersion=5.15.8 +viewMode=Detail diff --git a/quickmarks b/quickmarks new file mode 100644 index 0000000..9c49d7a --- /dev/null +++ b/quickmarks @@ -0,0 +1,284 @@ +Get Help https://support.mozilla.org/en-US/products/firefox +Customize Firefox https://support.mozilla.org/en-US/kb/customize-firefox-controls-buttons-and-toolbars?utm_source=firefox-browser&utm_medium=default-bookmarks&utm_campaign=customize +Get Involved https://www.mozilla.org/en-US/contribute/ +About Us https://www.mozilla.org/en-US/about/ +Help and Tutorials https://support.mozilla.org/en-US/products/firefox +Ubuntu http://www.ubuntu.com/ +Ubuntu Wiki (community-edited website) http://wiki.ubuntu.com/ +Make a Support Request to the Ubuntu Community https://answers.launchpad.net/ubuntu/+addquestion +Debian (Ubuntu is based on Debian) http://www.debian.org/ +Getting Started https://www.mozilla.org/en-US/firefox/central/ +Naruto Shippuden Filler List | The Ultimate Anime Filler Guide https://www.animefillerlist.com/shows/naruto-shippuden +Data Team Wiki https://nowcomcorporation.sharepoint.com/sites/DataTeam +Is anyone using Arch on a server at home : archlinux https://www.reddit.com/r/archlinux/comments/945k9w/is_anyone_using_arch_on_a_server_at_home/e3itzu6/ +AniList https://anilist.co/home +StackEdit https://stackedit.io/app# +canvas https://umich.instructure.com/?login_success=1 +LinkedIn https://www.linkedin.com/feed/?trk=guest_homepage-basic_nav-header-signin +Arch Linux https://www.archlinux.org/ +1. What We're Building https://www.solidsail.com/courses/product-hunt/251688-welcome/1284741-1-what-we-re-building +Master React by Building a Product Hunt Clone https://www.solidsail.com/courses/product-hunt +curl POST examples https://gist.github.com/subfuzion/08c5d85437d5d4f00e58 +Emacs Doom for Newbies. One of the highest learning curves I… | by Justin DeMaris | Urbint | Medium https://medium.com/urbint-engineering/emacs-doom-for-newbies-1f8038604e3b +Material-UI: A popular React UI framework https://material-ui.com/ +HTML Unicode UTF-8 https://www.w3schools.com/charsets/ref_utf_letterlike.asp +Sites | Kyle Yasuda's team https://app.netlify.com/teams/ksyasuda/sites +Discord+ https://plusinsta.github.io/discord-plus/ +ESPN hidden API Docs https://gist.github.com/akeaswaran/b48b02f1c94f873c6655e7129910fc3b +reddit: the front page of the internet https://www.reddit.com/ +Core Components and APIs · React Native https://reactnative.dev/docs/components-and-apis +React Native Docs https://reactnative.dev/docs/getting-started +Enrollment Policy | Computer Science and Engineering at Michigan https://cse.engin.umich.edu/academics/for-current-students/advising/enrollment/ +Gogoanime - Watch Anime Online, Watch English Anime Online Subbed, Dubbed https://www4.gogoanime.pro/ +Imgur: The magic of the Internet https://imgur.com/ +Develop. Preview. Ship. For the best frontend teams – Vercel https://vercel.com/ +Shields.io: Quality metadata badges for open source projects https://shields.io/ +umich careers https://engineering-umich-csm.symplicity.com/students/index.php?s=home +The Engineer/Manager Pendulum – charity.wtf https://charity.wtf/2017/05/11/the-engineer-manager-pendulum/ +Handshake https://umich.joinhandshake.com/ +EECS 485 Project 5: Wikipedia Search Engine | p5-search-engine https://eecs485staff.github.io/p5-search-engine/#python-virtual-environment +Site overview | freudpage https://app.netlify.com/sites/freudpage/overview +Udemy https://www.udemy.com/home/my-courses/learning/ +vimeo https://vimeo.com/ondemand/purchases +Blippi.gg https://blippi.gg/ +Secure Patient Portal https://web.healthdataexchange.com/Account/MyProfile +ImageShack - All Images https://imageshack.com/my/images +Device Info https://www.deviceinfo.me/ +Firebase console https://console.firebase.google.com/u/3/ +Personal apps | Heroku https://dashboard.heroku.com/apps +Google Domains - Domain overview https://domains.google.com/registrar/sudacode.com?authuser=2# +Google SearchConsole https://search.google.com/u/3/search-console?resource_id=sc-domain%3Asudacode.com +Speedtest by Ookla - The Global Broadband Speed Test https://www.speedtest.net/ +Yellowdig https://university-of-michigan.yellowdig.app/community/17592269410998?communityFeed=%7B%22perPage%22%3A20%7D +NBA Streams Reddit| Reddit NBA streams - NBAStreams https://nbastreams.to/ +Equifax https://my.equifax.com/membercenter/#/dashboard +Flask by Example – Setting up Postgres, SQLAlchemy, and Alembic – Real Python https://realpython.com/flask-by-example-part-2-postgres-sqlalchemy-and-alembic/ +Define and Access the Database — Flask Documentation (1.1.x) https://flask.palletsprojects.com/en/1.1.x/tutorial/database/ +EECS485 P3: Client-side Dynamic Pages | p3-insta485-clientside https://eecs485staff.github.io/p3-insta485-clientside/ +Practice Mock Interviews & Coding Problems - Land Top Jobs | Pramp https://www.pramp.com/#/ +Cypress Documentation https://docs.cypress.io/guides/overview/why-cypress.html#In-a-nutshell +The Anatomy of a Chess AI. Chess-playing programs made their grand… | by Levi Walker | Medium https://medium.com/the-innovation/the-anatomy-of-a-chess-ai-2087d0d565 +Table_of_logic_symbols.pdf http://jeiks.net/wp-content/uploads/2014/01/Table_of_logic_symbols.pdf +PayPal https://www.paypal.com/myaccount/summary +EECS 485 Lab Index | EECS 485 Lab https://eecs485staff.github.io/lab/ +Build a Real-Time Chat App With React Hooks and Socket.io | by Jakub Kozak | The Startup | Medium https://medium.com/swlh/build-a-real-time-chat-app-with-react-hooks-and-socket-io-4859c9afecb0 +(1) LeetCode - The World's Leading Online Programming Learning Platform https://leetcode.com/ +Dashboard - ProtonVPN https://account.protonvpn.com/dashboard +Mcard Discounts | Wolverine Access - Find & Favorite University of Michigan Resources https://wolverineaccess.umich.edu/task/all/mcard-discounts +Storyboard That: The World's Best Free Online Storyboard Creator https://www.storyboardthat.com/ +BruinReportOnline.com Home - UCLA Bruins Football Basketball Recruiting https://247sports.com/college/ucla/ +Client Area - Hostwinds https://clients.hostwinds.com/clientarea.php +Instances | Hostwinds https://clients.hostwinds.com/cloud/instance_details.php?serviceid=850872 +Concepts https://boardgame.io/documentation/#/ +Send Money, Pay Online or Set Up a Merchant Account - PayPal https://www.paypal.com/us/webapps/mpp/home +Introduction to Decision Trees (Titanic dataset) | Kaggle https://www.kaggle.com/dmilla/introduction-to-decision-trees-titanic-dataset +math.js | an extensive math library for JavaScript and Node.js https://mathjs.org/docs/datatypes/matrices.html +react-p5 - npm https://www.npmjs.com/package/react-p5 +PyGame: A Primer on Game Programming in Python – Real Python https://realpython.com/pygame-a-primer/ +Notion – The all-in-one workspace for your notes, tasks, wikis, and databases. https://www.notion.so/ +mfile: afs file management https://mfile.umich.edu/ +Netflix https://www.netflix.com/browse +ultipro sso https://gateway.ultiproworkplace.com/?cpi=https://sts.windows.net/6dadecb4-3d69-41eb-98a0-cd3c988f5bd4/ +Outlook https://outlook.office.com/mail/inbox +Microsoft Office Home https://www.office.com/?auth=2 +Chase Online https://secure05a.chase.com/web/auth/dashboard#/dashboard/index/index +Accounts - chase.com https://secure05a.chase.com/web/auth/dashboard#/dashboard/overviewAccounts/overview/singleDeposit +remote.it http://sudacode-linux.local:29999/#/ +EssentialsX Info - Permissions https://essinfo.xeya.me/permissions.html +Editor | LuckPerms https://luckperms.net/editor/EM3FAmwsVe +How To Use Linux Screen | Linuxize https://linuxize.com/post/how-to-use-linux-screen/ +My No-IP :: Hostnames https://my.noip.com/#!/dynamic-dns +My Training | KnowBe4 https://training.knowbe4.com/learner/index.html?50156524873371609924119553438665184561#/training +Octain Economic Price-Guide for Minecraft https://www.naughtynathan.co.uk/minecraft/prices.htm +University of Michigan | Coursera https://www.coursera.org/programs/university-of-michigan-coursera-learning-program-1egh5?authProvider=umich¤tTab=MY_COURSES +lofi hip hop radio - beats to relax/study to - YouTube https://www.youtube.com/watch?v=5qap5aO4i9A +Carts | iBUYPOWER® https://www.ibuypower.com/Carts +‎NICE on Apple Music https://music.apple.com/library/playlist/p.zpzxcZJN9VQ +Team overview | Netlify https://app.netlify.com/teams/ksyasuda/overview +Apple TV+ https://tv.apple.com/?itscg=10000&itsct=atv-tv_op-nav_wch-ctr-210111 +My files - OneDrive https://nowcomcorporation-my.sharepoint.com/personal/kyasuda_westlakefinancial_com/_layouts/15/onedrive.aspx +ABS Gladiator Gaming PC - Ryzen 7 5800X - GeForce RTX 3080 - G.Skill TridentZ RGB 32GB DDR4 3200MHz - 1TB Gigabyte AORUS Gen4 7000 SSD - 240MM RGB AIO - Newegg.com https://www.newegg.com/abs-ala251/p/N82E16883360155?Item=N82E16883360155 +FINAL FANTASY XIV: Mog Station https://secure.square-enix.com/account/app/svc/ffxivshopacctop?accid=e910cfc1cea2eb54da06f2aaebc53ebb16 +Portfolio | Robinhood https://robinhood.com/ +[CMR-2804] Create user for data difference report - JIRA https://westlakefinancial.atlassian.net/browse/CMR-2804 +Incidents - PagerDuty https://wfsalerts.pagerduty.com/incidents +Your work - JIRA https://westlakefinancial.atlassian.net/jira/your-work +Home https://community.snowflake.com/s/ +Westlake Snowflake https://westlakefinancial.us-central1.gcp.snowflakecomputing.com/console#/internal/worksheet +AUR (en) - Home https://aur.archlinux.org/ +ArchWiki https://wiki.archlinux.org/ +snowsight https://westlakefinancial.us-central1.gcp.snowflakecomputing.com/oauth/authorize?client_id=ICS6TIh2Lh6EZkQTI8DTVQCIWqK3Xg%3D%3D&display=popup&redirect_uri=https%3A%2F%2Fapps-api.c1.us-central1.gcp.app.snowflake.com%2Fcomplete-oauth%2Fsnowflake&response_type=code&scope=refresh_token&state=%7B%22isSecondaryUser%22%3Afalse%2C%22csrf%22%3A%224qzxnEqRIuv%22%2C%22url%22%3A%22https%3A%2F%2Fwestlakefinancial.us-central1.gcp.snowflakecomputing.com%22%2C%22browserUrl%22%3A%22https%3A%2F%2Fapp.snowflake.com%2Fus-central1.gcp%2Fwestlakefinancial%22%7D +Home | Patreon https://www.patreon.com/home +Projects · Dashboard · GitLab https://gitlab.westlakefinancial.com/ +LinusTechTips – Floatplane https://www.floatplane.com/channel/linustechtips/home +Everything you need to know about Qtile — Qtile 0.1.dev50+g3ac7442.d20211109 documentation https://docs.qtile.org/en/latest/index.html +ksyasuda (Kyle Yasuda) https://github.com/ksyasuda +ksyasuda/aniwrapper: A rofi wrapper around ani-cli: a command-line tool to browser, download, and stream anime https://github.com/ksyasuda/aniwrapper +Online Course | Hankey Group Learning Management System https://hankeyinvestments.myabsorb.com/#/online-courses/4d9dec73-e4fb-430a-8941-04bc164d1e24 +Data Team Board - Agile board - JIRA https://westlakefinancial.atlassian.net/jira/software/projects/DI/boards/262?assignee=60a41a6399b21f0070ef7532 +Bash Reference Manual https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Process-Substitution +Treasury ME https://nowcomcorporation.sharepoint.com/sites/westlakefinancialservices-itoperations/Wiki/TREASURY%20REPORT%20GUIDE%20abs,%20conduits%20and%20mid%20month%20reports.aspx +Phoenix https://phoenix.westlakefinancial.com/wfs-ums-ui/login.xhtml +YouTube TV - Watch & DVR Live Sports, Shows & News https://tv.youtube.com/welcome/?utm_servlet=prod +remoteit https://app.remote.it/ +Icecast Streaming Media Server http://192.168.4.54:8001/ +My Account | Nord https://my.nordaccount.com/dashboard/nordvpn/ +IP/DNS Detect - What is your IP, what is your DNS, what informations you send to websites. https://ipleak.net/ +Proxy setup on qBittorrent | NordVPN Support https://support.nordvpn.com/Connectivity/Proxy/1087802472/Proxy-setup-on-qBittorrent.htm +Pi-hole - edmodo http://192.168.4.54/admin/index.php +nginx Reverse Proxy on Raspberry Pi with Let's Encrypt https://webcodr.io/2018/02/nginx-reverse-proxy-on-raspberry-pi-with-lets-encrypt/ +Check your torrent IP http://checkmyip.torrentprivacy.com/ +Westlake Intranet http://intranet.westlakefinancial.com/ +Docker Hub https://hub.docker.com/ +VRV - Home of Your Favorite Channels https://vrv.co/ +MyAnimeList.net - Panel https://myanimelist.net/ +Crunchyroll https://www.crunchyroll.com/ +LiveChart.me https://www.livechart.me/fall-2020/tv +animepahe :: okay-ish anime website https://animepahe.com/ +AniDL https://anidl.org/ +AnimeKaizoku - Free Anime Mini Encodes Download Library https://animekaizoku.com/ +Browse :: Nyaa https://nyaa.si/ +SWAG setup - LinuxServer.io https://docs.linuxserver.io/general/swag +Algram/ytdl-webserver: 📻 Webserver for downloading youtube videos. Ready for docker. https://github.com/Algram/ytdl-webserver +Custom Domain Names for Home Servers — Technically Wizardry https://www.technicallywizardry.com/custom-domain-names-for-home-servers/ +Point Domain Name To Your Home Web Server – Individual Opinion https://www.inopinion.org/howto/point-domain-name-home-web-server/ +awesome-selfhosted/awesome-selfhosted: A list of Free Software network services and web applications which can be hosted on your own servers https://github.com/awesome-selfhosted/awesome-selfhosted +Netdata Cloud https://app.netdata.cloud/spaces/ksyasuda-space/rooms/general/overview +Dashboard - sudacode - Duo https://admin-a5cd15af.duosecurity.com/ +RegExr: Learn, Build, & Test RegEx https://regexr.com/ +Introduction - LinuxServer.io https://docs.linuxserver.io/ +Yubico demo website https://demo.yubico.com/playground +Open Port Check Tool -- Verify Port Forwarding on Your Router https://www.canyouseeme.org/ +Trilium Notes https://edmodo.sudacode.com/trilium/ +Dashboard - WakaTime https://wakatime.com/dashboard +regex101: build, test, and debug regex https://regex101.com/ +pystardust/ani-cli: A cli tool to browse and play anime https://github.com/pystardust/ani-cli +Home | Ksyasuda@umich.edu's Account | Cloudflare https://dash.cloudflare.com/649419836e2329af4f85b6e997d4e323 +New Tab moz-extension://7400c652-4193-44a4-bc88-4aae3bab1edd/app.html +Sudacode Startpage moz-extension://7400c652-4193-44a4-bc88-4aae3bab1edd/app.html +about:blank about:blank +plex https://app.plex.tv/desktop/#!/ +backpack https://backpack.sudacode.com/ +keybindings qute://help/img/cheatsheet-big.png +juice leaks https://mega.nz/folder/vJgTFQJI#z8PZ4pL9QGUbmogSroV_tw +geekhack https://geekhack.org/index.php +f1tv https://f1tv.formula1.com/ +homelab icons https://thehomelab.wiki/books/helpful-tools-resources/page/icons-for-self-hosted-dashboards +homelab wiki https://thehomelab.wiki/ +odysee https://odysee.com/ +shortcodes https://gohugo.io/content-management/shortcodes/ +linuxserver blog https://www.linuxserver.io/blog +swag dashboard https://dashboard.suda.codes/ +gitea https://gitea.suda.codes/ +coinbase https://www.coinbase.com/dashboard +kraken https://www.kraken.com/u/instant +emulator https://emulator.suda.codes/ +emulator backend https://emulator.suda.codes/backend/ +rompatcher https://www.marcrobledo.com/RomPatcher.js/ +tdarr https://tdarr.suda.codes/#/ +httpie https://httpie.io/docs/cli +iimi https://www.newegg.com/ +mlbstream.me https://reddit.mlbstream.me/mlb-2022-streams +poolwatch https://www.poolwatch.io/coin/monero +f2pool https://www.f2pool.com/ +nanopool-xmr https://xmr.nanopool.org/ +netdata https://netdata.suda.codes/#after=-240;before=0;=undefined;theme=slate;utc=America%2FLos_Angeles +photoprism https://photoprism.suda.codes/prism/browse +noted https://noted.lol/ +commento https://commento.sudacode.com/dashboard +dockerhub https://hub.docker.com/ +mango https://mango.suda.codes/login +medium https://medium.com/ +wsj https://www.wsj.com/ +twitch https://www.twitch.tv/ +1377x https://www.1377x.to/ +gf https://ghostfolio.suda.codes/home/overview +gr https://grafana.suda.codes/d/4ReTFPwnk/the-box?orgId=1&refresh=10s +wall https://wallabag.suda.codes/ +su https://sudacode.com/ +link https://links.suda.codes/bookmarks +kav https://kavita.suda.codes/library +metu https://metube.suda.codes/ +book https://openbooks.suda.codes/ +jup https://jupyter.suda.codes/lab/tree/work/yuh/arrays-and-strings/urlify.ipynb +prom https://prometheus.suda.codes/graph?g0.expr=&g0.tab=1&g0.stacked=0&g0.show_exemplars=0&g0.range_input=1h +rob https://robinhood.com/ +qbit https://qbit.suda.codes/#/ +jack https://jackett.suda.codes/jackett/UI/Dashboard +rad https://radarr.suda.codes/ +pap https://paperless.suda.codes/dashboard +flix https://www.netflix.com/browse +yt https://www.youtube.com/ +sh https://www.reddit.com/r/selfhosted/ +fa https://fontawesome.com/kits +ncf https://nextcloud.suda.codes/apps/files/?dir=/&fileid=6 +ncc https://nextcloud.suda.codes/apps/calendar/timeGridWeek/now +gist https://gist.github.com/ +vercel https://vercel.com/sudacode +gsc https://search.google.com/search-console?resource_id=sc-domain%3Asudacode.com +ba https://assets.sudacode.com/ +bl https://github.com/ksyasuda/sudacode-blog +fire https://firefly.suda.codes/ +el https://element.suda.codes/#/welcome +gh https://github.com/ +suda https://sudacode.com/ +cf https://dash.cloudflare.com/649419836e2329af4f85b6e997d4e323/sudacode.com +umami https://umami.sudacode.com/dashboard +fidel https://oltx.fidelity.com/ftgw/fbc/oftop/portfolio#summary +ly https://lychee.sudacode.com/ +td https://invest.ameritrade.com/grid/p/site#r=home +th https://trade.thinkorswim.com/ +ath https://theathletic.com/ +dal https://dalle.suda.codes/ +files https://files.suda.codes/login?redirect=%2Ffiles%2F +processlist http://webapps.westlakefinancial.com/it/depot_processlist/index.php +ha http://192.168.5.172:8123/lovelace/default_view +gcp https://console.cloud.google.com/storage/browser?authuser=5&project=wfs-datawarehouse&supportedpurview=project&prefix=&forceOnObjectsSortingFiltering=false +vault https://vault.suda.codes/#/ +steam https://steamcommunity.com/ +drop https://drop.com/home +pihole http://10.2.0.100/admin/ +ama https://www.amazon.com/ +lid https://lidarr.suda.codes/ +deez https://www.deezer.com/us/ +deem https://deemix.suda.codes/ +tan https://tanoshi.suda.codes/library +pihole2 http://192.168.5.172/admin/ +aave https://aave.com/ +fr https://login.fidelityrewards.com/onlineCard/transactionDetails.do +fi https://oltx.fidelity.com/ftgw/fbc/oftop/portfolio#summary +ghostfolio https://github.com/ghostfolio/ghostfolio +bar https://www.barrons.com/ +mar https://www.marketwatch.com/ +mgm https://www.mgmresorts.com/account/rewards/ +pod https://podgrab.suda.codes/ +med https://medusa.suda.codes/home/ +espn https://www.espn.com/ +eth https://etherscan.io/ +poly https://polygonscan.com/ +avax https://snowtrace.io/ +game https://gameserver.suda.codes/ +bro https://247sports.com/college/ucla/ +cb https://cloudbeaver.suda.codes/#/setup/welcome +js https://jellyseerr.suda.codes/ +jf http://75.85.165.186:8096/web/index.html#!/home.html +son https://sonarr.suda.codes/ +qbit-lan http://thebox:8081/#/ +kan https://kanboard.suda.codes/ +meta https://portfolio.metamask.io/ +ikon https://www.ikonpass.com/ +mas https://mastodon.sudacode.com/home +sho https://www.shodan.io/dashboard +pg https://mastodon.sudacode.com/pghero +sq https://mastodon.sudacode.com/sidekiq +chat https://chat.openai.com/auth/login +new https://www.newegg.com/ +bbmr https://www.bigbearmountainresort.com/ +archinstall https://wiki.archlinux.org/title/Installation_guide +rw https://www.rwlasvegas.com/ +cmc https://coinmarketcap.com/ +bw https://www.bensweather.com/ +geek https://nzbgeek.info/dashboard.php +sab https://sabnzbd.suda.codes/ +sonarr-anime https://sonarr-anime.suda.codes/ +dashy https://dash.suda.codes/ diff --git a/userscripts/qute-bitwarden.py b/userscripts/qute-bitwarden.py new file mode 100755 index 0000000..043a604 --- /dev/null +++ b/userscripts/qute-bitwarden.py @@ -0,0 +1,291 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Chris Braun (cryzed) +# +# SPDX-License-Identifier: GPL-3.0-or-later + +""" +Insert login information using Bitwarden CLI and a dmenu-compatible application +(e.g. dmenu, rofi -dmenu, ...). +""" + +USAGE = """The domain of the site has to be in the name of the Bitwarden entry, for example: "github.com/cryzed" or +"websites/github.com". The login information is inserted by emulating key events using qutebrowser's fake-key command in this manner: +[USERNAME][PASSWORD], which is compatible with almost all login forms. + +If enabled, with the `--totp` flag, it will also move the TOTP code to the +clipboard, much like the Firefox add-on. + +You must log into Bitwarden CLI using `bw login` prior to use of this script. +The session key will be stored using keyctl for the number of seconds passed to +the --auto-lock option. + +To use in qutebrowser, run: `spawn --userscript qute-bitwarden` +""" + +EPILOG = """Dependencies: tldextract (Python 3 module), pyperclip (optional +Python module, used for TOTP codes), Bitwarden CLI (1.7.4 is known to work +but older versions may well also work) + +WARNING: The login details are viewable as plaintext in qutebrowser's debug log +(qute://log) and might be shared if you decide to submit a crash report!""" + +import argparse +import enum +import functools +import json +import os +import shlex +import subprocess +import sys + +import tldextract + +argument_parser = argparse.ArgumentParser( + description=__doc__, + usage=USAGE, + epilog=EPILOG, +) +argument_parser.add_argument('url', nargs='?', default=os.getenv('QUTE_URL')) +argument_parser.add_argument('--dmenu-invocation', '-d', default="rofi -dmenu -i -p Bitwarden" help='Invocation used to execute a dmenu-provider') +argument_parser.add_argument('--password-prompt-invocation', '-p', default='rofi -dmenu -p "Master Password" -password -lines 0', + help='Invocation used to prompt the user for their Bitwarden password') +argument_parser.add_argument('--no-insert-mode', '-n', dest='insert_mode', action='store_false', + help="Don't automatically enter insert mode") +argument_parser.add_argument('--totp', '-t', action='store_true', + help="Copy TOTP key to clipboard") +argument_parser.add_argument('--io-encoding', '-i', default='UTF-8', + help='Encoding used to communicate with subprocesses') +argument_parser.add_argument('--merge-candidates', '-m', action='store_true', + help='Merge pass candidates for fully-qualified and registered domain name') +argument_parser.add_argument('--auto-lock', type=int, default=900, + help='Automatically lock the vault after this many seconds') +group = argument_parser.add_mutually_exclusive_group() +group.add_argument('--username-only', '-e', + action='store_true', help='Only insert username') +group.add_argument('--password-only', '-w', + action='store_true', help='Only insert password') +group.add_argument('--totp-only', '-T', + action='store_true', help='Only insert totp code') + +stderr = functools.partial(print, file=sys.stderr) + + +class ExitCodes(enum.IntEnum): + SUCCESS = 0 + FAILURE = 1 + # 1 is automatically used if Python throws an exception + NO_PASS_CANDIDATES = 2 + COULD_NOT_MATCH_USERNAME = 3 + COULD_NOT_MATCH_PASSWORD = 4 + + +def qute_command(command): + with open(os.environ['QUTE_FIFO'], 'w') as fifo: + fifo.write(command + '\n') + fifo.flush() + + +def ask_password(password_prompt_invocation): + process = subprocess.run( + shlex.split(password_prompt_invocation), + text=True, + stdout=subprocess.PIPE, + ) + if process.returncode > 0: + raise Exception('Could not unlock vault') + master_pass = process.stdout.strip() + return subprocess.check_output( + ['bw', 'unlock', '--raw', master_pass], + text=True, + ).strip() + + +def get_session_key(auto_lock, password_prompt_invocation): + if auto_lock == 0: + subprocess.call(['keyctl', 'purge', 'user', 'bw_session']) + return ask_password(password_prompt_invocation) + else: + process = subprocess.run( + ['keyctl', 'request', 'user', 'bw_session'], + text=True, + stdout=subprocess.PIPE, + ) + key_id = process.stdout.strip() + if process.returncode > 0: + session = ask_password(password_prompt_invocation) + if not session: + raise Exception('Could not unlock vault') + key_id = subprocess.check_output( + ['keyctl', 'add', 'user', 'bw_session', session, '@u'], + text=True, + ).strip() + + if auto_lock > 0: + subprocess.call(['keyctl', 'timeout', str(key_id), str(auto_lock)]) + return subprocess.check_output( + ['keyctl', 'pipe', str(key_id)], + text=True, + ).strip() + + +def pass_(domain, encoding, auto_lock, password_prompt_invocation): + session_key = get_session_key(auto_lock, password_prompt_invocation) + process = subprocess.run( + ['bw', 'list', 'items', '--session', session_key, '--url', domain], + capture_output=True, + ) + + err = process.stderr.decode(encoding).strip() + if err: + msg = 'Bitwarden CLI returned for {:s} - {:s}'.format(domain, err) + stderr(msg) + + if process.returncode: + return '[]' + + out = process.stdout.decode(encoding).strip() + + return out + + +def get_totp_code(selection_id, domain_name, encoding, auto_lock, password_prompt_invocation): + session_key = get_session_key(auto_lock, password_prompt_invocation) + process = subprocess.run( + ['bw', 'get', 'totp', '--session', session_key, selection_id], + capture_output=True, + ) + + err = process.stderr.decode(encoding).strip() + if err: + # domain_name instead of selection_id to make it more user-friendly + msg = 'Bitwarden CLI returned for {:s} - {:s}'.format(domain_name, err) + stderr(msg) + + if process.returncode: + return '[]' + + out = process.stdout.decode(encoding).strip() + + return out + + +def dmenu(items, invocation, encoding): + command = shlex.split(invocation) + process = subprocess.run(command, input='\n'.join( + items).encode(encoding), stdout=subprocess.PIPE) + return process.stdout.decode(encoding).strip() + + +def fake_key_raw(text): + for character in text: + # Escape all characters by default, space requires special handling + sequence = '" "' if character == ' ' else r'\{}'.format(character) + qute_command('fake-key {}'.format(sequence)) + + +def main(arguments): + if not arguments.url: + argument_parser.print_help() + return ExitCodes.FAILURE + + extract_result = tldextract.extract(arguments.url) + + # Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains), + # the registered domain name and finally: the IPv4 address if that's what + # the URL represents + candidates = [] + for target in filter(None, [ + extract_result.fqdn, + extract_result.registered_domain, + extract_result.subdomain + '.' + extract_result.domain, + extract_result.domain, + extract_result.ipv4]): + target_candidates = json.loads( + pass_( + target, + arguments.io_encoding, + arguments.auto_lock, + arguments.password_prompt_invocation, + ) + ) + if not target_candidates: + continue + + candidates = candidates + target_candidates + if not arguments.merge_candidates: + break + else: + if not candidates: + stderr('No pass candidates for URL {!r} found!'.format( + arguments.url)) + return ExitCodes.NO_PASS_CANDIDATES + + if len(candidates) == 1: + selection = candidates.pop() + else: + choices = ['{:s} | {:s}'.format(c['name'], c['login']['username']) for c in candidates] + choice = dmenu(choices, arguments.dmenu_invocation, arguments.io_encoding) + choice_tokens = choice.split('|') + choice_name = choice_tokens[0].strip() + choice_username = choice_tokens[1].strip() + selection = next((c for (i, c) in enumerate(candidates) + if c['name'] == choice_name + and c['login']['username'] == choice_username), + None) + + # Nothing was selected, simply return + if not selection: + return ExitCodes.SUCCESS + + username = selection['login']['username'] + password = selection['login']['password'] + totp = selection['login']['totp'] + + if arguments.username_only: + fake_key_raw(username) + elif arguments.password_only: + fake_key_raw(password) + elif arguments.totp_only: + # No point in moving it to the clipboard in this case + fake_key_raw( + get_totp_code( + selection['id'], + selection['name'], + arguments.io_encoding, + arguments.auto_lock, + arguments.password_prompt_invocation, + ) + ) + else: + # Enter username and password using fake-key and (which seems to work almost universally), then switch + # back into insert-mode, so the form can be directly submitted by + # hitting enter afterwards + fake_key_raw(username) + qute_command('fake-key ') + fake_key_raw(password) + + if arguments.insert_mode: + qute_command('mode-enter insert') + + # If it finds a TOTP code, it copies it to the clipboard, + # which is the same behavior as the Firefox add-on. + if not arguments.totp_only and totp and arguments.totp: + # The import is done here, to make pyperclip an optional dependency + import pyperclip + pyperclip.copy( + get_totp_code( + selection['id'], + selection['name'], + arguments.io_encoding, + arguments.auto_lock, + arguments.password_prompt_invocation, + ) + ) + + return ExitCodes.SUCCESS + + +if __name__ == '__main__': + arguments = argument_parser.parse_args() + sys.exit(main(arguments))