使用echo $XDG_SESSION_TYPE
即可得知是x11
還是wayland
。
KDE登入畫面SDDM左下角點選Plasama (Wayland)
工作階段
GNOME 42後已預設使用GNOME,登入時GDM右下角齒輪會有GNOME
與GNOME on Xorg
的選項。
#!/bin/bash | |
certificat=/usr/certificate/example.com/cert.pem | |
gotify_url="https://push.example.com/message?token=xxxxx" | |
gotify_title="Synology Certificate Expiry" | |
function check_certificat () { | |
if openssl x509 -checkend $((${1}*86400)) -noout -in $certificat; then | |
return 1 | |
else |
import requests | |
def doi2bib(doi): | |
""" | |
Return a bibTeX string of metadata for a given DOI. | |
""" | |
url = "http://dx.doi.org/" + doi | |
headers = {"accept": "application/x-bibtex"} |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
Dir.glob("#{ENV['HOME']}/Library/Application Support/Viscosity/OpenVPN/*/config.conf").each do |file| | |
certificate_files = ['ca', 'cert', 'key', 'tls-auth'] | |
config_dir = File.dirname(file) | |
connection_name = nil | |
new_config = [] | |
File.read(file).lines.each do |line| | |
line.strip! | |
if line.start_with?('#viscosity name') |
#!groovy | |
/* | |
* This script configures the Jenkins base URL. | |
*/ | |
import jenkins.model.JenkinsLocationConfiguration | |
JenkinsLocationConfiguration location = Jenkins.instance.getExtensionList('jenkins.model.JenkinsLocationConfiguration')[0] | |
location.url = 'https://jenkins-as-code-poc.devtail.io/' |
#!/bin/node | |
import { SignJWT } from "jose" | |
import { createPrivateKey } from "crypto" | |
if (process.argv.includes("--help") || process.argv.includes("-h")) { | |
console.log(` | |
Creates a JWT from the components found at Apple. | |
By default, the JWT has a 6 months expiry date. | |
Read more: https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens#3262048 |