example on how to use mechanize with cookie jars, basically:
agent.cookie_jar.save_as "cookies.yml"
agent.cookie_jar.load "cookies.yml"
to try it:
- download this zip
| # Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below). | |
| proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G; | |
| # Gzip was on in another conf file of mine...You may need to uncomment the next line. | |
| #gzip on; | |
| gzip_disable msie6; | |
| gzip_static on; | |
| gzip_comp_level 4; | |
| gzip_proxied any; | |
| # Again, be careful that you aren't overwriting some other setting from another config's http {} section. |
| ######################################## | |
| # | |
| # Nginx 1.8.0 | |
| # Pagespeed v.1.9.32.6 | |
| # OpenSSL 1.0.2d | |
| # - Tested on Ubuntu 14.4.2 | |
| # | |
| ######################################## | |
| #!/bin/bash | |
| # Full path to tc binary | |
| TC=$(which tc) | |
| # | |
| # NETWORK CONFIGURATION | |
| # interface - name of your interface device | |
| # interface_speed - speed in mbit of your $interface | |
| # ip - IP address of your server, change this if you don't want to use |
Relies on some *nix CLI utilities: mediainfo; and qt-faststart (part of ffmpeg). I used homebrew to install them on OS X.
Pseudo streaming is simply a video that can start playing before it's fully dowmloaded. The videos are not streaming but rather progressively downloaded. What's important is that the file metadata (the Moov Atom) is at the start of the file rather than at the end. Usually this is an option set when encoding the file (called quick start or web start). If the files have not been encoded this way you can either re-encode or use a utility to move the Moov Atom. Re-encoding takes much longer than using a utility to move the Moov Atom so here's how to do it.
First check with mediainfo to see if video 'is streamable':
| # | |
| # CORS header support | |
| # | |
| # One way to use this is by placing it into a file called "cors_support" | |
| # under your Nginx configuration directory and placing the following | |
| # statement inside your location block(s): | |
| # | |
| # include cors_support; | |
| # | |
| # A limitation to this method is that Nginx doesn't currently send headers |
| #!/bin/sh -x | |
| # ================================== | |
| # iptables default configuration script | |
| # | |
| # - this locks down our servers port access | |
| # ================================== | |
| # install fail2ban | |
| sudo apt-get update |