- convert .py to .pyx
- use cython to convert .pyx to .c
- compile .c
- Test run
example python file:
script.py
FROM golang:alpine AS builder | |
RUN apk update && \ | |
apk add git make | |
WORKDIR /go/src | |
ARG DIVE_VERSION=${DIVE_VERSION:-v0.10.0} | |
RUN git clone https://github.com/wagoodman/dive.git dive && \ | |
git -C /go/src/dive checkout ${DIVE_VERSION} |
using namespace System.Collections.Generic | |
# Encapsulate an arbitrary command | |
class PaneCommand { | |
[string]$Command | |
PaneCommand() { | |
$this.Command = ""; | |
} |
# Steps to install Jenkins Agent using JNLP connection on Ubuntu 20.04 Focal Fossa | |
# | |
# * create an Agent node on the web GUI: https://wiki.jenkins.io/display/JENKINS/Step+by+step+guide+to+set+up+master+and+agent+machines+on+Windows | |
# * $ sudo apt-get install -y openjdk-14-jre-headless | |
# * $ sudo adduser jenkins | |
# * $ curl http://jenkins-master.internal/jnlpJars/agent.jar -o /home/jenkins/agent.jar | |
# * create systemd service: place this file in /lib/systemd/system/jenkins-agent.service | |
# * $ sudo systemctl enable myservice | |
# * $ sudo systemctl start jenkins-agent |
#!/bin/bash | |
# `gitea dump` doesn't currently back up LFS data as well, only git repos | |
# It primarily backs up the SQL DB, and also the config / logs | |
# We'll backup like this: | |
# * "gitea dump" to backup the DB and config etc | |
# * tar / bzip all the repos since they will be skipped | |
# * Not rotated because git data is immutable (normally) so has all data | |
# * rsync LFS data directly from /volume/docker/gitea/git/lfs | |
# * No need for rotation since all files are immutable |
Information in this Gist originally from this github issue, which is outdated.
As @RomanMinkin mentioned, you can also consider Casbin (https://github.com/casbin/casbin). It is the most starred authorization library in Golang. There are several differences between Casbin and OPA.
Feature | Casbin | OPA |
---|---|---|
Library or service? | Library/Service | Library/Service |
How to write policy? | Two parts: model and policy. Model is general authorization logic. Policy is concrete policy rule. | A single part: Rego |
RBAC hierarchy | Casbin supports role hierarchy (a role can have a sub-role) | Role hierarchies can be encoded in data. Also with the new graph.reachable() built-in function queries over those hierarchies are much more feasible now. |
RBAC separation of duties | Not supported | Supported: two roles cannot be assigned together |
version: "3.3" | |
services: | |
################################################ | |
#### Traefik Proxy Setup ##### | |
############################################### | |
traefik: | |
image: traefik:v2.0 | |
restart: always |
Learning Rust
The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.
Warning
Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.
The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.
import 'package:async/async.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
void main() { | |
test("CancelableOperation with future", () async { | |
var cancellableOperation = CancelableOperation.fromFuture( | |
Future.value('future result'), | |
onCancel: () => {print('onCancel')}, | |
); |