Skip to content

Instantly share code, notes, and snippets.

View bigcoster's full-sized avatar

Oleksandr Halkin bigcoster

View GitHub Profile
@martinsam16
martinsam16 / docker-wsl2.md
Last active October 12, 2025 05:09
How to install wsl2 ubuntu + docker + docker-compose

Activate wsl2

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

Install and Configure Ubuntu

@molinav
molinav / install-python.sh
Last active March 1, 2025 01:31
Install almost all Python environments on Ubuntu 20.04
#! /bin/bash
#
# Copyright (c) 2020 Víctor Molina García
# MIT License
#
# Script to install Python environments 2.6+ and 3.2+ using PyEnv
# and the installation steps for OpenSSL 1.0.2 mostly based on the
# information available in the following link:
# http://www.linuxfromscratch.org/blfs/view/7.7/postlfs/openssl.html
#
from fastapi import FastAPI, Depends, Query
from starlette.requests import Request
from starlette.responses import JSONResponse
import starlette.status
from pydantic import BaseModel, validator
import datetime
from typing import List
from dataclasses import dataclass, field
@mattwang44
mattwang44 / download_from_s3_async.py
Last active September 3, 2025 07:47
async download from AWS S3 using aiobotocore
import os
import asyncio
import aiobotocore
import io
from PIL import Image
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@mmrwoods
mmrwoods / postgres
Created January 20, 2012 13:47
Postgres maintenance crontab file
# dump all databases once every 24 hours
45 4 * * * root nice -n 19 su - postgres -c "pg_dumpall --clean" | gzip -9 > /var/local/backup/postgres/postgres_all.sql.gz
# vacuum all databases every night (full vacuum on Sunday night, lazy vacuum every other night)
45 3 * * 0 root nice -n 19 su - postgres -c "vacuumdb --all --full --analyze"
45 3 * * 1-6 root nice -n 19 su - postgres -c "vacuumdb --all --analyze --quiet"
# re-index all databases once a week
0 3 * * 0 root nice -n 19 su - postgres -c 'psql -t -c "select datname from pg_database order by datname;" | xargs -n 1 -I"{}" -- psql -U postgres {} -c "reindex database {};"'
@passos
passos / Dumper.py
Last active March 23, 2025 23:18
A perl Data.Dumper clone for Python
"""
A perl Data.Dumper clone for Python
Author: simon@log4think.com
2011-07-08
Copyright 2011 Jinyu LIU
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 substantial portions of the Software.