7 Commits 8bccdb4001 ... 83bfa6bd8d

Author SHA1 Message Date
  Jeff Cliff 83bfa6bd8d Merge https://notabug.org/themusicgod1/tools 5 months ago
  Jeff Cliff 9a77da8b8c preliminary scrobble proof of concept from @moon@shitposter.club 5 months ago
  Jeff Cliff 49802f9b04 Henry Ford called for stuff like this. it doesn't work, but it's a good try. 6 months ago
  Jeff Cliff 187b495c9b torbrowser runme script 6 months ago
  Jeff Cliff 77dca901eb deal with fediverse users script 9 months ago
  Jeff Cliff a25bc137e8 mktemp 9 months ago
  Jeff Cliff c4b96bf9a4 bashrc update 10 months ago
6 changed files with 156 additions and 23 deletions
  1. 12 1
      .bashrc
  2. 55 0
      deal_with_users.sh
  3. 27 22
      did-I-read-this
  4. 11 0
      is-jewish
  5. 19 0
      scrobble-me.sh
  6. 32 0
      torbrowser-runme.sh

+ 12 - 1
.bashrc

@@ -19,6 +19,13 @@
 HOME=/home/themusicgod1
 DEBEMAIL=jeffrey.cliff@gmail.com
 DEBFULLNAME="Jeff Cliff"
+## mc related
+# apt-get install mc to get mc
+export HISTCONTROL=ignoreboth
+. /usr/lib/mc/mc.sh
+
+alias time=/usr/bin/time
+
 # ~/.bashrc: executed by bash(1) for non-login shells.
 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
 # for examples
@@ -104,7 +111,8 @@ if [ -x /usr/bin/dircolors ]; then
     alias egrep='egrep --color=auto'
 fi
 
-# some more ls aliases
+# some more aliases
+alias pls='sudo'
 alias x='exit'
 alias l='ls'
 alias c='cd'
@@ -124,6 +132,9 @@ alias unsafe-browser='chromium-browser'
 alias man='man -s 2,9,8,1,4,5,6,7,3 '
 alias push='git push'
 
+#this is the fastest shaw/eva's shitty network can handle
+alias scp='scp -l 49972'
+
 # Add an "alert" alias for long running commands.  Use like so:
 #   sleep 10; alert
 alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

+ 55 - 0
deal_with_users.sh

@@ -0,0 +1,55 @@
+#!/bin/bash
+BASEDIR=/home/themusicgod1
+DBDIR=/home/themusicgod1/TDL
+# 0. generate databases.db
+
+# 1.
+#sqlite3 database.db -line "select url from statuses;"  | grep url | awk -F' ' '{print $3}'| awk -F'/' '{print $2"@" $1}' | sort | uniq > users.txt
+# get users script in aspublic
+
+# 2. move users to eva
+
+# 3.
+cat users.txt | grep -iv '@.*@.*' > users_malformatted.txt
+
+# 4.
+
+cat users_malformatted.txt | awk -F' ' '{print "@"$1}' >> users2.txt
+cat users.txt | grep -i '@.*@.*' >> users2.txt
+mv users2.txt users.txt
+
+
+for x in `cat users.txt`; do howFar.sh $x | grep -i update | grep -iv 'insert' | grep -iv '@';  done;
+#these i think can be just dropped in, no harm if they are dupes
+
+echo "done. press enter or something";
+read ;
+
+for x in `cat users.txt`; do LINEME=`howFar.sh $x | grep -i insert `; echo $LINEME; sqlite3 ~/TDL/urls.db -line "$LINEME";  done
+#what we should do next is do some kind of error checking instead of sleep here - print OK if success
+
+#todo: make this dependent on max value
+#or make it 100?
+MAXLEVEL=`grep -i "maximum" $BASEDIR/tools/grabLaundry.sh |  awk -F' ' '{print $3}' | awk -F')' '{print $1}'`".0"
+
+echo "selecting url from news where level > $MAXLEVEL; ..."
+
+
+sqlite3 $DBDIR/urls.db -line "select url from news where level > $MAXLEVEL;"
+
+echo "put that into followme.txt"
+#we shoudl automate this
+
+# should print out the username of anyone this fails with in a greppable way
+# there's an issue in this with spc deal with spc users
+
+echo "when done. press enter or something";
+read ;
+
+for x in `cat followme.txt`; do echo $x; toot follow $x; sleep 2; done;
+
+
+check_for_banned_from_spc.sh
+
+
+echo "delete from news where level > $MAXLEVEL;"

+ 27 - 22
did-I-read-this

@@ -1,28 +1,33 @@
 #!/bin/bash
-MEMEDIR=/mnt/disk5/meme
+MEMEDIR=/mnt/disk/meme
 STERM='"'"${@:1}"'"'
-TMPFILE=`tempfile`
+TMPFILE=`mktemp`
+
+
 echo grep -i $STERM $MEMEDIR/1990s -r >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/0/2/booksread >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/0/3/booksread.txt >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/0/5/booksread >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/0/6/books-read-2006 >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/0/7/books-read-2007 >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/0/8/booksread >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/0/9/booksread >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/1/0/booksread >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/1/1/booksread >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/1/2/booksread >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/1/3/alreadyread.txt >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/1/4/alreadyread.txt >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/1/5/alreadyread.txt >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/1/6/alreadyread.txt >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/1/7/alreadyread.txt >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/1/8/alreadyread.txt >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/1/9/alreadyread.txt >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/2/0/alreadyread.txt >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/2/1/alreadyread.txt >> $TMPFILE
-echo grep -i $STERM $MEMEDIR/20/2/2/alreadyread.txt >> $TMPFILE
+echo grep -i $STERM $MEMEDIR/*/*/*/{booksread,booksread.txt,books-read-*,alreadyread.txt} >> $TMPFILE
+echo grep -i $STERM /home/themusicgod1/alreadyread.txt >> $TMPFILE
+
+#echo grep -i $STERM $MEMEDIR/20/0/3/booksread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/0/5/booksread >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/0/6/books-read-2006 >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/0/7/books-read-2007 >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/0/8/booksread >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/0/9/booksread >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/1/0/booksread >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/1/1/booksread >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/1/2/booksread >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/1/3/alreadyread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/1/4/alreadyread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/1/5/alreadyread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/1/6/alreadyread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/1/7/alreadyread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/1/8/alreadyread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/1/9/alreadyread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/2/0/alreadyread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/2/1/alreadyread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/2/2/alreadyread.txt >> $TMPFILE
+#echo grep -i $STERM $MEMEDIR/20/2/3/alreadyread.txt >> $TMPFILE
 
 chmod 755 $TMPFILE
 $TMPFILE

+ 11 - 0
is-jewish

@@ -0,0 +1,11 @@
+#!/usr/bin/php
+# CC 4.0 BY @istvan@noagendasocial.com
+<?php
+// enable allow_url_fopen in php.ini
+$name = $argv[1];
+$early_life = file_get_contents("https://en.wikipedia.org/w/api.php?action=parse&format=json&page=$name&prop=wikitext&section=1&disabletoc=1");
+if(stripos($early_life, "jew"))
+  echo "(((".$name.")))";
+else
+  echo $name;
+?>

+ 19 - 0
scrobble-me.sh

@@ -0,0 +1,19 @@
+#!/bin/bash
+HOME=/home/themusicgod1
+INSTANCE=shitposter.club
+echo "TITLE:" 
+read TITLE;
+echo "ARTIST:"
+read ARTIST;
+echo "ALBUM:"
+read ALBUM;
+echo "TOKEN:"
+TOKEN=`cat $HOME/.config/toot/config.json |  grep access_token | awk -F':' '{print $2}' | awk -F'"' '{print $2}'`
+#echo $TOKEN
+#echo $ARTIST " " $TITLE " " $ALBUM
+curl -X POST \
+	-d "title=$TITLE " \
+	-d "album=$ALBUM " \
+	-d "artist=$ARTIST " \
+	-H 'Authorization: Bearer '$TOKEN \
+	https://$INSTANCE/api/v1/pleroma/scrobble

+ 32 - 0
torbrowser-runme.sh

@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# PUT ME IN the tor browser directory (ie the one with start-tor-browser) 
+# and chmod 755 runtorbrowser.sh
+# see https://tor.stackexchange.com/questions/21752/external-links-do-not-open-on-tor-browser
+# https://gitlab.torproject.org/legacy/trac/-/issues/12763
+# https://gitlab.torproject.org/legacy/trac/-/issues/29254
+
+# NOTE
+
+# this adds a new kind of risk to your computer - ordinarily, if you have firefox and tor browser installed
+# and you do not have tor browser as your default  web browser, if someone pops an app / program into your computer that 
+# can execute firefox, the vanilla firefox will be executed (ie they can't learn about your tor identity)
+# but if you *do* have tor browser installed as your default browser, this happens anyway
+
+# basically if you just use tor browser as a casual user, don't use this script - but if you use it all the time, anyway by default
+# it doesn't open up your risk surface *too* much
+
+# however it DOES increase the risk surface, exposing functionality that is not usually used with tor browser: 'remote' firefox sessions
+# ie being able to open up multiple instances of firefox at the same time.
+# of course in the modern day we call those "tabs" - many users use more than one tab at a time but if you're one of those weirdos
+# who does not use more than one tab at once typically, then perhaps you shouldn't use this script either or do your own vetting for it
+
+FOLDER=$(dirname $0)
+#echo $FOLDER
+#echo $FOLDER/start-tor-browser --allow-remote $@
+
+#echo sleep...
+#sleep 1;
+
+$FOLDER/start-tor-browser --allow-remote $@ &
+