6 ms·
Brute-force solution: save this as spotify-fixer.py, run it as cron job: #!/usr/bin/python target = "/Applications/Spotify.app/Contents/MacOS/Spotify" w
by philipkglass 10y ago
Brute-force solution: save this as spotify-fixer.py, run it as cron job:
#!/usr/bin/python
target = "/Applications/Spotify.app/Contents/MacOS/Spotify"
with open(target) as infile:
bytes = infile.read()
with open("./Spotify", "wb") as backup:
backup.write(bytes)
fixed = bytes.replace("VACUUM;", "xxxxxx;")
with open (target, "wb") as outfile:
outfile.write(fixed)
- toomuchtodo 10y ago[retracted] Thanks logicallee! I definitely need to be more judicious about time management, so I appreciated your comment!
- logicallee 10y agodude. stop. the reason your username is "toomuchtodo" is shit like this. Just do it RIGHT NOW, or don't do it. It's not that important. Delete that stupid bookmark. Just because something could be fun to do if you didn't have anythign else to do and were bored out of your mind, doesn't mean it's worth doing, ever.
- mynameisvlad 10y agoIs the vitrol really necessary? How does what a complete stranger decides to do in their spare time affect you in any way shape or form?
- smhost 10y agoI think it's more tough love than it is vitriol.
- toomuchtodo 10y ago> I think it's more tough love That's how I took it.
- logicallee 10y agoyeah
- philipkglass 10y agoIf you're on a Mac you have python already. Just save it somewhere and curl pipe it to python.
- 45h34jh53k4j 10y agoNo No No, please do not encourage people to do this. Curl pipe is a horrible anti security pattern and you are encouraging people to be irresponsible with patching binaries from the internet.
- dguaraglia 10y agoThe weird thing is talking about "curl pipe"ing into Python when you have a local copy? Wha?
- philipkglass 10y agoThe now-retracted comment talked about rewriting the Python into a shell script that you could toss on a web server and curl-pipe to run. I was pointing out that you can curl-pipe the original Python without rewriting it as shell.
- Someone 10y agoIf you do that, go the extra mile and schedule a (weekly or so) job to vacuum that database. Also, since you are on a Mac, I would use launchd jobs and make it less brute-force by scheduling the job changing the file on writes to the Applications/Spotify.app/Contents/MacOS/ directory.
- tdkl 10y agoIt's beyond me, why doesn't Spotify do exactly the same thing instead of overusing the VACUUM command.
- unhammer 10y agoOn Ubuntu/Debian, it might make sense to run it after each apt-get: $ cat /usr/local/bin/spotify-turn-off-vacuum #!/usr/bin/env python2 target = "/usr/bin/spotify" with open(target) as infile: bytes = infile.read() with open(target+".bak", "wb") as backup: backup.write(bytes) fixed = bytes.replace("VACUUM;", "xxxxxx;") with open (target, "wb") as outfile: outfile.write(fixed) $ cat /etc/apt/apt.conf.d/99spotify-turn-off-vacuum DPkg::Post-Invoke {"/usr/local/bin/spotify-turn-off-vacuum";};