Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

AWSTemplateFormatVersion: 2010-09-09
Description: "Deploys a linux jenkins agent build server"
Parameters:
IamInstanceProfileParameter:
Type: String
InstanceTypeParameter:
Type: String
ImageIdParameter:
import csv
from prettytable import from_csv
def main():
write_csv()
read_csv()
import_pt_from_csv()
def write_csv():
@altairlage
altairlage / CreateIAMUserViaCLI.txt
Created June 17, 2019 14:55
How to create and AWS IAM user via CLI
- Create user
aws iam create-user --user-name <username>
- Create login profile (to allow AWS Console access)
aws iam create-login-profile --user-name <value> --password <value> --password-reset-required
- Create access key (for programatic access)
aws iam create-access-key --user-name <username>
- Add user to group
https://www.youtube.com/watch?v=6sWec7b0JIc
https://www.youtube.com/watch?v=xBLjXdyh3zs
https://www.youtube.com/watch?v=JsijdbjVlXw
https://www.youtube.com/watch?v=ExpkMy6DJ6o
https://docs.conan.io/en/latest/
\copy (<SQL Query - no ;>) To '/home/user/query.csv' With header CSV delimiter as ';'
@altairlage
altairlage / ConnectPostgresFromLinux.txt
Created April 18, 2019 15:15
How to connect to a remote postgres database from linux
psql -h <endpoint/ip> -p <port> -d <dbname> -U <user> -W <password>
@altairlage
altairlage / temp-policy.json
Last active March 31, 2020 17:05
Sample temp AWS IAM permissions policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"iot:UpdateThing",
"iot:GetThingShadow",
"iot:UpdateThingShadow",
References:
https://docs.microsoft.com/pt-br/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2017
https://docs.microsoft.com/pt-br/visualstudio/install/workload-and-component-ids?view=vs-2017
https://docs.microsoft.com/pt-br/visualstudio/install/workload-component-id-vs-community?view=vs-2017
https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2017
Powershell commands:
setx /M PATH "%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin;
@altairlage
altairlage / graylog_role_request_notes.txt
Last active February 28, 2019 14:07
Graylog api role request notes
Documentation:
http://docs.graylog.org/en/3.0/pages/configuration/rest_api.html
http://docs.graylog.org/en/2.3/pages/users_and_roles/permission_system.html
https://github.com/Graylog2/graylog2-server/issues/4133
https://github.com/Graylog2/graylog2-server/blob/2.3.1/graylog2-server/src/main/java/org/graylog2/shared/security/RestPermissions.java#L49
Internal API documentation:
https://<your graylog address>/api/api-browser/
Get permissions list:
@altairlage
altairlage / convert_from_bitbucket.txt
Created December 20, 2018 18:57
How to checkout from Mercurial Bitbucket and fully commit to a github repo
1- Install mercurial
- apt-get install mercurial
2- Checkout bitbucket repo
- hg clone <repo url> -r <branch>
- EX - hg clone https://bitbucket.org/rptlab/reportlab -r default
3 - Create a git repo:
- cd reportlab
- git init
- git checkout -b master