Skip to content

Instantly share code, notes, and snippets.

Altair Lage altairlage

View GitHub Profile
View queryResoltPostgresToCSV.txt
\copy (<SQL Query - no ;>) To '/home/user/query.csv' With header CSV delimiter as ';'
altairlage / ConnectPostgresFromLinux.txt
Created Apr 18, 2019
How to connect to a remote postgres database from linux
View ConnectPostgresFromLinux.txt
psql -h <endpoint/ip> -p <port> -d <dbname> -U <user> -W <password>
altairlage / temp-policy.json
Created Mar 18, 2019
Sample temp AWS IAM permissions policy
View temp-policy.json
"Version": "2012-10-17",
"Statement": [
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
View Install_VS2017_command_line.txt
Powershell commands:
setx /M PATH "%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin;
altairlage / graylog_role_request_notes.txt
Last active Feb 28, 2019
Graylog api role request notes
View graylog_role_request_notes.txt
Internal API documentation:
https://<your graylog address>/api/api-browser/
Get permissions list:
altairlage / convert_from_bitbucket.txt
Created Dec 20, 2018
How to checkout from Mercurial Bitbucket and fully commit to a github repo
View convert_from_bitbucket.txt
1- Install mercurial
- apt-get install mercurial
2- Checkout bitbucket repo
- hg clone <repo url> -r <branch>
- EX - hg clone -r default
3 - Create a git repo:
- cd reportlab
- git init
- git checkout -b master
altairlage /
Last active Feb 28, 2019
Delete AWS IoT things based on type or thing name detaching principals and deleting certificates (python 3 iot)
import logging
import argparse
import os
import botocore
import json
import boto3
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
altairlage /
Last active Feb 28, 2019
List github repos under org creating a .csv file (github enterprise - python 3 - github api
import requests
import json
import argparse
import logging
github_api_url = "https://<github URL>/api/v3"
ghe_access_token = 'your github personal access token'
#logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO, filename='ghe_org_repo_list.log')
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
You can’t perform that action at this time.