Skip to content

Instantly share code, notes, and snippets.

View pcanilho's full-sized avatar

Paulo Canilho pcanilho

View GitHub Profile
@pcanilho
pcanilho / truenas-kubectl.md
Created June 6, 2024 21:32 — forked from indrekj/truenas-kubectl.md
How to acccess TrueNAS kubectl remotely?

How to acccess TrueNAS kubectl remotely from your local computer?

DISCLAIMER: This is an unofficial guide. If you mess things up then you may lock yourself out of TrueNAS or even worse, make it unusable. There's also no guarantee that this works in the future.

Through SSH

Currently the easiest way to access kubectl is through ssh and k3s tool. If you have ssh access enabled then you can ssh to your TrueNAS server and use it

@pcanilho
pcanilho / windows-ssh-no-password-with-keys-wsl2.md
Created February 1, 2024 14:33 — forked from adamelliotfields/windows-ssh-no-password-with-keys-wsl2.md
Windows SSH Server with Password-less Key Authentication and Default WSL2 Shell

Windows SSH Server with Password-less Key Authentication and Default WSL2 Shell

Disclaimer: I am not a Windows Admin and I'm not even that good with PowerShell.

I wanted to be able to SSH into my Windows laptop directly into Linux. I also wanted to disable password authentication and only allow public key (RSA in my case) authentication.

Scott Hanselman wrote a blog post on how to make your default WSL2 distro your default shell for SSH. Windows OS Hub published an article on using public key

import jenkins.model.*
import hudson.model.ModelObject
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey
import com.cloudbees.jenkins.plugins.awscredentials.AWSCredentialsImpl
import org.jenkinsci.plugins.plaincredentials.StringCredentials
import org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl
import com.cloudbees.hudson.plugins.folder.Folder
@pcanilho
pcanilho / TrueNas12.xSetup.md
Created April 5, 2023 17:41 — forked from cadavor/TrueNas12.xSetup.md
Ultimate TrueNas 12 Setup Guide

TrueNAS 12.x

WARNING READ THIS: This page contains incomplete and possibly incorrect info. The page is constantly being edited and worked on. Many of these should work but some may be broken. Read the code carefully to understand what you are doing, stuff may be need to be changed for your own use. These include but are not limited to JAIL AND ROUTER IPs, YOUR FREENAS MAIN VOLUME, THE MOST RECENT RELEASE OF DOWNLOADED FILES. Use at your own risk.

Thanks to the creator of this guide https://forums.freenas.org/index.php?resources/fn11-1-iocage-jails-plex-tautulli-sonarr-radarr-lidarr-jackett-ombi-transmission-organizr.58/

#!/bin/sh
# Script for automatic installation mediaserver on TrueNAS:
# Torrent client, Sonarr, Radarr, Lidarr and some support programs.
# Create new TrueNAS jail using "Advanced jail creation".
# Ensure for switch on jail flag allow_mlock (REQUIRED)
# Jail flag allow_raw_sockets is helpful for troubleshooting (e.g. ping, traceroute)
# Setup jail's mountpoints.
@pcanilho
pcanilho / aws_polipo.md
Created June 3, 2022 13:39 — forked from pahud/aws_polipo.md
run AWS CLI via polipo to forward http proxy to socks5 proxy
# run polipo in daemon mode
$ sudo polipo socksParentProxy=localhost:1080 daemonise=true

# alias the aws cmd or set in your ~/.bash_profile
$ alias aws='HTTPS_PROXY=http://127.0.0.1:8123 /usr/local/bin/aws'
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/polipo/polipo_1.1.1-8_amd64.deb
sudo dpkg -i polipo_1.1.1-8_amd64.deb

Installing FlareSolverr in FreeBSD or FreeNAS/TrueNAS jail

FlareSolverr is a proxy server to bypass Cloudflare protection.

I found it while looking for a way to fix a problem: my Jackett installation one day started to give errors when trying to access 1337x. You got the point...

Here are the instructions in order to get FlareSolverr configured and running at boot in a FreeBSD system or in a FreeNAS/TrueNAS jail (which is my case, by the way).

This works only for version 2.1.0. For version 2.2.0, I was unable to make it work. I'm sorry.

@pcanilho
pcanilho / config.fish
Created November 17, 2021 11:09 — forked from kppullin/config.fish
Fish shell + WSL2 + gnome-keyring / secret-tool
#
# This fish config sets up a working `gnome-keyring` on WSL2.
# I imagine it will work with WSL1 as well, perhaps after adjusting the `DISPLAY` value.
#
# Based off this bash script: https://askubuntu.com/questions/815327/running-gnome-keyring-on-wsl-windows-subsystem-for-linux
# Tested and working with `aws-vault` and `jetbrains-toolbox`.
#
# Be sure your x server is running!!!
set -x DISPLAY (cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
@pcanilho
pcanilho / pipeline.gdsl
Created July 2, 2021 11:33 — forked from ggarcia24/pipeline.gdsl
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')