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
require 'openssl' | |
# This module provides AES encryption compatible with MySQL AES_ENCRYPT | |
# and AES_DECRYPT functions. | |
module MySQLEncryption | |
# Takes an unencrypted text string, encrypts it with the password, | |
# and encodes the results to a hexadecimal string | |
def self.mysql_encrypt(unencrypted_text, password) | |
encrypt(unencrypted_text, mysql_key(password)) |
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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
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
package main | |
// More info on Getwd() | |
// https://golang.org/src/os/getwd.go | |
// | |
import( | |
"os" | |
"fmt" | |
"log" | |
) |
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
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/tls" | |
"crypto/x509" | |
"crypto/x509/pkix" | |
"errors" | |
"log" |
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
package main | |
import ( | |
"fmt" | |
"net" | |
"time" | |
"bufio" | |
) | |
func handleConnection(conn net.Conn) { |
- Use
ember-deploy
+ember-deploy-s3
+ember-deploy-s3-index
npm install --save-dev ember-deploy ember-deploy-s3 ember-deploy-s3-index
- Update nginx with the following config
server {
listen 80;
server_name foo.example.dev;
location / {
set $s3_bucket 'my-ember-app-index.s3.amazonaws.com';
set $url_full '$1';
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
// keepDoingSomething will keep trying to doSomething() until either | |
// we get a result from doSomething() or the timeout expires | |
func keepDoingSomething() (bool, error) { | |
timeout := time.After(5 * time.Second) | |
tick := time.Tick(500 * time.Millisecond) | |
// Keep trying until we're timed out or got a result or got an error | |
for { | |
select { | |
// Got a timeout! fail with a timeout error | |
case <-timeout: |
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
require "bundler" | |
require "active_model_serializers" | |
require "roar" | |
require "roar/json/json_api" | |
require "benchmark" | |
require "ffaker" | |
Post = Struct.new(:id, :author, :body, :draft) do | |
include ActiveModel::Serializers::JSON | |
end |
SSH into Root
$ ssh [email protected]
Change Root Password
NewerOlder