Skip to content

Instantly share code, notes, and snippets.

View S1M0N38's full-sized avatar
❄️

S1M0N38

❄️
View GitHub Profile
@S1M0N38
S1M0N38 / screen_grabber.py
Created April 25, 2017 08:09
MSS (written in pure python, working on windows, mac, linux) is capable to grab the screen at ~40 fps at 800x400 resolution.
import numpy as np
import cv2
import time
from mss import mss
from PIL import Image
'''Macbook have a bug about box's dimensions, can be just multiple of 16
but this bug will be fix soon in the next release'''
box = { "top": 10, "left": 10, "width": 400, "height": 320}
#!/bin/bash
# Change keyboard layout
sudo raspi-config
# Remove useless software
sudo apt-get remove --purge nodered -y
sudo apt-get remove --purge wolfram-engine -y
sudo apt-get remove --purge libreoffice* -y
sudo apt-get remove --purge scratch minecraft-pi -y
@S1M0N38
S1M0N38 / vpn.py
Last active May 30, 2018 20:24
CLI tool to connect to https://www.vpnbook.com
import argparse
import glob
import os
import subprocess
from bs4 import BeautifulSoup
import requests
import zipfile
BASE_URL = 'https://www.vpnbook.com/freevpn'
# API is not ready yet
import requests
token = 'put_token_here'
headers = {'Authorization': f'Token {token}'}
# events
url = 'https://againstallodds.me/api/events/england/premier_league/'
r = requests.get(url, headers=headers)
@S1M0N38
S1M0N38 / proverbs.py
Last active September 15, 2018 00:42
wisdom dispenser 🧙‍♂️
# -*- coding: utf-8 -*-
import random
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
url = 'https://raw.githubusercontent.com/AntJanus/programmers-proverbs/master/README.md'
response = urlopen(url)
@S1M0N38
S1M0N38 / openvpn.md
Last active March 4, 2023 13:42
Configuring Nord VPN using openvpn

Installations and downloads

Update the system and install openvpn and unzip

sudo apt update && sudo apt upgrade
sudo apt install openvpn
sudo apt install unzip

Now reboot the raspberry (this fix TUN/TAP error).

sudo reboot
@S1M0N38
S1M0N38 / morningstreams.py
Created August 23, 2022 10:19
Expose acestreams from morningstream in you local network
#!/usr/bin/env python3
"""
This content is not affiliated with, endorsed, sponsored, or specifically
approved by Morningstreams.
This is the simple script from where
https://github.com/S1M0N38/morningstreams originates.
MIT License
@S1M0N38
S1M0N38 / .vimrc
Created November 10, 2022 10:26
Minimal configuration for vim
" Improving on minimal vim configuration at
"
" https://github.com/lemonase/dotfiles/blob/
" ab2d279804a8a6b5e6862012c13bd22b64076431/
" config/vim/.vim/vimrc.min
"
"load system defaults
if filereadable(expand('$VIMRUNTIME/defaults.vim'))
unlet! g:skip_defaults_vim
@S1M0N38
S1M0N38 / Instructions.md
Created November 13, 2022 11:11
Setup GPG keys on MacOS
brew install gnupg pinentry-mac                    && \
mkdir $GNUPGHOME                                   && \
echo "pinentry-program /usr/local/bin/pinentry-mac" > \
     "$GNUPGHOME/gpg-agent.conf"
@S1M0N38
S1M0N38 / serve.py
Created October 7, 2023 11:00
dummy-ollama
import json
import time
app = Flask(__name__)
@app.route("/api/generate", methods=["POST"])
def generate_response():
assert request.json
model = request.json["model"]