Skip to content

Instantly share code, notes, and snippets.

@senecaso
senecaso / CopyLikes.md
Created May 5, 2023 23:42
YouTube Music: Copy liked music to a playlist

I was looking for a way to copy my "likes" in YouTube music over to a playlist, in the hopes of stopping YTM from losing songs I have liked. I found this script, but it didn't work for me, so I had to look for other solutions. In the end, this is what worked for me.

It's a small Python script that uses the YTMusic python library to copy tracks from my likes to a new playlist. I will try to outline the steps to run the script, but this will assume some familiarity with Python.

Hopefully this will work for others as well!

from ytmusicapi import YTMusic

yt = YTMusic('oauth.json')
@senecaso
senecaso / strace.log
Created March 21, 2017 03:08
sudo strace -tt -T -p $(ps aux | grep csgo_linux | grep -v grep | awk '{print $2;}') 2>&1 | grep '<[0-9]\+\.[0-9][1-9]\+>$'
19:58:55.054648 futex(0x7f7e60c3964c, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7f7e60c39648, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = -1 ENOSYS (Function not implemented) <0.011177>
19:59:05.683634 futex(0x7f7e0ba72020, FUTEX_WAKE_PRIVATE, 1) = -1 ENOSYS (Function not implemented) <0.011597>
19:59:06.327646 futex(0x7f7e60c39620, FUTEX_WAKE_PRIVATE, 1) = -1 ENOSYS (Function not implemented) <0.012235>
19:59:06.554432 futex(0x7f7dbbe15070, FUTEX_WAKE_PRIVATE, 1) = -1 ENOSYS (Function not implemented) <0.011155>
19:59:06.761508 futex(0x7f7e13625cb0, FUTEX_WAKE_PRIVATE, 1) = -1 ENOSYS (Function not implemented) <0.011721>
19:59:07.586778 recvfrom(38, 0x7ffc3c2b24f0, 9, 0, NULL, NULL) = -1 ENOSYS (Function not implemented) <0.011993>
19:59:08.269053 recvmsg(7, 0x7ffc3c2b3ee0, 0) = -1 ENOSYS (Function not implemented) <0.012879>
19:59:08.286435 futex(0x7f7dba382e70, FUTEX_WAKE_PRIVATE, 1) = -1 ENOSYS (Function not implemented) <0.011415>
19:59:08.433591 recvmsg(7, 0x7ffc3c2b3ee0, 0) = -1 ENOSYS (Function not implemented) <0.
@senecaso
senecaso / nvidia-smi.log
Created March 21, 2017 03:08
nvidia-smi --query-gpu="timestamp,pstate,temperature.gpu,utilization.gpu,utilization.memory,clocks_throttle_reasons.applications_clocks_setting,clocks_throttle_reasons.sw_power_cap,clocks_throttle_reasons.hw_slowdown,clocks_throttle_reasons.sync_boost,clocks_throttle_reasons.unknown,clocks.current.graphics,clocks.current.sm,clocks.current.memory…
timestamp, pstate, temperature.gpu, utilization.gpu [%], utilization.memory [%], clocks_throttle_reasons.applications_clocks_setting, clocks_throttle_reasons.sw_power_cap, clocks_throttle_reasons.hw_slowdown, clocks_throttle_reasons.sync_boost, clocks_throttle_reasons.unknown, clocks.current.graphics [MHz], clocks.current.sm [MHz], clocks.current.memory [MHz], clocks.current.video [MHz]
2017/03/20 19:58:43.613, P0, 67, 70 %, 32 %, Not Active, Not Active, Not Active, Not Active, Not Active, 144 MHz, 144 MHz, 4006 MHz, 122 MHz
2017/03/20 19:58:44.615, P0, 67, 68 %, 32 %, Not Active, Not Active, Not Active, Not Active, Not Active, 144 MHz, 144 MHz, 4006 MHz, 122 MHz
2017/03/20 19:58:45.616, P0, 67, 58 %, 28 %, Not Active, Not Active, Not Active, Not Active, Not Active, 144 MHz, 144 MHz, 4006 MHz, 122 MHz
2017/03/20 19:58:46.618, P0, 67, 61 %, 30 %, Not Active, Not Active, Not Active, Not Active, Not Active, 144 MHz, 144 MHz, 4006 MHz, 122 MHz
2017/03/20 19:58:47.619, P0, 67, 67 %, 32 %, Not Active, Not Active, N
@senecaso
senecaso / dstat.log
Created March 21, 2017 03:04
dstat -t -c -d -n
----system---- ----total-cpu-usage---- -dsk/total- -net/total-
time |usr sys idl wai hiq siq| read writ| recv send
20-03 19:58:43| 27 3 70 0 0 0| 0 36k| 0 0
20-03 19:58:44| 30 2 68 0 0 0| 0 0 | 0 0
20-03 19:58:45| 28 3 69 0 0 0| 0 0 | 0 0
20-03 19:58:46| 29 3 69 0 0 0| 0 0 | 0 0
20-03 19:58:47| 27 3 71 0 0 0| 0 0 | 70B 70B
20-03 19:58:48| 26 2 72 0 0 0| 0 0 | 0 0
20-03 19:58:49| 25 2 73 0 0 0| 0 0 | 0 130B
20-03 19:58:50| 25 3 72 0 0 0| 0 0 | 164B 130B
@senecaso
senecaso / gist:2b93edb8344ba43818e3c6241229977f
Created March 20, 2017 01:02
nvidia-smi output (nvidia-smi --query-gpu="timestamp,pstate,temperature.gpu,utilization.gpu,utilization.memory,clocks_throttle_reasons.applications_clocks_setting,clocks_throttle_reasons.sw_power_cap,clocks_throttle_reasons.hw_slowdown,clocks_throttle_reasons.sync_boost,clocks_throttle_reasons.unknown,clocks.current.graphics,clocks.current.sm,cl…
timestamp, pstate, temperature.gpu, utilization.gpu [%], utilization.memory [%], clocks_throttle_reasons.applications_clocks_setting, clocks_throttle_reasons.sw_power_cap, clocks_throttle_reasons.hw_slowdown, clocks_throttle_reasons.sync_boost, clocks_throttle_reasons.unknown, clocks.current.graphics [MHz], clocks.current.sm [MHz], clocks.current.memory [MHz], clocks.current.video [MHz]
2017/03/19 17:32:29.613, P0, 69, 68 %, 29 %, Not Active, Not Active, Not Active, Not Active, Not Active, 131 MHz, 131 MHz, 4006 MHz, 110 MHz
2017/03/19 17:32:30.615, P0, 69, 64 %, 28 %, Not Active, Not Active, Not Active, Not Active, Not Active, 131 MHz, 131 MHz, 4006 MHz, 110 MHz
2017/03/19 17:32:31.616, P0, 69, 65 %, 28 %, Not Active, Not Active, Not Active, Not Active, Not Active, 131 MHz, 131 MHz, 4006 MHz, 110 MHz
2017/03/19 17:32:32.618, P0, 69, 62 %, 27 %, Not Active, Not Active, Not Active, Not Active, Not Active, 131 MHz, 131 MHz, 4006 MHz, 110 MHz
2017/03/19 17:32:33.619, P0, 69, 52 %, 22 %, Not Active, Not Active, N
@senecaso
senecaso / gist:3f37de2cd60be81589d50c85d84ed066
Created March 20, 2017 01:00
dstat output when FPS in CS:GO drops (dstat -t -c -d -n)
----system---- ----total-cpu-usage---- -dsk/total- -net/total-
time |usr sys idl wai hiq siq| read writ| recv send
19-03 17:32:29| 28 1 71 0 0 0| 0 0 | 0 0
19-03 17:32:30| 29 1 70 0 0 0| 0 72k|3942B 6925B
19-03 17:32:31| 26 2 72 0 0 0| 0 0 | 0 0
19-03 17:32:32| 25 1 74 0 0 0| 0 0 | 0 0
19-03 17:32:33| 26 1 72 0 0 0| 0 0 | 0 0
19-03 17:32:34| 27 2 71 0 0 0| 0 0 | 0 0
19-03 17:32:35| 26 1 73 0 0 0| 0 0 | 0 130B
19-03 17:32:36| 26 1 72 0 0 0| 0 0 | 70B 70B
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
CPU Family: 0x6