cat ~/.netrc
machine github.com login <login-id> password <token-password>
This file contains hidden or 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 | |
| export ANDROID_SERIAL=`adb devices -l | grep -i oneplus | awk '{print $1}'` | |
| export HOST_PORT=8080 | |
| export IPWEBCAM_PORT=8080 | |
| export V4L2_DEVICE=/dev/video0 | |
| function start_screen_mirror(){ | |
| if [ ! `pgrep scrcpy` ];then |
This file contains hidden or 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 hidden or 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 | |
| # https://itsfoss.com/speed-up-slow-wifi-connection-ubuntu/ | |
| # increase wifi adapter power | |
| # sudo iwconfig | |
| sudo iwconfig wlo1 power off |
This file contains hidden or 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
| # https://gist.github.com/Lazza/bbc15561b65c16db8ca8 | |
| import os | |
| import requests | |
| import base64 | |
| import time | |
| import subprocess as sp | |
| class VpnGate: | |
| def __init__(self, country, config='/tmp/vpngate.ovpn'): |
This file contains hidden or 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 |
from google.colab.output import eval_js
print(eval_js("google.colab.kernel.proxyPort(8000)"))
This file contains hidden or 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 |
This file contains hidden or 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), |
Install aria2c:
sudo apt install aria2 -y
Use below command to utilize full bandwidth:
aria2c --file-allocation=none -c -x 10 -s 10 -d "mydir" URL --check-certificate=false
-c allows continuation of download if it gets interrupted, -x 10 and -s 10 allow up to 10 connections per server, and -d "mydir" outputs file to directory mydir.