Skip to content

Instantly share code, notes, and snippets.

View fawix's full-sized avatar
🐱
Seeking wonders

Fatima Silveira fawix

🐱
Seeking wonders
View GitHub Profile
'''
Created on Oct 1, 2015
@author: fawix
'''
from gi.repository import Gtk, Gdk
import os, sys, cairo, math, random
class FunNewStuff:
@fawix
fawix / verbose.py
Created April 13, 2017 13:34
Python - Verbose Flag
#!/usr/bin/python
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--verbose', action='count', default=0)
for c in ['', '-v', '-v -v', '-vv', '-vv -v', '-v -v --verbose -vvvv']:
print parser.parse_args(c.split())
@fawix
fawix / gcloud_config.sh
Last active August 29, 2023 15:21
gcloud config activate
$ gcloud config configurations create config-name
Created [demo-config].
Activated [demo-config].
$ gcloud config set project my-project-id
Updated property [core/project].
$ gcloud config set account my-account@example.com
Updated property [core/account].
@fawix
fawix / cicd-translate-cloudbuild.yaml
Last active January 11, 2022 09:29
translate/cloudbuild.yaml
# Licensing CC BY-SA 4.0
Steps:
# CI Pipeline: static tests
- id: 'app-hana-be: static tests'
name: 'gcr.io/$PROJECTID/be-build-env'
waitFor: ['-']
dir: translate
args:
- -c
- >
@fawix
fawix / cicd-hana-Dockerfile
Last active August 29, 2020 23:45
Dockerfile for HANA build container
# Licensing CC BY-SA 4.0
FROM ubuntu
WORKDIR /usr/src/app
RUN apt-get update && \
apt-get install -y apt-utils && \
apt-get install -y openjdk-8-jre && \
apt-get install -y git && \
steps:
- id: 'obtain connection information'
name: 'gcr.io/cloud-builders/gcloud'
waitFor: ['-']
dir: db
entrypoint: 'bash'
args:
- -c
- >
gcloud secrets versions access latest --secret "${_CREDS}" --format='get(payload.data)' | base64 -d >> credentials.json &&
apiVersion: [api version]
kind: [object type]
metadata:
annotations:
[LIST OF ANNOTATIONS]
labels:
[LIST OF LABELS]
name: [name of entity]
spec:
[describe desired state]
apiVersion: v1
kind: Node
metadata:
annotations:
[LIST OF ANNOTATIONS]
creationTimestamp: "2021-10-27T04:26:00Z"
Labels:
[LIST OF LABELS]
name: gke-sample-default-pool-0b1e04f1-msit
resourceVersion: "27591622"
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx:stable-alpine
ports:
- containerPort: 80
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels: