dot

packages and services management
Log | Files | Refs | README

commit c9ec559474a38ff4b93a0cc4f673db1313aee810
parent aaca17602f711bb4b01fa62e4a6d1eebcb0833e9
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 13 Feb 2018 03:29:00 +0100

[add] mail-based rss with sfeed

Diffstat:
Mbin/io | 5+++--
Mbin/mfilter | 73+++++++------------------------------------------------------------------
Mbin/ssh-paste | 2+-
Abin/update-sfeed | 23+++++++++++++++++++++++
Mdot/sfeed/sfeedrc | 15+++++++++++----
Metc/mblaze/filter | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aetc/sfeed | 4++++
Apack/ffmpeg/build | 7+++++++
8 files changed, 116 insertions(+), 73 deletions(-)

diff --git a/bin/io b/bin/io @@ -101,8 +101,9 @@ EOF } | iomenu -# ;; (s|sfeed) - exec xdg-open "$(find "${HOME}/.sfeed/feeds" -type f -exec sfeed_plain {} + | - iomenu | sed 's/.* //')" + exec xdg-open "$(find "${HOME}/.sfeed/feeds" -type f \ + -exec sfeed_plain {} + | + sort -k 2 -t ' ' | iomenu | sed 's/.* //')" ;; (*) printf 'usage: %s ' "${0##*/}" diff --git a/bin/mfilter b/bin/mfilter @@ -1,73 +1,14 @@ #!/bin/sh # read and filter mails using mblaze -minc "${VAR}/mail/INBOX" > /dev/null +minc "${VAR}/mail/INBOX" | mseq -S while read -r dir header glob do - mkdir -p "${VAR}/mail/${dir}/cur" - mkdir -p "${VAR}/mail/${dir}/new" - mkdir -p "${VAR}/mail/${dir}/tmp" + mkdir -p "${VAR}/mail/${dir}/cur" \ + "${VAR}/mail/${dir}/new" \ + "${VAR}/mail/${dir}/tmp" printf '%-25s' "${dir}" - mlist "${VAR}/mail/INBOX" | mpick -t "$header ~~~ $glob" | - xargs -rI % mv % "${VAR}/mail/${dir}/new" -done << 'EOF' -actux.eu.org "List-Id" "*@actux.eu.org*" -amazon.com "From" "*@amazon.*" -amnesty.org "From" "*amnesty.*" -bandcamp.com "From" "*Cryo Chamber*" -bandcamp.com "From" "*makeupandvanityset.com*" -bandcamp.com "From" "*bandcamp.com*" -breizh-entropy.org "List-Id" "*breizh-entropy.org*" -coinbase.com "From" "*coinbase.com*" -crous-rennes.fr "From" "*crous-rennes.fr*" -dropbox.com "From" "*dropbox.*" -ebay.com "From" "*ebay.*" -epitech.eu/bde "From" "*bde.epitech.rennes@gmail.com*" -epitech.eu/intra "From" "*@intra.epitech.eu*" -epitech.eu/marvin "From" "*nao.marvin@epitech.eu*" -epitech.eu/@ "From" "*@epitech.eu*" -epitech.eu/@ "From" "*ionis-group.org*" -free.fr "From" "*@free-mobile.fr*" -freebsd.org "From" "*freebsd.org*" -fsf.org "From" "*fsf.org*" -fosdem.org/distributions "List-Id" "*distributions-devroom.lists.fosdem.org*" -fosdem.org/network "List-Id" "*network-devroom.lists.fosdem.org*" -fosdem.org/announce "List-Id" "*fosdem.lists.fosdem.org*" -fosdem.org/security "List-Id" "*security-devroom.lists.fosdem.org*" -fosdem.org/@ "From" "*fosdem.org*" -gandi.net "From" "*gandi.net*" -github.com "From" "*github.com*" -gobolinux.org "List-Id" "*gobolinux.org*" -google.com "From" "*google.com*" -gopherproject.org "List-Id" "*gopher-project*" -grifon.fr "List-Id" "*grifon.fr*" -keybase.io "From" "*keybase.io*" -lobste.rs "From" "*@lobste.rs*" -netsukuku.freaknet.org "List-Id" "*netsukuku.lists.dyne.org*" -nixers.net "From" "*@nixers.net*" -noip.com "From" "*@noip.com*" -openbsd.org/advocacy "List-ID" "*advocacy.openbsd.org*" -openbsd.org/announce "List-ID" "*announce.openbsd.org*" -openbsd.org/tech "List-ID" "*tech.openbsd.org*" -paypal.com "From" "*paypal.*" -reddit.com "From" "*@reddit.*" -repo.or.cz "Subject" "*\[repo.or.cz\]*" -researchgate.net "From" "*@researchgate.*" -researchgate.net "From" "*@researchgatemail.*" -sabotage.tech "Mailing-List" "*sabotage*@lists.openwall.com*" -suckless.org "List-Id" "*suckless.org*" -transports "From" "*@captaintrain.com*" -transports "From" "*BlaBlaCar*" -transports "From" "*flixbus*" -transports "From" "*keolis.com*" -transports "From" "*megabus*" -transports "From" "*ouibus*" -transports "From" "*ouigo*" -transports "From" "*sncf.com*" -transports "From" "*oui.sncf*" -univ-rennes1.fr "List-Id" "*univ-rennes1.fr*" -wordpress.com "From" "*wordpress.com*" -yammer.com "From" "*yammer.com*" -youtube.com "From" "*youtube.com*" -EOF + mseq : | mpick -t "$header ~~~ $glob" | + xargs -rI {} mv {} "${VAR}/mail/${dir}/new" +done < "${ETC}/mblaze/filter" diff --git a/bin/ssh-paste b/bin/ssh-paste @@ -5,4 +5,4 @@ cat "${@}" | ssh josuah@josuah.net ' cd srv/p && tmp=$(mktemp XXXXX.txt) cat > "${tmp}" printf %s "${tmp}" -' | xargs printf 'gopher://josuah.net/0/p/%s\n' +' | sed 's|.*|gopher://josuah.net/0/p/&|' diff --git a/bin/update-sfeed b/bin/update-sfeed @@ -0,0 +1,23 @@ +#!/bin/sh +# update feeds, merge with old feeds. + +while read -r name url +do + file="${VAR}/sfeed/${name}" + + printf '%-30s %s\n' "${name}" "${url}" + touch "${file}" + mkdir -p "${VAR}/sfeed" \ + "${VAR}/mail/sfeed/${name}/new" \ + "${VAR}/mail/sfeed/${name}/cur" \ + "${VAR}/mail/sfeed/${name}/tmp" + + # fetch then sort and merge by id, link, title + curl -#LH 'User-Agent:' "${url}" | + sfeed | + sort -t ' ' -u -k6,6 -k3,3 -k2,2 "${file}" - | + sort -t ' ' -k1rn,1 -o "${file}" + + # deliver using mblaze(7) + sfeed_mbox "${file}" | mdeliver -M "${VAR}/mail/sfeed/${name}" +done < "${ETC}/sfeed" diff --git a/dot/sfeed/sfeedrc b/dot/sfeed/sfeedrc @@ -1,3 +1,7 @@ +#!/bin/sh + +sfeedpath="${VAR}/sfeed" + feeds() { # feed <name> @@ -8,15 +12,18 @@ feeds() feed codemadness.nl \ http://www.codemadness.nl/rss.xml + feed dragonflydigest.org \ + https://www.dragonflydigest.com/feed + https://www.dragonflydigest.com + feed kernel.org \ http://kernel.org/kdist/rss.xml \ http://kernel.org - feed slashdot.org \ - http://rss.slashdot.org/Slashdot/slashdot \ - http://slashdot.org - feed xkcd.com \ http://xkcd.com/atom.xml \ http://xkcd.com + + find "${VAR}/sfeed" -type f -exec sfeed_mbox {} + | + mdeliver -M "${VAR}/mail/sfeed" } diff --git a/etc/mblaze/filter b/etc/mblaze/filter @@ -0,0 +1,60 @@ +actux.eu.org "List-Id" "*@actux.eu.org*" +amazon.com "From" "*@amazon.*" +amnesty.org "From" "*amnesty.*" +bandcamp.com "From" "*Cryo Chamber*" +bandcamp.com "From" "*makeupandvanityset.com*" +bandcamp.com "From" "*bandcamp.com*" +breizh-entropy.org "List-Id" "*breizh-entropy.org*" +coinbase.com "From" "*coinbase.com*" +crous-rennes.fr "From" "*crous-rennes.fr*" +dropbox.com "From" "*dropbox.*" +dragonflybsd.org/hammer "List-Id" "*hammer.dragonflybsd.org*" +dragonflybsd.org/kernel "List-Id" "*kernel.dragonflybsd.org*" +ebay.com "From" "*ebay.*" +epitech.eu/bde "From" "*bde.epitech.rennes@gmail.com*" +epitech.eu/intra "From" "*@intra.epitech.eu*" +epitech.eu/marvin "From" "*nao.marvin@epitech.eu*" +epitech.eu/@ "From" "*@epitech.eu*" +epitech.eu/@ "From" "*ionis-group.org*" +free.fr "From" "*@free-mobile.fr*" +freebsd.org "From" "*freebsd.org*" +fsf.org "From" "*fsf.org*" +fosdem.org/distributions "List-Id" "*distributions-devroom.lists.fosdem.org*" +fosdem.org/network "List-Id" "*network-devroom.lists.fosdem.org*" +fosdem.org/announce "List-Id" "*fosdem.lists.fosdem.org*" +fosdem.org/security "List-Id" "*security-devroom.lists.fosdem.org*" +fosdem.org/@ "From" "*fosdem.org*" +gandi.net "From" "*gandi.net*" +github.com "From" "*github.com*" +gobolinux.org "List-Id" "*gobolinux.org*" +google.com "From" "*google.com*" +gopherproject.org "List-Id" "*gopher-project*" +grifon.fr "List-Id" "*grifon.fr*" +keybase.io "From" "*keybase.io*" +lobste.rs "From" "*@lobste.rs*" +netsukuku.freaknet.org "List-Id" "*netsukuku.lists.dyne.org*" +nixers.net "From" "*@nixers.net*" +noip.com "From" "*@noip.com*" +openbsd.org/advocacy "List-ID" "*advocacy.openbsd.org*" +openbsd.org/announce "List-ID" "*announce.openbsd.org*" +openbsd.org/tech "List-ID" "*tech.openbsd.org*" +paypal.com "From" "*paypal.*" +reddit.com "From" "*@reddit.*" +repo.or.cz "Subject" "*\[repo.or.cz\]*" +researchgate.net "From" "*@researchgate.*" +researchgate.net "From" "*@researchgatemail.*" +sabotage.tech "Mailing-List" "*sabotage*@lists.openwall.com*" +suckless.org "List-Id" "*suckless.org*" +transports "From" "*@captaintrain.com*" +transports "From" "*BlaBlaCar*" +transports "From" "*flixbus*" +transports "From" "*keolis.com*" +transports "From" "*megabus*" +transports "From" "*ouibus*" +transports "From" "*ouigo*" +transports "From" "*sncf.com*" +transports "From" "*oui.sncf*" +univ-rennes1.fr "List-Id" "*univ-rennes1.fr*" +wordpress.com "From" "*wordpress.com*" +yammer.com "From" "*yammer.com*" +youtube.com "From" "*youtube.com*" diff --git a/etc/sfeed b/etc/sfeed @@ -0,0 +1,4 @@ +dragonflydigest.com https://www.dragonflydigest.com/feed +codemadness.nl http://www.codemadness.nl/rss.xml +kernel.org http://kernel.org/kdist/rss.xml +xkcd.com http://xkcd.com/atom.xml diff --git a/pack/ffmpeg/build b/pack/ffmpeg/build @@ -0,0 +1,7 @@ +#!/bin/sh -e + +./configure --prefix="${OPT}" + +case $(uname) in (*BSD) make="gmake" ;; (*) make='make' ;; esac + +$make install