Skip to content

Instantly share code, notes, and snippets.

View Ceesaxp's full-sized avatar
💻
I may be slow to respond.

Andrei Popov Ceesaxp

💻
I may be slow to respond.
View GitHub Profile
@Ceesaxp
Ceesaxp / microgpt.py
Created February 19, 2026 21:45 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp

Docker on Lima (lima-vm/lima) Setup Guide

In recent months, Lima has become de facto standard software as a free and open source alternative to Docker Desktop for Mac. Several projects (such as Colima, Rancher Desktop, or Finch) for similar purpose also uses Lima as their backend. These projects will make it easier to set up Lima. But some people may not want to introduce extra components other than Lima. This guide will show you how to set up Lima to be alternative to Docker Desktop for Mac, while using Lima only.

🪣 Note. It is a good practice to uninstall Docker Desktop for Mac before proceeding with the following steps.

1. Install Lima and Docker CLI

Lima Cheatsheet for macOS

I stumbled on an incredible open source solution, Lima. In some ways, it has some of Hashicorp's Vagrant's resemblance, but in my opinion, it's so much superior in many ways as it doesn't use external dependencies such as Oracle's VirtualBox.

If you're used to docker on the command line but wanted to play with VMs rather than containers, then this is for you! No need to fuss with cloud-init as a user account (using your existing username in whoami) with a proper home directory would be auto-generated for you with full passwordless sudo privilege. SSH access to the VMs from the host is seamlessly integrated as well.

This quick guide is for those who need to set up virtual machines with modern Linux OSes (only few selected OSes are best supported) from scratch using only the command line. You can have a VM up and running within minutes from absolutely nothing.

NOTE: This was last tested using:

  • `lima
@Ceesaxp
Ceesaxp / safari-summary.sh
Created April 17, 2024 19:23 — forked from umputun/safari-summary.sh
Raycast script for Safari's page summary
#!/bin/sh
# @raycast.schemaVersion 1
# @raycast.title Summarize Safari page
# @raycast.mode fullOutput
#
# Optional parameters:
# @raycast.icon ✨
#
# @raycast.packageName Things
@Ceesaxp
Ceesaxp / safari-summary.sh
Created April 17, 2024 19:23 — forked from umputun/safari-summary.sh
Raycast script for Safari's page summary
#!/bin/sh
# @raycast.schemaVersion 1
# @raycast.title Summarize Safari page
# @raycast.mode fullOutput
#
# Optional parameters:
# @raycast.icon ✨
#
# @raycast.packageName Things
@Ceesaxp
Ceesaxp / Makefile
Created June 2, 2023 12:56 — forked from thomaspoignant/Makefile
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@Ceesaxp
Ceesaxp / gist:14e655fd5336f6bb1abb6ae2fc3f577a
Created July 1, 2021 08:34 — forked from Moligaloo/gist:3850710
Send mail with attachment and signature via AppleScript in OS X
tell application "Mail"
set theSubject to "Subject" -- the subject
set theContent to "Content" -- the content
set theAddress to "xxx@163.com" -- the receiver
set theSignatureName to "signature_name"-- the signature name
set theAttachmentFile to "Macintosh HD:Users:moligaloo:Downloads:attachment.pdf" -- the attachment path
set msg to make new outgoing message with properties {subject: theSubject, content: theContent, visible:true}
@Ceesaxp
Ceesaxp / whatsapp2slack.py
Last active June 12, 2021 10:48 — forked from onekiloparsec/whatsapp2slack.py
Quick import-export script to move WhatsApp discussion threads to Slack.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import datetime
import re
import traceback
@Ceesaxp
Ceesaxp / update-hosts.sh
Created April 23, 2021 10:56 — forked from Eliastik/update-hosts.sh
A quick shell script that will automatically update a Linux HOSTS file to block domains (ads, malwares, ...). Support multiple hosts sources, initial host file and incorrect/malicious entries checking.
#!/bin/bash
# Filename: update-hosts.sh
#
# Author: George Lesica <george@lesica.com>
# Enhanced by Eliastik ( eliastiksofts.com/contact )
# Version 1.3 (22 april 2021) - Eliastik
#
# Description: Replaces the HOSTS file with hosts lists from Internet,
# creating a backup of the old file. Can be used as an update script.
@Ceesaxp
Ceesaxp / itunes.sh
Last active July 19, 2020 07:50 — forked from rkumar/itunes.sh
control iTunes from command line
#!/bin/bash
#
####################################
# iTunes Command Line Control v1.0
# written by David Schlosnagle
# created 2001.11.08
# edit 2010.06.01 rahul kumar
# edit 2020.07.19 andrei popov
####################################