使用容器快速创建远程桌面的GUI连接
技术实现:
- Guacamole Server
- xrdp Server
| def first_or_none(predicate, seq): | |
| return next(filter(predicate, seq), None) | |
| if __name__ == '__main__': | |
| print(first_or_none(lambda x: x % 2 == 0, [2, 4, 6, 8])) # 2 | |
| print(first_or_none(lambda x: x % 2 == 0, [1, 3, 5, 7])) # None |
| import com.github.crazygit.tikheart.TikHeartApplication | |
| import com.github.crazygit.tikheart.data.dao.UserInfoDao | |
| import com.github.crazygit.tikheart.data.model.UserInfo | |
| import com.github.crazygit.tikheart.utilities.LocalStorage | |
| object LocalRepository { | |
| private val localStorage = LocalStorage(TikHeartApplication.appContext) | |
| private val localUserDao = UserInfoDao(localStorage) |
| import androidx.test.ext.junit.runners.AndroidJUnit4 | |
| import com.google.android.gms.tasks.Task | |
| import com.google.common.truth.Truth.assertThat | |
| import com.google.firebase.database.DataSnapshot | |
| import com.google.firebase.database.DatabaseError | |
| import com.google.firebase.database.DatabaseReference | |
| import com.google.firebase.database.ValueEventListener | |
| import com.google.firebase.database.ktx.database | |
| import com.google.firebase.ktx.Firebase | |
| import org.junit.Before |
| #!/usr/bin/env bash | |
| # reffer: | |
| # https://medium.com/@acpanjan/download-google-drive-files-using-wget-3c2c025a8b99 | |
| file_name="youer_file_name" | |
| file_id="your_file_id" | |
| confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=${file_id}" -O-| sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p') | |
| wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=${confirm}&id=${field_id}" -O ${file_name} && rm -rf /tmp/cookies.txt |
| #!/bin/bash | |
| set -e | |
| # install dnsmasq | |
| brew install dnsmasq | |
| WORKDIR="$(mktemp -d)" | |
| SERVERS=(114.114.114.114 114.114.115.115 180.76.76.76) | |
| # Not using best possible CDN pop: 1.2.4.8 210.2.4.8 223.5.5.5 223.6.6.6 | |
| # Dirty cache: 119.29.29.29 182.254.116.116 |
| service_account_name="jenkins" # service account name, for example: jenkins | |
| namespace="default" # service account namespace, for example: default | |
| cluster_name="kubernetes" | |
| server="https://kubernetes.default.svc.cluster.local" | |
| ca_file="ca.crt" | |
| kube_config_file="$service_account_name.conf" | |
| token_name=$(kubectl get serviceaccount $service_account_name -n $namespace -o jsonpath="{.secrets[0].name}") | |
| token=$(kubectl get secret $token_name -n $namespace -o jsonpath="{.data.token}" | base64 -D) | |
| kubectl get secret $token_name -n $namespace -o jsonpath="{.data.ca\.crt}" | base64 -D > $ca_file |
| package com.example.anroid.testaescipher; | |
| import android.util.Base64; | |
| import java.io.UnsupportedEncodingException; | |
| import java.security.InvalidAlgorithmParameterException; | |
| import java.security.InvalidKeyException; | |
| import java.security.MessageDigest; | |
| import java.security.NoSuchAlgorithmException; | |
| import java.security.SecureRandom; |
| #!/usr/bin/env bash | |
| SERVER_ADDR="your_server_ip" | |
| SERVER_PORT="your_server_port" | |
| PASSWORD="your_password" | |
| METHOD="your_encrption_method" | |
| TIMEOUT=300 | |
| # socket5 协议端口1080 | |
| LOCAL_SCOKET_PORT=1080 |
| #!/usr/bin/env bash | |
| # 配置参考: | |
| # https://github.com/shadowsocks/shadowsocks-libev/blob/master/docker/alpine/README.md | |
| SERVER_ADDR="your_server_ip" | |
| SERVER_PORT="your_server_port" | |
| PASSWORD="your_password" | |
| METHOD="aes-256-cfb" | |
| TIMEOUT=300 |