iptablesを直接いじりたくないのでufwを導入します。 sudo yum install wget make mkdir -p ~/src cd ~/src wget https://launchpad.net/ufw/0.33/0.33/+download/ufw-0.33.tar.gz tar xzf ufw-0.33.tar.gz cd ufw-0.33 sudo python ./setup.py install cd ../ sudo rm -rf ufw-0.33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@img = Img.new(img_params.except("pic")) | |
@img.pic = img_params.delete("pic") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install fontconfig freetype freetype-devel fontconfig-devel libstdc++ | |
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 | |
tar -xjvf ~/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 --strip-components 1 /opt/phantomjs/ | |
sudo yum install libffi-devel openssl-devel | |
pip install pyopenssl pyasn1 | |
pip install requests[security] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install MP4Box on Centos 6 | |
git clone https://github.com/gpac/gpac | |
git checkout 97eaffd | |
./configure | |
make all | |
sudo make install-lib install | |
echo "/usr/local/lib" >> /etc/ld.so.conf.d/gpac.conf | |
sudo /sbin/ldconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Hi, | |
#(First, I assume you've tested the VPN and verified that it's actually working, i.e. you can make connections from your Linode and they're routed over the VPN.) | |
#This is a classic problem: when you connect to the Linode by its public IP address, the return packets get routed over the VPN. You need to force these packets to be routed over the public eth interface. These route commands should do the trick: | |
#Code: | |
ip rule add from x.x.x.x table 128 | |
ip route add table 128 to y.y.y.y/y dev ethX | |
ip route add table 128 default via z.z.z.z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
# ================================== | |
# iptables default configuration script | |
# | |
# - this locks down our servers port access | |
# ================================== | |
# install fail2ban | |
sudo apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get remove vim vim-runtime vim-tiny vim-common | |
# Install dependencies | |
sudo apt-get install libncurses5-dev python-dev libperl-dev ruby-dev liblua5.2-dev | |
# Fix liblua paths | |
sudo ln -s /usr/include/lua5.2 /usr/include/lua | |
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.2.so /usr/local/lib/liblua.so | |
# Clone vim sources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install xcape | |
Then configure it in the following way: | |
# make CapsLock behave like Ctrl: | |
setxkbmap -option ctrl:nocaps | |
# make short-pressed Ctrl behave like Escape: | |
xcape -e 'Control_L=Escape' |
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':
OlderNewer