Skip to content

Instantly share code, notes, and snippets.

Ma le spegnene?

Fabio Dragod

Ma le spegnene?
View GitHub Profile
Dragod /
Created Oct 27, 2022 — forked from justlaputa/
Jenkins Json API


jenkins_url + /api/json?tree=jobs[name,color]


jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]

last build

Dragod /
Created Oct 20, 2022 — forked from thereverand/
Install PowerShell Universal as a service on Linux
# ----
# This script will install PowerShell Universal on Linux as a service
# This has been tested on Ubuntu 20.04 (ARM64) on a Raspberry Pi 4
# ----
# Dependencies:
# wget
# unzip
# Make sure they are installed
# ----
Dragod / addClass.js
Created Jul 14, 2022
Vanilla js add class
View addClass.js
let addClass = (el = [], className= 'disnone') => {el.forEach(el => { return document.querySelector(el).classList.add(className) })}
addClass(['.login .homepageLogo','.cs-login-Instruct', '.sd-login', '.loginDisclaimer', '.login'])
Dragod /
Last active May 6, 2022
Reverting The Working Copy to an Older Commit
# Reverting The Working Copy to an Older Commit
# To revert to a commit that's older than the most recent commit:
# Resets index to former commit; replace '56e05fced' with your commit code
git reset 56e05fced
# Moves pointer back to previous HEAD
git reset --soft HEAD@{1}
Dragod /
Created Apr 24, 2022
Run searx with a cronjob using a sh script
sudo -H -u searx -i sh -c "cd /usr/local/searx/searx-src; python searx/"
Dragod / interfaces
Last active May 6, 2022
Proxmox network config
View interfaces
auto lo
iface lo inet loopback
auto enp4s0
iface enp4s0 inet manual
auto vmbr0
Dragod / Fix.json
Created Nov 8, 2021
Solve package-lock.json problems
View Fix.json
"scripts": {
"clean": "rm -Rf node_modules/ && rm -f ./package-lock.json && npm cache clean -f",
"clean_windows": "IF EXIST node_modules rd /s /q node_modules && IF EXIST package-lock.json DEL package-lock.json && npm cache clean -f",
"rebuild": "npm run clean && npm i",
"rebuild_windows": "npm run clean_windows && npm i"
View design-machine-installer.ps1
# Description: Screendragon Design install for new machine or new VM boot
# Author: Paniconi Fabio
# Last update: 29/10/2021
# Install Chocolatey, required to run the rest of the scripts
Write-Output "`r"
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(''))
Dragod / DevMachineSetup.ps1
Last active Oct 29, 2021
View DevMachineSetup.ps1
#Install WinGet
#Based on this gist:
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"") {
"Installing winget Dependencies"
Write-host "`r"
Add-AppxPackage -Path ''
$releases_url = ''
Dragod /
Last active Oct 5, 2021
Catch exexSync errors

If you want to get net wlan show profiles output no matter if it fails or not, you can use either asynchronous version of exec. The callback will have stdout set.

Or you can catch exception and get stdout from there. Something like:

let nestsh_output;
try {
  netsh_output = execSync('netsh wlan show profiles');
} catch (ex) {
 netsh_output = ex.stdout;