In case the original firmware needs to be restored. Firmware for the MR3220 V2.2 can be found here, select the most recent version (this guide uses TL-MR3220_V2_130423.zip
):
http://www.tp-link.com/en/support/download/?model=TL-MR3220&version=V2
# Compiling Ruby 1.8.4 with Tk from source under Ubuntu 13.04 | |
# Install Rubygems 0.9.0 from source and various gems | |
# Download sources | |
~$ cd build | |
~/build$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz | |
~/build$ wget http://prdownloads.sourceforge.net/tcl/tcl8.5.14-src.tar.gz | |
~/build$ wget http://prdownloads.sourceforge.net/tcl/tk8.5.14-src.tar.gz | |
~/build$ wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz | |
~/build$ tar xf ruby-1.8.4.tar.gz |
# Print a label on a Zebra TLP 2844 in Ruby. | |
# The printer is EPL/2 capable and connected via USB. | |
# EPL/2 reference: http://www.zebra.com/apps/dlmanager?dlp=-227178c9720c025483893483886ea54a70963bb77ca94fcc1d65ce9394326ed960e43d023beba35831d5d9bfc1740296347157b5024977a&c=gb&l=en | |
# https://github.com/larskanis/libusb | |
require 'libusb' | |
# Select the printer by vendor ID and product ID. | |
# To get a list of connected devices, use 'lsusb'. | |
# 0a5f:0x000a identifies the Zebra TLP 2844. |
# In /etc/postgresql/9.1/main/pg_hba.conf, change | |
# | |
# local all all peer | |
# | |
# to | |
# | |
# local all all md5 | |
# | |
# and restart the Postgres server: |
# Based on http://wiki.ubuntuusers.de/Brother/Scanner and http://ubuntuguide.org/wiki/MFC-7820N | |
# | |
# System information. | |
$ uname -m | |
x86_64 | |
$ cat /etc/issue.net | |
Ubuntu 13.04 | |
# Download and install the driver. |
#!/bin/bash | |
# | |
# Shell script for setting the the solarized theme to use, | |
# either 'dark' or 'light'. | |
# | |
# If no argument has been given, toggle between 'dark' and 'light'. | |
# | |
# Adapted from https://github.com/jouberthenk/dotfiles/blob/master/solarize.sh | |
# | |
# Solarized theme: http://ethanschoonover.com/solarized |
# Copy and rename images to "%04d.jpg" | |
i=0; ls /CAMERA/*JPG | while read f; do cp "$f" "./$(printf '%04d.jpg' $i)"; let i=$(($i+1)); done | |
# Convert all images named "%04d.jpg" to a video. | |
avconv -f image2 -r 12 -i %04d.jpg -vcodec libvpx -deadline good -cpu-used 0 -b:v 500k -qmin 10 -qmax 63 -vf scale=1024:-1 RESULT.webm |
# Arange several images into a single images consisting of 1 tile per image. | |
# The final image will consist of a single row of 4 images, | |
# each 1200x in size, with 20 pixels padding around each border. | |
# The background color of the output image is black. | |
$ montage -tile 4x1 input_image_1 input_image_2 input_image_* -geometry 1200x+20+20 -background black output.jpg | |
# Center an original image above a white background that is larger than the original image. | |
$ convert -gravity Center INPUT.png -background white -extent 600x650 OUTPUT.png |
In case the original firmware needs to be restored. Firmware for the MR3220 V2.2 can be found here, select the most recent version (this guide uses TL-MR3220_V2_130423.zip
):
http://www.tp-link.com/en/support/download/?model=TL-MR3220&version=V2
# Capture a single image and save it in JPEG format. | |
$ gst-launch v4l2src num-buffers=1 ! jpegenc ! filesink location=/tmp/test.jpg | |
# Stream video from a webcam. | |
$ gst-launch v4l2src ! xvimagesink |
# Given an array of arrays s = [ [1,2,3], [4,5,6], ... ] | |
# compute the Cartesian product among the elements of s. | |
require 'pp' | |
s = [[1, 2], [3, 4, 5], [6, 7, 8, 9]] | |
pp s[1..-1].inject(s[0]){ |m,v| m = m.product(v).map(&:flatten) } | |
[[1, 3, 6], | |
[1, 3, 7], | |
[1, 3, 8], |