Byte-Sized Tech Tips Round-Up: Week 1
Tags: bash, python, react
Published: 2020-10-17 03:12:59

## Populate a Cloudant database with Python

> From
> {% user stevemar %}

In just a few lines I was able to use the [Cloudant Python SDK](https://github.com/cloudant/python-cloudant) to quickly seed a database with 1400 entries from a YAML file.

**Pro-tip:** Make sure you're using the Replay429Adapter in your client or you'll surely hit a Rate Limit Error

```python
import yaml
from cloudant import Cloudant
from cloudant.adapters import Replay429Adapter


username = "foo"
password = "bar"
url = "baz"
client = Cloudant(username, password, url=url, connect=True,
                  adapter=Replay429Adapter(retries=10, initialBackoff=0.01))

client.connect()
db = client.create_database("repos", throw_on_exists=False)

with open("repos.yaml", 'r') as stream:
    data_loaded = yaml.safe_load(stream)

    for entry in data_loaded['repos']:
        db.create_document(entry)
```

Read more about the Cloudant DBaaS on [IBM Cloud](https://cloud.ibm.com/catalog/cloudant).

## Expo and iOS

> From
> {% user poojamakes %}

This week I was had a chance to play with [expo](https://expo.io/). The application we're building in React will work on Android and iOS from the same JavaScript codebase. Expo also provides access to device capabilities like camera, location, notifications. Putting it all together was the iOS simulator functions of Xcode!

Read more about using Expo with iOS in the [docs](https://docs.expo.io/workflow/ios-simulator/).

## Bang-bang

> From [Nigel](https://www.linkedin.com/in/pnigelbrown/)

I'm currently taking the [Red Hat System Administration I
](https://www.redhat.com/en/services/training/rh124-red-hat-system-administration-i) course in preparation of the [Red Hat OpenShift I: Containers & Kubernetes](https://www.redhat.com/en/services/training/do180-red-hat-openshift-I-containers-kubernetes) course. One this I learned this week was the `!!` Bang-bang command. The `!!` Bang-bang command repeats the last command. It's especially helpful with commands that you forgot to put `sudo` in front of. For example:

```bash
$ yum update
Loaded plugins: priorities, update-motd, upgrade-helper
You need to be root to perform this command.

$ sudo !!
sudo yum update
Loaded plugins: priorities, update-motd, upgrade-helper
```

Read more about [bang bang commands](https://www.redhat.com/sysadmin/bash-bang-commands).

## API Connect Sandbox features

> From
> {% user jritten %}

This week I hosted a [workshop about API Connect](https://www.crowdcast.io/e/dev-tools-apiconnect/). One thing I learned about this week was API Connect's Sandbox service. I had played with tools such as Postman before but the Sandbox service has great features such as adding collaborators and deploying your sandbox to a staging-like environment. Those really impressed me!

**The collaborators of the project**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/njyxbpbnhdpjb431vh0d.png)

**The URL to our staging environment**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j3s7xegswi6yfgaxlyqd.png)

Read more about [API Connect](https://cloud.ibm.com/catalog/services/api-connect).