Skip to content

Instantly share code, notes, and snippets.

@s-chb
s-chb / obs.py
Last active June 25, 2020 17:06
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from com.obs.client.obs_client import ObsClient
from com.obs.models.delete_objects_request import DeleteObjectsRequest, Object
# Setup the credentials
AK='put here your public access key'
SK='put here your secret access key'
# Constructs an obs client instance with your account for accessing OBS
obsClient = ObsClient(
access_key_id=AK,
secret_access_key=SK,
server=server
)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from com.obs.client.obs_client import ObsClient
from com.obs.models.delete_objects_request import DeleteObjectsRequest, Object
# Setup the credentials
AK='put here your public access key'
SK='put here your secret access key'
cd /mys3bucket
echo "this is a test file to check s3fs" >> test.txt
ls
df -Th
#or
df -Th /mys3bucket
@s-chb
s-chb / debug
Last active July 30, 2020 09:01
sudo s3fs your_bucketname /mys3bucket -o use_cache=/tmp -o allow_other -o uid=1001 -o mp_umask=002 -o multireq_max=5 -o use_path_request_style -o url=https://s3-{{aws_region}}.amazonaws.com “ -o dbglevel=info -f -o curldbg
sudo nano /etc/mount.sh
# Then add the following line :
sudo s3fs your_bucketname /mys3bucket -o use_cache=/tmp -o allow_other -o uid=1001 -o mp_umask=002 -o multireq_max=5 -o use_path_request_style -o url=https://s3-{{aws_region}}.amazonaws.com
# Then setup the right permissions :
sudo chmod -R a+rwx /etc/mount.sh
# Access the crontab
sudo mkdir /mys3bucket
sudo s3fs your_bucketname /mys3bucket -o use_cache=/tmp -o allow_other -o uid=1001 -o mp_umask=002 -o multireq_max=5 -o use_path_request_style -o url=https://s3-{{aws_region}}.amazonaws.com
sudo chmod 640 /etc/passwd-s3fs
Your_accesskey:Your_secretkey