This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from github import Github | |
import base64 | |
g = Github('xyAAAXcXACZYBx2YybC1zAzCxAYxc1Cxyz2AByb2') | |
repo = g.get_repo('sandbox/gh_api') | |
contents = repo.get_contents('data/image.jpg') | |
rawdata = contents.decoded_content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from github import Github | |
import base64 | |
g = Github('xyAAAXcXACZYBx2YybC1zAzCxAYxc1Cxyz2AByb2') | |
repo = g.get_repo('sandbox/gh_api') | |
with open('image.jpg', "rb") as f: | |
bytes = f.read() | |
b64_data = base64.b64encode(bytes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from github import Github | |
g = Github('xyAAAXcXACZYBx2YybC1zAzCxAYxc1Cxyz2AByb2') | |
repo = g.get_repo('sandbox/gh_api') | |
contents = repo.get_contents('data/dataset.csv') | |
decoded = contents.decoded_content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from github import Github | |
# read the text file and load each line as an item into a list | |
vars = list() | |
with open('vars.txt', 'r') as file: | |
for line in file: | |
vars.append(line.replace('\n', '')) | |
# assign each item to a variable | |
token = vars[0] | |
repo_for_upload = vars[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xyAAAXcXACZYBx2YybC1zAzCxAYxc1Cxyz2AByb2 | |
sandbox/gh_api | |
dataset.csv | |
data/dataset.csv | |
uploaded csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from github import Github | |
g = Github('xyAAAXcXACZYBx2YybC1zAzCxAYxc1Cxyz2AByb2') | |
repo = g.get_repo('sandbox/gh_api') | |
with open('dataset.csv', 'r') as file: | |
data = file.read() | |
repo.create_file('data/dataset.csv', 'upload csv', data, branch='main') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -p 389:389 -p 636:636 -p 4040:4040 \ | |
--name ldapsandbox_custom_schema \ | |
--detach \ | |
--env LDAP_ORGANISATION="example" \ | |
--env LDAP_DOMAIN="example.com" \ | |
--env LDAP_ADMIN_USERNAME="admin" \ | |
--env LDAP_ADMIN_PASSWORD="admin_pass" \ | |
--env LDAP_BASE_DN="dc=example,dc=com" \ | |
--volume "/$(pwd)/schema/cs.schema:/container/service/slapd/assets/config/bootstrap/schema/cs.schema" \ | |
osixia/openldap:latest --copy-service |