Skip to content

Instantly share code, notes, and snippets.

@orange888
orange888 / install-docker.sh
Created April 8, 2020 21:32 — forked from sethbergman/install-docker.sh
Install Docker CE on Linux Mint 19
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@orange888
orange888 / ffmpeg.md
Created April 4, 2020 12:57 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@orange888
orange888 / docker-compose.yml
Created March 29, 2020 11:10
gitea 1.10, drone 1.6 and drone-runner-docker example using docker-compose
# Instructions
# 1. Update your /etc/hosts file...
# > 127.0.0.1 gitea drone
# 2. Run gitea + gitea-db and generate the oauth application
# > docker-compose -p gitea-drone up gitea gitea-db
# - Navigate to http://gitea:3000 to finish the installation and register a user
# - Create a oauth application as described here: https://docs.drone.io/installation/providers/gitea/
# - Set the Redirect uri to http://drone:8000/login
# 3. Update the docker-compose file with the client_id and client_secret
# 4. Fire up all of the services
@orange888
orange888 / Caddyfile
Created March 29, 2020 10:51 — forked from Ocramius/Caddyfile
Example docker + docker-compose + caddy + traefik setup that routes to multiple apps from one exposed HTTP port
:80 {
root /serve
}
@orange888
orange888 / async-experiments.md
Created March 19, 2020 03:35 — forked from egeromin/async-experiments.md
Asynchronous Programming and Microservices: Comparing Javascript, Erlang and Python with RabbitMQ + Celery

Asynchronous Programming and Microservices: Comparing Javascript, Erlang and Python with RabbitMQ + Celery

This article is about building asynchronous microservices. I'll compare how this can be achieved in Javascript and Erlang natively, and in Python using RabbitMQ and Celery.

But why?

My first encounter with asynchronous programming in python was when building a web backend. Upon completing a purchase, the user should eventually receive a PDF invoice by email. This didn't have to happen immediately during the request; in fact, it was better if it didn't, so as not to slow down the purchase needlessly. At the time I wasn't sure how to implement an asynchronous workflow in python, but a quick google search quickly lead me to Celery and RabbitMQ. Celery is very easy to use; the only pain is setting up a message broker -- RabbitMQ, in my case. Once you're set up, running a task in the background is as easy as writing, in myapp.py,

@orange888
orange888 / tx_test.py
Created January 1, 2020 13:05
Test script for sending jpeg data to LKV373 receivers
#!/usr/bin/env python
import os
import sys
import socket
import time
import multiprocessing
from struct import *
try:
@orange888
orange888 / tmux-cheatsheet.markdown
Created December 13, 2019 22:39 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@orange888
orange888 / menu.livecd.ipxe
Created November 17, 2019 23:54 — forked from tuxfight3r/menu.livecd.ipxe
ipxe linux livecd / netinstall menus
#!ipxe
# To access this file via http use following redirection:
# http://preseed.panticz.de/ipxe/menu.livecd.ipxe
menu LiveCD
item --gap Ubuntu:
item live_ubuntu_16.04 Ubuntu Trusty 16.04 LiveCD
item live_ubuntu_14.04 Ubuntu Trusty 14.04 LiveCD
item live_ubuntu_12.04 Ubuntu Precise 12.04 LiveCD
@orange888
orange888 / luks_crypt.md
Created November 15, 2019 05:29
create a simple LUKS partition on a single physical volume

LUKS crypt

In this guide, I'm going to setup a keyfile-encrypted LUKS partition. I will be using a single, max-size partition on a single physical device. My physical device is located at /dev/sde

partition the physical device

parted /dev/sde
@orange888
orange888 / bash-to-zsh-hist.py
Created November 15, 2019 03:19 — forked from muendelezaji/bash-to-zsh-hist.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time