cat ~/.netrc
machine github.com login <login-id> password <token-password>
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
#!/bin/bash | |
function set_refresh_rate(){ | |
xrandr -d :1 --output $1 --mode $2 --rate $3 | |
} | |
# update refresh rate for main monitor | |
set_refresh_rate DP-0 2560x1440 60.00 | |
sleep 0.5 | |
set_refresh_rate DP-0 2560x1440 164.96 |
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 numpy as np | |
import cv2 | |
import textwrap | |
img = np.zeros((500,500,3), dtype='uint8') | |
print(img.shape) | |
height, width, channel = img.shape | |
text_img = np.ones((height, width)) |
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 torch | |
import torchvision | |
from torchvision import transforms | |
from torch.utils.data import DataLoader | |
data_path = './Archive_jpg/' | |
transform_img = transforms.Compose([ | |
transforms.Resize((480, 640)), | |
# transforms.CenterCrop(256), |
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
# warning run every command one by one with precautions | |
# remove nvidia-docker | |
sudo apt-get purge -y docker-engine docker docker.io docker-ce -y | |
sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce -y | |
## remove unsed programs | |
sudo apt-get remove --purge libreoffice* -y | |
sudo apt-get remove libreoffice-core -y | |
sudo apt-get remove snapd lightdm cups chromium* -y |
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 redis | |
import fakeredis | |
import ujson | |
from contextlib import suppress | |
class RedisClient: | |
def __init__(self, host=None, port=6379, db=0, prefix='libtorrent'): | |
self.prefix = prefix | |
self.host = host |
from google.colab.output import eval_js
print(eval_js("google.colab.kernel.proxyPort(8000)"))
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
version: '3' | |
services: | |
api: | |
image: imneonizer/autolycus:api | |
container_name: autolycus_api | |
ports: | |
- 5000:5000 | |
volumes: | |
- ./downloads:/downloads |
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
#include <Wire.h> | |
#include <ESP8266WiFi.h> | |
const int MPU_addr = 0x68; // I2C address of the MPU-6050 | |
int16_t AcX, AcY, AcZ, Tmp, GyX, GyY, GyZ; | |
float ax = 0, ay = 0, az = 0, gx = 0, gy = 0, gz = 0, Amp=0; | |
// SCL -> D1 | |
// SDA -> D2 |
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
#!/usr/bin/env bash | |
START_TIME=$SECONDS | |
set -e | |
echo "-----START GENERATING HLS STREAM-----" | |
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME] | |
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1 | |
# comment/add lines here to control which renditions would be created | |
renditions=( |