Skip to content

Instantly share code, notes, and snippets.

View fepitre's full-sized avatar

Frédéric Pierret fepitre

  • France
View GitHub Profile
# Prep
echo "lorbus" > ~/.fedora.upn
ssh-keygen
# Add the created public key on https://admin.fedoraproject.org/accounts (and pagure.io)
# Create src.fp.o API key on web interface and save locally (Valid 60 Days)
cat <<EOF > ~/.config/rpkg/fedpkg.conf
[fedpkg.pagure]
token = <token_here>
EOF
@fepitre
fepitre / NoVNC_Paste.js
Created April 22, 2023 09:01 — forked from byjg/NoVNC_Paste.js
How to Paste code to NoVNC.
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
window.sendString = function (str) {
f(str.split(""));
function f(t) {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);
@fepitre
fepitre / noVNCCopyPasteProxmox.user.js
Created April 22, 2023 09:01 — forked from amunchet/noVNCCopyPasteProxmox.user.js
Copy/Paste for noVNC Proxmox
// ==UserScript==
// @name noVNC Paste for Proxmox
// @namespace http://tampermonkey.net/
// @version 0.2a
// @description Pastes text into a noVNC window (for use with Proxmox specifically)
// @author Chester Enright
// @match https://*
// @include /^.*novnc.*/
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @grant none
@fepitre
fepitre / qvm-portfwd-iptables
Last active February 1, 2024 12:49 — forked from Joeviocoe/qvm-portfwd-iptables
Qubes-os port forwarding to allow external connections
#!/bin/bash
# Frédéric Pierret <frederic.pierret@qubes-os.org>
# Adapted from previous work:
# - https://gist.github.com/daktak/f887352d564b54f9e529404cc0eb60d5
# - https://gist.github.com/jpouellet/d8cd0eb8589a5b9bf0c53a28fc530369
# - https://gist.github.com/Joeviocoe/6c4dc0c283f6d6c5b1a3f5af8793292b
[ "$DEBUG" = 1 ] && set -x
@fepitre
fepitre / jenkins-api-examples
Created January 20, 2018 17:32 — forked from marshyski/jenkins-api-examples
Jenkins trigger, create and remove jobs and folders
# check if job exists
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken
# with folder plugin
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# without folder plugin
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# create folder
@fepitre
fepitre / CreateJob.sh
Created January 20, 2018 17:30 — forked from stuart-warren/CreateJob.sh
Create a job in Jenkins (or folder) using the HTTP API
# check if job exists
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken
# with folder plugin
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# without folder plugin
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# create folder