This process would likely apply to other Homebrew formula also.
First search for your desired package:
brew search go
You should get a list of results that include the below. Not "go" is very unspecific so you may get a lot of results:
/* | |
* FILE : AES_Example.go | |
* PROJECT : INFO-1340 - Block Ciphers | |
* PROGRAMMER : Daniel Pieczewski, ref: https://github.com/mickelsonm | |
* FIRST VERSION : 2020-04-12 | |
* DESCRIPTION : | |
* The function(s) in this file make up example code for encryption and decryption of a block of text | |
* using the Golang standard library AES implementation using the Cipher Feedback mode of encryption (CFB). | |
* DISCLAIMER: There is no way that this a secure implementation of AES. This is only for my personal learning. | |
* So help you God if this ends up in some commercial application. |
This process would likely apply to other Homebrew formula also.
First search for your desired package:
brew search go
You should get a list of results that include the below. Not "go" is very unspecific so you may get a lot of results:
On Tue Oct 27, 2015, history.state.gov began buckling under load, intermittently issuing 500 errors. Nginx's error log was sprinkled with the following errors:
2015/10/27 21:48:36 [crit] 2475#0: accept4() failed (24: Too many open files)
2015/10/27 21:48:36 [alert] 2475#0: *7163915 socket() failed (24: Too many open files) while connecting to upstream...
An article at http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/ provided directions that mostly worked. Below are the steps we followed. The steps that diverged from the article's directions are marked with an *.
su
to run ulimit
on the nginx account, use ps aux | grep nginx
to locate nginx's process IDs. Then query each process's file handle limits using cat /proc/pid/limits
(where pid
is the process id retrieved from ps
). (Note: sudo
may be necessary on your system for the cat
command here, depending on your system.)fs.file-max = 70000
to /etc/sysctl.confpackage main | |
import ( | |
"fmt" | |
"github.com/jinzhu/gorm" | |
_ "github.com/lib/pq" | |
) | |
func main() { |
{ | |
"Statement":[ | |
{ | |
"Effect":"Allow", | |
"Action":[ | |
"s3:ListAllMyBuckets" | |
], | |
"Resource":"arn:aws:s3:::*" | |
}, |
$.ajax({ | |
url : 'someurl', | |
type : 'POST', | |
data : ...., | |
tryCount : 0, | |
retryLimit : 3, | |
success : function(json) { | |
//do something | |
}, | |
error : function(xhr, textStatus, errorThrown ) { |
import boto | |
s3 = boto.connect_s3() | |
bucket = s3.lookup('mybucket') | |
key = bucket.lookup('mykey') | |
# Copy the key onto itself, preserving the ACL but changing the content-type | |
key.copy(key.bucket, key.name, preserve_acl=True, metadata={'Content-Type': 'text/plain'}) | |
key = bucket.lookup('mykey') |
def expire_view_cache(view_name, args=[], namespace=None, key_prefix=None, method="GET"): | |
""" | |
This function allows you to invalidate any view-level cache. | |
view_name: view function you wish to invalidate or it's named url pattern | |
args: any arguments passed to the view function | |
namepace: optioal, if an application namespace is needed | |
key prefix: for the @cache_page decorator for the function (if any) | |
from: http://stackoverflow.com/questions/2268417/expire-a-view-cache-in-django | |
added: method to request to get the key generating properly |