Skip to content

Instantly share code, notes, and snippets.

View epilys's full-sized avatar

Manos Pitsidianakis epilys

View GitHub Profile
@Xerkus
Xerkus / gist:3840496
Last active November 24, 2023 00:21
Mime and mail related RFCs

Mime and mail related RFCs

  1. RFC 1847 Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted
  2. RFC 2045 Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies
  3. RFC 2046 Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types
  4. RFC 2047 Multipurpose Internet Mail Extensions (MIME) Part Three: Message Header Extensions for Non-ASCII Text
  5. RFC 2049 Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples
  6. RFC 2076 Common Internet Message Headers
  7. RFC 2183 Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field
@jpouellet
jpouellet / zbell.sh
Last active November 24, 2023 10:49
Makes Zsh print a bell when long-running commands finish. I use this in combination with i3 and throw big compile jobs (or whatever it may be) into another workspace to get a nice visual notification (workspace indicator turns red) when it's done so I don't need to waste time regularly checking on it.
#!/usr/bin/env zsh
# This script prints a bell character when a command finishes
# if it has been running for longer than $zbell_duration seconds.
# If there are programs that you know run long that you don't
# want to bell after, then add them to $zbell_ignore.
#
# This script uses only zsh builtins so its fast, there's no needless
# forking, and its only dependency is zsh and its standard modules
#
@baruchel
baruchel / compile_heirloom_doctools.md
Last active July 21, 2024 03:13
Quickly compiling Heirloom Doctools

Each time I re-install a fresh Linux distribution, one of the first things I need to do is to compile the Heirloom Documentation Tools. However some adjustments have to be performed; I write them here in order to recall them later:

  • download the sources from http://heirloom.sourceforge.net/doctools.html

  • type: sudo apt-get install g++ libc-dev bison flex

  • uncompress the tarball

  • enter the heirloom-doctools directory

  • edit mk.config and change three lines:

    • replace INSTALL=/usr/ucb/install with INSTALL=/usr/bin/install
  • replace PREFIX=/usr with PREFIX=/opt/heirloom
@jtickle
jtickle / hilbert-term.py
Last active May 7, 2019 18:05
Hilbert Terminal Filling Curve
#!/usr/bin/env python3
import shutil;
import collections;
import math;
import sys;
import argparse;
Point = collections.namedtuple('Point', ['x', 'y', 'n'])
HilbertAt = collections.namedtuple('HilbertAt', ['x', 'y', 'n'])
@fm4dd
fm4dd / gcc compiler optimization for arm systems.md
Last active October 12, 2024 17:08
GCC compiler optimization for ARM-based systems

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@djotto
djotto / mp4.sh
Created May 20, 2017 12:33 — forked from anonymous/mp4.sh
Merge multiple mp4 files as chapters
#! /usr/bin/env bash
####################################################
# Required Libraries
#
# library name | commands used | verified version
# ------------------------------------------------
# ffmpeg | ffmpeg/ffprobe | 3.1.4 3.2
# gpac | mp4box | 0.6.1
# mp4v2 | mp4chaps | 2.0.0
@cb372
cb372 / riscv.md
Last active September 24, 2024 03:09
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

// tested using nix 0.15.0
extern crate nix;
use std::path::Path;
use nix::pty::{posix_openpt, grantpt, unlockpt, ptsname};
use nix::fcntl::{OFlag, open};
use nix::sys::{stat, wait};
use nix::unistd::{fork, ForkResult, setsid, dup2};
use nix::libc::{STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO};
@bonzini
bonzini / mbox_split.py
Last active March 30, 2024 02:40
Split a mailbox into separate patch files, stripping the transfer encoding and minimizing the headers along the way.
#! /usr/bin/env python3
# mbox_split.py
#
# Split a mailbox into separate patch files, stripping the transfer encoding
# and minimizing the headers along the way.
#
# Written by Paolo Bonzini <[email protected]>
import argparse
@nevans
nevans / IMAP-RFCs.md
Last active November 5, 2024 16:49
IMAP Specifications

IMAP specifications

(TODO) All IANA registered IMAP capabilities, response codes, keywords, mailbox attributes, the most relevant SASL mechanisms, and other relevant specifications.

  • ⛔️: obsolete specifications that have been deprecated or replaced
  • ⏭️: extensions that have been completely or partially included in [IMAP4rev2].
  • ✨: extensions that are recommended for [IMAP4rev2] servers and clients. The IETF EXTRA WG decided that requiring them as a part of IMAP4rev2 would push the bar to implement too high for new implementations.
  • 🗑: extensions that have been completely or partially deprecated or removed in [IMAP4rev2].
  • 🍋: extensions that are included in the "Lemonade" profile [RFC5550].