Skip to content

Instantly share code, notes, and snippets.

@mostlygeek
mostlygeek / jun-jul-aug.txt
Created August 18, 2020 00:47
Normandy experiments with JEXL in Jun, Jul, Aug 2020
Turned into new FilterObject: preset_choices=['pocket-1']
https://github.com/mozilla/normandy/pull/2250
==========================================================
> 2020-07-14 1011 multi-preference-experiment [(!("browser.newtabpage.enabled"|preferenceIsUserSet)||!("browser.startup.homepage"|preferenceIsUserSet))]
> 2020-06-02 975 multi-preference-experiment [(!("browser.newtabpage.enabled"|preferenceIsUserSet)||!("browser.startup.homepage"|preferenceIsUserSet))&&!("browser.newtabpage.activity-stream.showSearch"|preferenceIsUserSet)&&!("browser.newtabpage.activity-stream.feeds.topsites"|preferenceIsUserSet)&&!("browser.newtabpage.activity-stream.feeds.section.topstories"|preferenceIsUserSet)&&!("browser.newtabpage.activity-stream.feeds.section.highlights"|preferenceIsUserSet)&&!("browser.newtabpage.activity-stream.showSponsored"|preferenceIsUserSet)]
> 2020-06-02 976 multi-preference-experiment [(!("browser.newtabpage.enabled"|preferenceIsUserSet)||!("browser.startup.homepage"|preferenceIs
@mostlygeek
mostlygeek / 2020-07-01.txt
Last active July 1, 2020 19:27
tidy up recipes
source: https://github.com/mostlygeek/normandy-tools/tree/master/bin/show-changes
updated created days_ttl revs live? id type slug
------- ------- -------- ---- ----- -- ---- ----
2020-06-30 2020-06-30 0 1 true 1008 branched-addon-study bug-1649504-addon-google-accounts-login-check-v2-release-75-78
2020-06-30 2020-06-30 0 1 true 1006 preference-rollout bug-1622091-rollout-beta-rollout-of-samesite-lax-change-beta-79-81
2020-06-30 2020-06-23 7 3 true 997 multi-preference-experiment bug-1646068-pref-activity-stream-pocket-new-tab-dynamic-video-card-sm-beta-78-79
2020-06-30 2020-06-23 7 2 true 999 multi-preference-experiment bug-1646076-pref-activity-stream-pocket-new-tab-popular-topics-smoke--beta-78-79
2020-06-30 2020-06-23 7 2 true 998 multi-preference-experiment bug-1646718-pref-understand-retention-impact-of-pdf-unknown-conten
!! Note!!
The total count uses the last time the recipe was changed. Interpret the
number as the number of recipes *LAST CHANGED* in that month.
If a recipe CREATED in 2019-02 is changed in 2019-06 it will
be counted in 2019-06.
@mostlygeek
mostlygeek / gist:b8d80fe367881e42fcc419ea642c112a
Last active March 5, 2019 18:31
active normandy recipes (formatted)
$ curl -s 'https://normandy.cdn.mozilla.net/api/v1/recipe/?enabled=true' | jq -c '.[] | "(\(.id))|\(.action)|\(.last_updated)|\(.name)"' | sed 's/"//g' | column -ts '|'
(713) show-heartbeat 2019-03-05T18:13:42.890914Z Heartbeat: Pinned Tabs Usage
(711) show-heartbeat 2019-03-04T21:24:46.984158Z Heartbeat Scroll [vpn]
(710) show-heartbeat 2019-03-04T21:24:28.155971Z Heartbeat Scroll [v3d]
(709) show-heartbeat 2019-03-04T21:24:14.293945Z Heartbeat Scroll [v3c]
(708) show-heartbeat 2019-03-04T21:23:53.036426Z Heartbeat Scroll [v3b]
(707) show-heartbeat 2019-03-04T21:23:35.399718Z Heartbeat Scroll [v3a]
(706) show-heartbeat 2019-03-04T21:23:15.145977Z Heartbeat Scroll [v2d]
(705) show-heartbeat 2019-03-04T21:22:58.267500Z Heartbeat Scroll [v2c]
@mostlygeek
mostlygeek / openvpn edgerouter lite
Created November 11, 2018 00:16
my edgerouter TCP 443 open vpn config
openvpn vtun1 {
firewall {
in {
name OVPN_IN
}
local {
name OVPN_LOCAL
}
out {
name OVPN_OUT
@mostlygeek
mostlygeek / table.md
Last active November 6, 2018 23:12
Pref Experiment Recipes (Filtered)

source:

curl https://gist.githubusercontent.com/rehandalal/bcd4818457b5697e1d9e98951de1713e/raw/3723219fe3ceb294d353bed1a8bf4692b59a6bc0/filtered-recipes.json | \
    jq -c '.[] | {id: .id, slug: .latest_revision.arguments.slug, pref: .latest_revision.arguments.preferenceName, created: .latest_revision.date_created, creator : .latest_revision.creator | "\(.first_name) \(.last_name)", ft: .latest_revision.filter_expression}' | \
    jq -c '. | "$$ \(.id) $$ \(.created) $$ \(.creator) $$ \(.slug) $$ \(.pref) $$ \(.ft) $$"'  | sed 's/"//g' | sed  's/|/\|/g' | sed 's/\$\$/|/g' | sort
id created creator slug pref name filter expression
311 2017-11-21T18:29:39.911418Z null null pref-flip-autofill-release-1405217-2-2 extensions.formautofill.available ( [normandy.userId]
@mostlygeek
mostlygeek / firefox-heartbeat.js
Created September 6, 2018 23:38
Manually triggering normandy's show-heartbeat action w/ the Fx browser console
// copy + paste these commands into the browser console to trigger
// the heartbeat pop up
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://normandy/lib/Heartbeat.jsm");
ChromeUtils.import("resource://normandy/lib/SandboxManager.jsm");
const recentWindow = Services.wm.getMostRecentNonPBWindow("navigator:browser");
const sm = new SandboxManager();
new Heartbeat(recentWindow, sm, {flowId: "test",
> go run test-pipe.go | jq -rc '"id:\(.id) -> \(.data | length) bytes"'
id:4 -> 10240 bytes
id:5 -> 10240 bytes
id:6 -> 10240 bytes
id:7 -> 10240 bytes
... (3 seconds of output)
id:5 -> 10240 bytes
@mostlygeek
mostlygeek / process-tar.go
Created February 1, 2018 05:48
list files from a tar archive
package main
// tweaked from
// original source: https://gist.github.com/indraniel/1a91458984179ab4cf80
import (
"archive/tar"
"compress/gzip"
"flag"
"fmt"
@mostlygeek
mostlygeek / gist:e116b8682d0c0407955a938715786390
Created November 23, 2017 20:06
sort files into directories based on date
# kind of a monstrosity, but keeping it here for posterity
# ls all files using -1 ... to deal with spaces in filenames
# grep for only move files we're interested in
# ... process the list with while ... done
# ... use ls -l -D ... to format the creation time into a directory name
# ... make directory, move file.
ls -1 | \
grep -iE "\.(jpg|mov|mp4|aae|png)$" | \
while read F; do