Skip to content

Instantly share code, notes, and snippets.

View allanrbo's full-sized avatar

Allan Boll allanrbo

  • Google
  • San Francisco
View GitHub Profile
@allanrbo
allanrbo / chatgpt.py
Created June 19, 2023 07:08
ChatGPT from your command line, without any library dependencies (API key required)
#!/usr/bin/python3
# Quick and dirty ChatGPT from your command line, without any library dependencies (API key required)
# End your input with a line consisting of just ---
# Stop generating with ctrl-c
from urllib.request import Request, urlopen
import json
messages = []
# Put this script in your crontab like so:
# 0 * * * * export DISPLAY=:1 ; python3 /home/your_username/Documents/what_am_i_doing/what_am_i_doing.py
from collections import OrderedDict
from tkinter import ttk
import datetime
import os.path
import psutil
import tkinter as tk
# with tigervnc client, none of the below is needed!
# following line was obtained with this command: cvt 3840 1200
xrandr --newmode "3840x1200" 386.75 3840 4104 4512 5184 1200 1203 1213 1245 -hsync +vsync
xrandr --addmode VNC-0 "3840x1200"
# To get into multi monitor mode
xrandr -s 3840x1200
xrandr --setmonitor VNC-0~1 1920/518x1200/324+0+0 VNC-0