SSH into your EC2 instance. Run the following:
$ sudo yum install gcc
This may return an "already installed" message. That's OK.
$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make
SSH into your EC2 instance. Run the following:
$ sudo yum install gcc
This may return an "already installed" message. That's OK.
$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make
from github import Github | |
gh = Github('SET_GITHUB_ACCESS_TOKE_HERE') | |
org = gh.get_organization('SET_ORG_NAME_HERE') | |
repos = org.get_repos() | |
for repo in repos: | |
if repo.archived: |
#!/usr/bin/env python | |
import boto3 | |
import argparse | |
def lookup_by_id(sgid): | |
sg = ec2.get_all_security_groups(group_ids=sgid) | |
return sg[0].name | |
node { | |
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1' | |
echo 'No quotes, pipeline command in single quotes' | |
sh 'echo $BUILD_NUMBER' // 1 | |
echo 'Double quotes are silently dropped' | |
sh 'echo "$BUILD_NUMBER"' // 1 | |
echo 'Even escaped with a single backslash they are dropped' | |
sh 'echo \"$BUILD_NUMBER\"' // 1 | |
echo 'Using two backslashes, the quotes are preserved' | |
sh 'echo \\"$BUILD_NUMBER\\"' // "1" |
import boto3 | |
ec2 = boto3.resource('ec2') | |
def lambda_handler(event, context): | |
# create filter for instances in running state | |
filters = [ | |
{ | |
'Name': 'instance-state-name', | |
'Values': ['running'] |
#!/usr/bin/env python | |
# coding: utf-8 | |
# In[1]: | |
data = [ | |
{"name": "Argentina", "year": 2005, "continent": "South America", "form": "Republic", "gdp": 181.357, "oil": 1.545, "balance": 4.699}, | |
{"name": "Argentina", "year": 2006, "continent": "South America", "form": "Republic", "gdp": 212.507, "oil": 1.732, "balance": 7.167}, | |
{"name": "Australia", "year": 2012, "continent": "Australasia", "form": "Constitutional monarchy", "gdp": 1542.055, "oil": 22.596, "balance": -62.969}, |
<div class="polls3"> | |
<table> | |
<thead> | |
<tr> | |
{% for c in cols[:5] %} | |
<th><div {% if c.lower() in ('grade', 'sample', 'weight') %} | |
style="text-align: center" | |
{% endif %}> | |
{{c}}</div> |
""" | |
Generate PDF reports from data included in several Pandas DataFrames | |
From pbpython.com | |
""" | |
from __future__ import print_function | |
import pandas as pd | |
import numpy as np | |
import argparse | |
from jinja2 import Environment, FileSystemLoader | |
from weasyprint import HTML |
As currently described, this approach does not work. The reason for that is that creating a snapshot via the API does not actually populate any data, as described in e.g. https://community.grafana.com/t/snapshot-using-http-api-does-nothing/. An alternative approach which does work described in https://gist.github.com/svet-b/1ad0656cd3ce0e1a633e16eb20f66425.
Packages:
jq
JSON processing command line tool, which is available for most distributions (https://stedolan.github.io/jq/, sudo apt install jq
)puppeteer
package (npm install puppeteer
), which is used to run headless Chrome# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/ | |
# GitLab uses docker in the background, so we need to specify the | |
# image versions. This is useful because we're freely to use | |
# multiple node versions to work with it. They come from the docker | |
# repo. | |
# Uses NodeJS V 9.4.0 | |
image: node:9.4.0 | |
# And to cache them as well. |