diff --git a/bell/bell.sh b/bell/bell.sh new file mode 100755 index 0000000..e206dea --- /dev/null +++ b/bell/bell.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +xbacklight -set 0 +xbacklight -set 100 diff --git a/moodle-epub-downloader/README.md b/moodle-epub-downloader/README.md new file mode 100644 index 0000000..5323b3f --- /dev/null +++ b/moodle-epub-downloader/README.md @@ -0,0 +1 @@ +xsxs diff --git a/moodle-epub-downloader/opf-downloader.py b/moodle-epub-downloader/opf-downloader.py new file mode 100644 index 0000000..ed577bd --- /dev/null +++ b/moodle-epub-downloader/opf-downloader.py @@ -0,0 +1,10 @@ +from xml.etree import ElementTree as ET + +tree = ET.parse('package.opf') +root = tree.getroot() +ns = {'opf': 'http://www.idpf.org/2007/opf'} +manifest = root.find('opf:manifest', ns) +base_url = "" + +for item in manifest.findall('opf:item', ns): + print(base_url+item.attrib['href']) diff --git a/mumble-bot/bot.py b/mumble-bot/bot.py new file mode 100644 index 0000000..327e198 --- /dev/null +++ b/mumble-bot/bot.py @@ -0,0 +1,42 @@ +import shout +import pymumble_py3 as pymumble +from pymumble_py3.callbacks import PYMUMBLE_CLBK_SOUNDRECEIVED as PCS +import subprocess as sp +from time import sleep +import sys +import os +import fcntl +import pyaudio + +pwd = "" # password +server = "mumble.esiliati.org" # server address +nick = "TubiaBot" +channel = "chiacchiere" +port = 64738 # port number + +# pyaudio set up +CHUNK = 1024 +FORMAT = pyaudio.paInt16 # pymumble soundchunk.pcm is 16 bits +CHANNELS = 1 +RATE = 48000 # pymumble soundchunk.pcm is 48000Hz + +# mumble client set up +def sound_received_handler(user, soundchunk): + """ play sound received from mumble server upon its arrival """ + sys.stdout.buffer.write(soundchunk.pcm) + + +# Spin up a client and connect to mumble server +mumble = pymumble.Mumble(server, nick, password=pwd, port=port) +# set up callback called when PCS event occurs +mumble.callbacks.set_callback(PCS, sound_received_handler) +mumble.set_receive_sound(1) # Enable receiving sound from mumble server +mumble.start() +mumble.is_ready() # Wait for client is ready +mumble.channels.find_by_name("radiospore").move_in() +mumble.users.myself.mute() + +# constant capturing sound and sending it to mumble server + +while True: + sleep(0.1) diff --git a/surveymonkey-bot/bot.sh b/surveymonkey-bot/bot.sh new file mode 100755 index 0000000..07dd616 --- /dev/null +++ b/surveymonkey-bot/bot.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# pew pew pew +# per farlo martellare, da root +# while true; do torsocks ./bot.sh; kill -HUP $(pidof tor); sleep 1; done +tempfile=$(mktemp) +cookie_jar=$(mktemp) +user_agent="User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" +survey_url="https://it.surveymonkey.com/r/LYCK7TZ" +curl --silent $survey_url -o $tempfile -c $cookie_jar +survey_data=$(cat $tempfile | grep survey_data | sed 's/ /\n/g' | grep value | cut -d '"' -f 2) +curl --silent -L -c $cookie_jar -H "$user_agent" -F "324391492=2147689223" -F "324391492_other=XM24" -F "survey_data=$survey_data" -F "is_previous=false" -F "disable_survey_buttons_on_submit=" 'https://it.surveymonkey.com/r/LYCK7TZ' | grep -E "(thanks-message|error-id)" | cut -d ">" -f 2 | cut -d '<' -f 1 +rm $tempfile $cookie_jar