Skip to content

Instantly share code, notes, and snippets.

View fzliu's full-sized avatar

Frank Liu fzliu

View GitHub Profile
@fzliu
fzliu / courier.py
Last active September 1, 2015 06:45
A customizable, "black hole" mail server.
#!/usr/bin/env python
import argparse
import asyncore
from email import message_from_string
from email.iterators import typed_subpart_iterator
from email.mime.text import MIMEText
from email.utils import formataddr
import getpass
import logging
@fzliu
fzliu / Makefile.config
Last active January 3, 2016 07:08
Caffe Makefile for OS X Yosemite.
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# To customize your choice of compiler, uncomment and set the following.
@fzliu
fzliu / pycaffe_tutorial.ipynb
Created September 14, 2015 10:09
Caffe tutorial using Python.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fzliu
fzliu / .profile
Last active February 1, 2016 19:40
OS X terminal configuration.
# Display full path in terminal
export PS1="\u@\H:\w$ "
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
@fzliu
fzliu / make_cifar10.py
Last active April 28, 2021 08:31
Create image data from raw CIFAR-10 files.
"""
make_cifar10.py: Create training data from raw CIFAR-10 batches.
"""
import pickle
import glob
import os
import numpy as np
from skimage.io import imsave
@fzliu
fzliu / download_pixels.py
Created June 9, 2016 04:49
A helper script for downloading images from URLs.
"""
download_pixels.py: A handy utility function for downloading images from URLs.
"""
import os
import shutil
import requests
@fzliu
fzliu / gen_kasami_seqs.m
Created June 10, 2017 07:33
Uses MATLAB to generate Kasami sequences.
seqs = [];
for n = 0:62
ks = comm.KasamiSequence('Index', n, ...
'Polynomial', [12 6 4 1 0], ...
'InitialConditions', [zeros(1, 11) 1], ...
'SamplesPerFrame',4095);
seq = step(ks);
seq = 2 * (seq - 0.5);
seqs = [seqs seq];
from __future__ import print_function
import math
from multiprocessing import Pool
import sys
def divs_and_mults(num, maxval):
@fzliu
fzliu / docker-compose.yml
Created June 23, 2021 04:12
Gitlab minimal memory installation via docker.
web:
image: 'gitlab/gitlab-ee:latest'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com'
# Add any other gitlab.rb configuration here, each on its own line
puma['worker_processes'] = 0
sidekiq['max_concurrency'] = 10
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.