Skip to content

Instantly share code, notes, and snippets.

@mowtschan
mowtschan / open_pr_ado.sh
Created March 7, 2022 11:48
Open browser for Pull Request in azure devops
#!/usr/bin/env bash
set -e
BRANCH=$(git rev-parse --abbrev-ref HEAD)
TARGET_BRANCH=main
REMOTE=$(git remote get-url origin)
# assume the repo uses SSH
REMOTE=${REMOTE#"git@ssh.dev.azure.com:v3/"}
@mowtschan
mowtschan / Syncing a fork
Last active May 13, 2021 09:42
Sync a fork of a repository to keep it up-to-date with the upstream repository
git remote add upstream ORIGINAL_REPO_URL
git fetch upstream
git checkout main
git merge upstream/main
git push
@mowtschan
mowtschan / gist:d1956b4634a84698ab3a96472f710610
Last active November 7, 2021 10:35
Burn openhaystack firmware on NRF51822 device
run in the terminal:
```
brew install open-ocd
openocd -f /usr/local/share/openocd/scripts/interface/stlink.cfg -f /usr/local/share/openocd/scripts/target/nrf51.cfg
```
open another terminal window:
```
telnet localhost 4444
reset halt
nrf51 mass_erase
@mowtschan
mowtschan / gist:6df70414a77620078684d249ab98272e
Last active March 27, 2022 08:29
Enable CORS on GL.iNet GL-MT300N-V2 (OpenWrt, lighttpd)
ssh root@192.168.8.1
opkg update
opkg install lighttpd-mod-setenv
vim /etc/lighttpd/conf.d/30-setenv.conf
# ---
server.modules += ( "mod_setenv" )
setenv.add-response-header = (
"Access-Control-Allow-Origin" => "<PUT HERE YOUR SITE, DON'T USE *>",

Keybase proof

I hereby claim:

  • I am mowtschan on github.
  • I am mowtschan (https://keybase.io/mowtschan) on keybase.
  • I have a public key ASD8UG8cIMulv7EZ4XMjUdoBddA0HdYzX8-IFzlZAD9c4Qo

To claim this, I am signing this object: