This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd / | |
umount /sys/firmware/efi/efivars/ | |
mount -t efivarfs rw /sys/firmware/efi/efivars/ | |
cd /sys/firmware/efi/efivars/ | |
rm gpu-power-prefs-… | |
sudo su | |
printf "\x07\x00\x00\x00\x01\x00\x00\x00" > gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9 | |
chattr +i "gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9" | |
cd / | |
umount /sys/firmware/efi/efivars/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import time | |
from queue import Empty, Queue | |
from threading import Thread | |
max_product = 10 | |
cur_product = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import time | |
from queue import Queue | |
from threading import Thread | |
def produce(queue): | |
nums = range(5) | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""To run multiple aiohttp instances concurrently. | |
code snippets I found online all create a list tasks to run, | |
but my example file abc.csv is too big, and contains 10 million rows, | |
which cannot fit into limited memory on a AWS ec2.micro instance, | |
so I use a global generator instead, to feed task dynamically. | |
requires python version 3.6.4 for f string to work. | |
""" |