CLICK ME
yes, even hidden code blocks!
print("hello world!")
# | |
# Github Actions for Serverless Framework | |
# | |
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings | |
# If you're using env.yml file, store its content as ENV Github secret | |
# | |
# Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD | |
# | |
# Learn more: https://maxkostinevich.com/blog/how-to-deploy-serverless-applications-using-github-actions/ | |
# |
/* | |
This is a test server definition for GCE+Terraform for GH-9564 | |
*/ | |
provider "google" { | |
project = "${var.project}" // Your project ID here. | |
region = "${var.region}" | |
} | |
resource "google_compute_firewall" "gh-9564-firewall-externalssh" { |
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"reflect" | |
"github.com/olivere/elastic" | |
) |
We use hipchat to post messages out of hipchat. One thing we noticed is that we were consistently getting an error even though messages were posting correctly. | |
After a little research, we found that we were getting back a 204 from the api call. A 204 indicates that the request has been fulfilled and that there is no additional content to send in the response payload body - https://httpstatuses.com/204. | |
In our case, this is a valid return for this type of traffic - so looking at the hipchat.py script in modules, you can see that a false is purposefully being returned when no content is returned: | |
if result.get('status', None) == salt.ext.six.moves.http_client.OK: | |
response = hipchat_functions.get(api_version).get(function).get('response') | |
return result.get('dict', {}).get(response, None) | |
elif result.get('status', None) == salt.ext.six.moves.http_client.NO_CONTENT: |
rabbitmqctl add_user test test | |
rabbitmqctl set_user_tags test administrator | |
rabbitmqctl set_permissions -p / test ".*" ".*" ".*" |
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"strconv" | |
) | |
func main() { |
package main | |
import ( | |
"fmt" | |
"github.com/awslabs/aws-sdk-go/aws" | |
"github.com/awslabs/aws-sdk-go/aws/credentials" | |
"github.com/awslabs/aws-sdk-go/service/ec2" | |
) | |
func main() { |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)