Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

cob_258 cobrce

🏠
Working from home
View GitHub Profile
@cobrce
cobrce / right_button.py
Created Apr 3, 2021
use interception_py to presse right button in the center of the screen
View right_button.py
from interception import *
from win32api import GetSystemMetrics
# get screen size
screen_width = GetSystemMetrics(0)
screen_height = GetSystemMetrics(1)
# create a context for interception to use to send strokes, in this case
# we won't use filters, we will manually search for the first found mouse
context = interception()
@cobrce
cobrce / sonarrp.py
Created Mar 14, 2021
Script for qbittorrent, monitors a category of torrents (in this case tv-sonarr) and put them at the top of the queue, it uses python-qbittorrent module
View sonarrp.py
from time import sleep
from qbittorrent import Client #pip3 install python-qbittorrent
link = "http://127.0.0.1:8080"
username = "admin"
password = "admin"
category = "tv-sonarr"
def main():
while True:
@cobrce
cobrce / jackett_docker_script.sh
Created Feb 3, 2021
install docker + jackett image on raspberry pi
View jackett_docker_script.sh
curl -sSL https://get.docker.com | sh
sudo pip3 install docker-compose
cat << EOF > docker-compose.yml
---
version: "2"
services:
jackett:
image: linuxserver/jackett
container_name: jackett
environment:
@cobrce
cobrce / sonarr_script.sh
Last active Feb 3, 2021
install+autostart sonarr 2 in raspberry pi
View sonarr_script.sh
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0xA236C58F409091A18ACA53CBEBFF6B99D9B78493
echo "deb http://apt.sonarr.tv/ master main" | sudo tee /etc/apt/sources.list.d/sonarr.list
sudo apt update
sudo apt install nzbdrone -y
sudo cat << EOF > /etc/systemd/system/sonarr.service
[Unit]
Description=Sonarr Daemon
After=network.target
@cobrce
cobrce / radarr_script.sh
Last active Feb 3, 2021
install + autostart radarr 3 in raspberry pi
View radarr_script.sh
wget 'https://radarr.servarr.com/v1/update/master/updatefile?os=linux&runtime=netcore&arch=arm' --output-document=radarr.tar.gz
sudo tar -xvzf radarr.tar.gz
sudo mkdir /opt/radarr
sudo cp Radarr/* /opt/radarr -r
sudo rm Radarr -r
sudo chown pi:pi -R /opt/radarr
sudo cat << EOF > /etc/systemd/system/radarr.service
[Unit]
Description=Radarr
After=network.target
@cobrce
cobrce / qbittorrent_script.sh
Created Feb 3, 2021
install+autostart qbittorrent-nox in raspberry pi
View qbittorrent_script.sh
sudo apt install qbittorrent-nox -y
sudo cat << EOF > /etc/systemd/system/qbittorrent.service
[Unit]
Description=qBittorrent
After=network.target
[Service]
Type=forking
User=pi
Group=pi
@cobrce
cobrce / skip.lua
Created Apr 26, 2020
script for mpv player to skip automatically parts of a media file
View skip.lua
[[--
this is a script for mpv player, it's purpose is to skip automatically parts of a media file
how does it work:
- install this script in mpv scripts directory
- let's say you wan't to skip from position 300s to 310s and from 5001 to 5020 in a file called movie.mp4,
- in it's directory create a file called movie.txt that contains the following lines
300,310
5001,5020
- open movie.mp4 in mpv
- enjoy
@cobrce
cobrce / ngrok_gkeep.py
Last active Apr 9, 2020
a script to run ngrok with selected profiles (tunnels) then update a google keep note with the created urls, useful when setting ngrok in autostart (I use crontab -e)
View ngrok_gkeep.py
import subprocess
import requests
import json
import time
import gkeepapi as g
import re
import arc4
import hashlib
@cobrce
cobrce / Serial.cs
Created Jul 21, 2019
Enumerate serial ports and descriptions in Windows, this is a port of serial.tools.list_ports.comports from python to C# (original file https://github.com/pyserial/pyserial/blob/master/serial/tools/list_ports_windows.py)
View Serial.cs
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
@cobrce
cobrce / HiddenForm.cs
Created Jan 26, 2019
form using RawInput and Hook to block keys from specific device
View HiddenForm.cs
using RawInput_dll;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace RFID.Redir.lib
{
public partial class HiddenForm : Form
{