Skip to content

Instantly share code, notes, and snippets.

@biochemie
biochemie / README.md
Created April 23, 2024 13:12 — forked from hiway/README.md
Creating a single process FreeBSD (12.1) Jail

How to jail a single process web server on FreeBSD 12.1

You may have found many great resources on how to set up jails on latest FreeBSD, however there is scant information on how to go about creating a barebones jail with nothing but the one process that you want to isolate.

I was curious if I could contain a statically compiled web server that I wrote while learning Rust all by itself in a jail instead of having a full userland.

#!/usr/bin/env python3
# OSX (*nix/Linux in general?) script to convert less iOS-friendly yuvj420 from Android phones to iOS-happy formats (requires ffmpeg)
# Also resets file creation date (based on default naming structure) to let OSX/iOS properly import creation dates
# Usage: android_to_ios_video.py /path/to/videos-to-convert /path/to/converted-videos
import os,subprocess,sys
# Define the arguments for ffmpeg
fopt = ['-y','-c:v','libx264','-filter:v','-movflags','+faststart','-profile:v','baseline','-pix_fmt','yuv420p','-c:a','aac']
# Locations for existing & new videos
src = sys.argv[1]
dest = sys.argv[2]

Keybase proof

I hereby claim:

  • I am biochemie on github.
  • I am himay (https://keybase.io/himay) on keybase.
  • I have a public key ASCHa3YJM2Kbvo-jUIrNZVz-JqpRRVyQxk-MeCKCbVgI8Ao

To claim this, I am signing this object:

@biochemie
biochemie / rsync_ecoli.sh
Created April 22, 2016 01:22 — forked from nickloman/rsync_ecoli.sh
Retrieve all Escherichia sequences from Genbank with rsync
rsync -av rsync://ftp.ncbi.nlm.nih.gov/genomes/Bacteria --include "*/" --include "Bacteria/Escherichia*/*.fna" --exclude=* .
# bonus script - concatenate chromosomes and plasmids into single fasta file, make sure the files don't already exist
find . -mindepth 1 -type d | xargs -L 1 -I '{}' find {} -name "*.fna" | while read i ; do cat "$i" >> `dirname "$i"`.fasta ; done