next.js, nginx, reverse-proxy, ssl
$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt| package main | |
| import "fmt" | |
| import "strconv" | |
| const ( | |
| MAX_X = 20 | |
| MAX_Y = 20 | |
| ) |
| #!/bin/bash | |
| for i in {1..10} | |
| do | |
| rand=$(( ( RANDOM % 4000 ) + 6000 )) | |
| curl -X GET "http://localhost:8000/broadcast/test/$rand" &2> /dev/null | |
| echo -e "$rand" | |
| sleep 3 | |
| done |
| #!/bin/bash | |
| while true; do; ls -la . | tr -d '\r\n'; echo -n "\r"; sleep 5; done |
| #!/usr/bin/env python | |
| # @author: eugene.santos13@gmail.com | |
| # this will generate json structure for .shuttle.json | |
| import json | |
| import sys, getopt | |
| def parse_opt(argv): | |
| cert_path = '' |
| sysctl -w net.ipv4.ip_forward=1 | |
| iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
| iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080 |
| “Standard” web video (480p at 500kbit/s): | |
| ffmpeg -i input_file.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k output_file.mp4 | |
| 360p video for older mobile phones (360p at 250kbit/s in baseline profile): | |
| ffmpeg -i inputfile.avi -vcodec libx264 -vprofile baseline -preset slow -b:v 250k -maxrate 250k -bufsize 500k -vf scale=-1:360 -threads 0 | |
| -acodec libvo_aacenc -ab 96k output.mp4 | |
| 480p video for iPads and tablets (480p at 400kbit/s in main profile): |
| <div class="checkbox"> | |
| <label for="checkbox-1"> | |
| <input type="checkbox" name="box[1]" id="checkbox-1" checked> | |
| Checkbox | |
| <div class="checkbox-ui"></div> | |
| </label> | |
| </div> | |
| <div class="checkbox"> | |
| <label for="checkbox-2"> |
| $ ./script/server | |
| => Booting Mongrel | |
| => Rails 2.3.5 application starting on http://0.0.0.0:3000 | |
| /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:in `requirement': undefined local variable or method `version_requirements' for #<Rails::GemDependency:0xf6e64a78> (NameError) | |
| from /usr/local/lib/site_ruby/1.8/rubygems.rb:254:in `activate' | |
| from /usr/local/lib/site_ruby/1.8/rubygems.rb:1204:in `gem' | |
| from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:73:in `add_load_paths' | |
| from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths' | |
| from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `each' | |
| from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths' |