https://www.linuxfordevices.com/tutorials/ubuntu/remove-an-apt-repository-ubuntu
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
# 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 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 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 socket | |
from contextlib import closing | |
from concurrent.futures import ThreadPoolExecutor | |
from itertools import product | |
class Portsi: | |
def __init__(self, timeout: float = 2.0, workers: int = 1000): | |
"""Portsi is used to scan network for open ports | |
Args: |
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 | |
export ANDROID_SERIAL=`adb devices -l | grep -i oneplus | awk '{print $1}'` | |
droidcam-cli adb 4747& | |
scrcpy |
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
# pip install paho-mqtt | |
import paho.mqtt.client as paho | |
import paho.mqtt.subscribe as subscribe | |
import uuid | |
import contextlib | |
import threading | |
import json | |
import time | |
class MQTTClient: |
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
# https://stackoverflow.com/questions/59025321/capture-jpeg-images-from-rtsp-gstreamer | |
gst-launch-1.0 rtspsrc location="rtsp://admin:123456@192.168.0.123/stream0" num-buffers=1 \ | |
! rtph264depay ! avdec_h264 \ | |
! nvjpegenc ! multifilesink location="./frame.jpg" |
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 colorsys | |
def generate_colors(n): | |
random.seed(10101) | |
hsv_tuples = [(x / n, 1., 1.) for x in range(n)] | |
colors = list(map(lambda x: colorsys.hsv_to_rgb(*x), hsv_tuples)) | |
colors = list(map(lambda x: (int(x[0] * 255), int(x[1] * 255), int(x[2] * 255)), colors)) | |
random.shuffle(colors) | |
random.seed(None) |
1. Stop the docker daemon
sudo service docker stop
2. Add a configuration file to tell the docker daemon what is the location of the data directory
Using your preferred text editor add a file named daemon.json
under the directory /etc/docker
.
sudo vim /etc/docker/daemon.json
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
# https://github.com/yogin16/prototxt_parser | |
# pip install parsy==1.3.0 | |
from parsy import generate, regex, string | |
# Convert an array of tuples array [[(a,b),(a,c)]] to an object {a: [b,c]} | |
def tuples_to_dict(a): | |
# print(a) | |
new_dict = {} | |
for tuples in a: |