For excessively paranoid client authentication.
Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
| #!/bin/bash | |
| bundle check || bundle install --jobs 4 --retry 5 | |
| pids=( server.pid realtime_updater.pid ) | |
| for file in "${pids[@]}" | |
| do | |
| path="tmp/pids/$file" | |
| if [ -f $path ]; then | |
| rm $path | |
| fi |
| 1c2eac3a1b8c0fcde485125c363c753f |
| 1c2eac3a1b8c0fcde485125c363c753f |
For excessively paranoid client authentication.
Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
| #!/bin/bash | |
| set -eux | |
| # https://linode.com/docs/databases/redis/install-and-configure-redis-on-centos-7/ | |
| sudo yum -y install epel-release | |
| sudo yum update | |
| sudo yum -y install redis | |
| sudo systemctl start redis | |
| sudo systemctl enable redis |
| # in controller | |
| # for local files | |
| send_file '/path/to/file', :type => 'image/jpeg', :disposition => 'attachment' | |
| # for remote files | |
| require 'open-uri' | |
| url = 'http://someserver.com/path/../filename.jpg' | |
| data = open(url).read | |
| send_data data, :disposition => 'attachment', :filename=>"photo.jpg" |
| require "open-uri" | |
| require "net/http" | |
| Error = Class.new(StandardError) | |
| DOWNLOAD_ERRORS = [ | |
| SocketError, | |
| OpenURI::HTTPError, | |
| RuntimeError, | |
| URI::InvalidURIError, |
| #import <Foundation/Foundation.h> | |
| NSDictionary *headers = @{ @"content-type": @"multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", | |
| @"cache-control": @"no-cache", | |
| @"postman-token": @"184d155d-451d-bd9c-06f2-ae6274c61509" }; | |
| NSArray *parameters = @[ @{ @"name": @"file", @"fileName": @"/Users/wqn/Downloads/img-test/ym-1.jpeg" } ]; | |
| NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW"; | |
| NSError *error; | |
| NSMutableString *body = [NSMutableString string]; |
| # | |
| # A fatal error has been detected by the Java Runtime Environment: | |
| # | |
| # SIGILL (0x4) at pc=0x00007fff6899b3ea, pid=59001, tid=0x0000000000001b03 | |
| # | |
| # JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14) | |
| # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode bsd-amd64 compressed oops) | |
| # Problematic frame: | |
| # C [libsystem_c.dylib+0x5d3ea] __abort+0xb1 | |
| # |
Java uses static, declared typing:
String hello = "Hello, World!";
List<String> phrases = new ArrayList<String>;
phrases.add(hello);
phrases.add(null);
phrases.add(123); // Compile error! Not a string.