Skip to content

Instantly share code, notes, and snippets.

View forsgren's full-sized avatar

Kristoffer Forsgren forsgren

View GitHub Profile
@forsgren
forsgren / readme.md
Created February 29, 2024 14:57 — forked from nickcernis/readme.md
Exclude node_modules and .git from Backblaze backups on Mac

Exclude node_modules and .git from Backblaze backups on Mac

  1. Edit the file at /Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml.
  2. Add these rules inside the bzexclusions tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
@forsgren
forsgren / AuthyToOtherAuthenticator.md
Created January 8, 2024 15:06 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

#!/usr/bin/env zsh
sleep 10 &!
pid=$! # Process Id of the previous running command
spin='⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓'
i=0
while kill -0 $pid 2>/dev/null; do
i=$(((i + 1) % 10))
printf "$fg[magenta]\r${spin:$i:1}"
@forsgren
forsgren / macos-disable-resize
Created September 1, 2023 09:27 — forked from olssonm/macos-disable-resize
Disable resizing of the macOS dock
defaults write com.apple.dock size-immutable -bool true; killall Dock
@forsgren
forsgren / wordpress-change-url.php
Created December 8, 2022 12:09 — forked from lavoiesl/wordpress-change-url.php
PHP script to replace site url in Wordpress database dump, even with WPML
#!/usr/bin/env php
<?php
/**
* PHP script to replace site url in Wordpress database dump, even with WPML
* @link https://gist.github.com/lavoiesl/2227920
*/
if (!empty($argv[1]) && $argv[1] == 'update') {
$file = file_get_contents('https://gist.github.com/lavoiesl/2227920/raw/wordpress-change-url.php');
if ($file === false) {
mysql -u root -p < /path/to/sql/frile/multiDB.sql
@forsgren
forsgren / dump-mamp-mysql-dbs.sh
Created January 11, 2022 20:40 — forked from salcode/dump-mamp-mysql-dbs.sh
Shell Script to dump all MAMP DBs into separate files
# based on http://www.commandlinefu.com/commands/view/2916/backup-all-mysql-databases-to-individual-files
# but modified for the MAMP path and to include default root/root as username and password
for I in $(/Applications/MAMP/Library/bin/mysql -u root -proot -e 'show databases' -s --skip-column-names); do /Applications/MAMP/Library/bin/mysqldump -u root -proot $I | gzip > "$I.sql.gz"; done
@forsgren
forsgren / plink-plonk.js
Created February 15, 2020 18:17 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@forsgren
forsgren / IFTTTDate.md
Created August 19, 2019 15:34 — forked from oscarmorrison/IFTTTDate.md
Make IFTTT Date Format play nice with Google Spreadsheets

##Date and Time

=TIMEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " ")) + DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Date

=DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Time