Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:
- CA certificate
- Server certificate
- Server key
- Client certificate
- Client key
def s3_to_pandas(client, bucket, key, header=None): | |
# get key using boto3 client | |
obj = client.get_object(Bucket=bucket, Key=key) | |
gz = gzip.GzipFile(fileobj=obj['Body']) | |
# load stream directly to DF | |
return pd.read_csv(gz, header=header, dtype=str) | |
def s3_to_pandas_with_processing(client, bucket, key, header=None): |
At the time of writing, Python v3.5 and PIP v9.0.1 were available on AWS EC2.
sudo yum update -y
sudo yum install python35 -y
import pandas as pd | |
import csv | |
with open("<filename>.csv", 'r') as f: | |
with open("updated_file.csv", 'w') as f1: | |
f.next() # skip header line | |
f.next() # skip header empty line | |
for line in f: | |
f1.write(line.replace('\x00', '')) |
Many users when are given server access, do not have root (or sudo) privileges and can not simply do
sudo apt-get install python-pip
.
Here's an easy way you can install and use pip without root (or sudo) access in a local directory.
Note : This works without easy_install
too.
DROP FUNCTION IF EXISTS fn_remove_accents; | |
DELIMITER | | |
CREATE FUNCTION fn_remove_accents( textvalue VARCHAR(10000) ) RETURNS VARCHAR(10000) | |
BEGIN | |
SET @textvalue = textvalue COLLATE utf8_general_ci;; | |
-- ACCENTS | |
SET @withaccents = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ'; |
docker-compose.yml
and config.yml
in the same directory on one of your volumes on the NAS.docker-compose up -d
curl --head http://NAS-IP:55000
--registry-mirror=http://NAS-IP:55000
curl http://NAS-IP:55000/v2/_catalog
If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:
$ git config --global commit.gpgsign true
([OPTIONAL] every commit will now be signed)$ git config --global user.signingkey ABCDEF01
(where ABCDEF01
is the fingerprint of the key to use)$ git config --global alias.logs "log --show-signature"
(now available as $ git logs
)$ git config --global alias.cis "commit -S"
(optional if global signing is false)$ echo "Some content" >> example.txt
$ git add example.txt
$ git cis -m "This commit is signed by a GPG key."
(regular commit
will work if global signing is enabled)