terraform verbose mode
If you’re facing such an error:
UnauthorizedOperation: You are not authorized to perform this operation.
Run terraform like this:
TF_LOG=1 terraform apply
And this will most likely help you further with your debugging.
decoding encoded amazon authorization messages
If you receive something like this as a result of an aws operation:
You are not authorized to perform this operation. Encoded authorization failure message: (redacted)
Then, you can decode it like this:
aws sts decode-authorization-message --encoded-message redacted
To have the above command work, make sure your user has the sts:DecodeAuthorizationMessage grant.
Could not load got :badfile
Received an error like this in the console:
Could not load module WebAssist.Repo, got: badfile [error] beam/beam_load.c(1278): Error loading module 'Elixir.WebAssist.Repo': module name in object code is Elixir.Webassist.Repo
Turns out, the module name was Webassist, and not WebAssist.
amazon sns http endpoint post
Turns out the requests coming from Amazon SNS have
, even
though they are JSON. One way to handle them in a rails app is this:1
Content-Type: text/plain
Notice that we’re using
, because params won’t have the body parsed.1
raw_post
sftp permission denied on chrooted centos
I had the following in my sshd_config:
Match Group myftpgroup Allowtcpforwarding no Chrootdirectory %h Forcecommand internal-sftp
Imagining a user called john, this was the setup:
- /home was owned by root
- /home/john was owned by root
- the files inside john were john’s own files
With all these in place, this was what I received when sftp-ing:
sftp> put README.md Uploading README.md to /new/README.md remote open("/new/README.md"): Permission denied
Turns out, it was caused by selinux, and the fix was to run this cmd:
enabling a user to connect to a machine using his ssh key
Assuming your user name is john, pasting the contents of the user’s public key
in
on the server, will allow him to login using only his
ssh key.1
/home/john/.ssh/authorized_keys
ignore git files only locally
If you have untracked files that you’d like ignored, add them to
.
Same syntax as in a .gitignore file.1
.git/info/exclude
preparing with automatic deployments for a new server with chef
To be able to do a pull on a newly created machine, without you having to do an initial ssh to github, or some other host, you can do this in a recipe:
This comes from the ssh_known_hosts cookbook