From 02877167870245be0986a2bb8af984c9eb3dc1dd Mon Sep 17 00:00:00 2001 From: pdp8 Date: Sat, 3 Aug 2024 01:19:06 +0200 Subject: obsolete files removed --- music2social.rb | 33 --------------------------------- update-pictures.nu | 33 --------------------------------- 2 files changed, 66 deletions(-) delete mode 100755 music2social.rb delete mode 100755 update-pictures.nu diff --git a/music2social.rb b/music2social.rb deleted file mode 100755 index 97742bb..0000000 --- a/music2social.rb +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env ruby -require 'uri' -require 'json' - -Dir.chdir ARGV[0] -content = ['public', '', ''] -date, title = File.basename(ARGV[0]).split('_', 2) -title.gsub!('_', ' ') -content << title + ' LP' -content << File.read('README') -# content << '' -content << "https://pdp8.info/music.html\##{date}" -# content << '' -bc = if File.exist?('bandcamp') - File.read('bandcamp').chomp - else - "https://pdp8.bandcamp.com/album/#{title.gsub(' ', '-')}" - end -content << "Bandcamp: #{bc}" -content << '' -content << '#creativecommons #electronic #music #techno' -content << '==' -content << File.join("https://media.pdp8.info/music/#{File.basename ARGV[0]}", - 'cover.jpeg') + "\t" + `exiv2 -K Xmp.dc.description -P v cover.jpeg`.chomp.sub( - /^lang=\S+ /, '' - ) - -# Dir['*mp3'].each do |mp3| -# content << File.join("https://media.pdp8.info/music/#{File.basename ARGV[0]}", "#{File.basename mp3}") -# end -File.open('/tmp/content.txt', 'w+') { |f| f.puts content.join("\n") } -system 'hx /tmp/content.txt' -puts `curl -sb cookies.txt --data-binary @/tmp/content.txt -X POST https://social.pdp8.info/create` diff --git a/update-pictures.nu b/update-pictures.nu deleted file mode 100755 index 8d888f8..0000000 --- a/update-pictures.nu +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env nu - -$env.BORG_PASSPHRASE = (cat ~/.borg-sub2) -/etc/profiles/per-user/ch/bin/borg mount --last 1 ssh://u242757-sub2@u242757.your-storagebox.de:23/./borg ~/borg /home/ch/img - -do -i { # ensure that borg is unmounted to enable backups - let img_dir = ls ~/borg/*/home/ch/img | first | get name - let pub_dir = '/srv/media/pictures' - - cd $pub_dir - let published = (ls | get name) - cd $img_dir - # TODO overwrite modified images - # TODO add description - let all = (open motivs.json | where rating == 3 | get stack | each {|s| $s.0}) - let new = ($all | filter {|id| not ($id in $published) }) - print $new - cd backup - $new | each {|img| - let public = $'($pub_dir)/($img)' - echo $public - cp -uv $img $public - chmod u+w $public - # TODO add description - /etc/profiles/per-user/ch/bin/exiv2 rm $public - /etc/profiles/per-user/ch/bin/exiv2 -M "set Xmp.dc.creator pdp8@pdp8.info" -M "set Xmp.dc.rights © pdp8@pdp8.info" -M "set Xmp.dc.license http://creativecommons.org/licenses/by-sa/4.0/" -M "set Xmp.xmpRights.UsageTerms Creative Commons Attribution-ShareAlike 4.0 International License" -M "set Xmp.xmpRights.Marked True" -M "set Xmp.dc.description Original artwork available from pdp8@pdp8.info" $public - } - - cd /home/ch/src/publish/ - /home/ch/.nix-profile/bin/make www-pictures -} - -/run/wrappers/bin/umount ~/borg -- cgit v1.2.3