Skip to content

Instantly share code, notes, and snippets.

View Aeron's full-sized avatar
🚀

Eugene Glybin Aeron

🚀
View GitHub Profile
@LeZuse
LeZuse / howto.md
Last active July 5, 2023 07:52
Disable Docker for Mac auto-update

Docker downloads all updates into a directory in /Users/$USER/Library/Caches/com.docker.docker/org.sparkle-project.Sparkle Let's make this directory inaccessible to the user under which Docker is going to run (you).

Switch to root user:

  sudo su

Change directory ownership and prevent access to other users:

@dmontagu
dmontagu / fastapi_cbv.py
Last active May 2, 2024 03:24
FastAPI CBV
import inspect
from typing import Any, Callable, List, Type, TypeVar, Union, get_type_hints
from fastapi import APIRouter, Depends
from pydantic.typing import is_classvar
from starlette.routing import Route, WebSocketRoute
T = TypeVar("T")
CBV_CLASS_KEY = "__cbv_class__"
@MrTrustor
MrTrustor / clean-docker-for-mac.sh
Last active November 21, 2023 11:38
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active February 21, 2024 03:02
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@perj
perj / vpn.sh
Created February 16, 2016 21:20
#!/bin/bash
# Copyright 2016 Per Johansson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@shmup
shmup / torrents.md
Last active April 11, 2024 10:03
transmission blocklist guide

Transmission Blocklist

The Transmission torrent client has an option to set a Blocklist, which helps protect you from getting caught and having the DMCA send a letter/email.

It's as simple as downloading and installing the latest client:

@reinhrst
reinhrst / server.py
Last active February 26, 2016 15:18
Tornado async testing framework with asyncio and using your own server options
import tornado.web
import tornado.httpserver
def make_app():
app = tornado.web.Application(
[(r"/.*", PageHandler)],
debug=tornado.options.options.serverdebug,
cookie_secret=config.COOKIE_SECRET,
compress_response=True)
return app
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active May 6, 2024 04:53
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@ryanpcmcquen
ryanpcmcquen / .osx
Last active February 12, 2024 01:22
.osx
#!/usr/bin/env bash
# curl -o ~/.osx https://gist.githubusercontent.com/ryanpcmcquen/b2e608311f286a4ab3e1/raw/.osx && bash ~/.osx
###############################################################################
# General UI/UX #
###############################################################################
# Disable smart dashes as they’re annoying when typing code.
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false