Skip to content

Instantly share code, notes, and snippets.

@asiellb
asiellb / jackett.md
Created April 4, 2021 19:51 — forked from wilmardo/jackett.md
Jackett add public indexers all in one go

Source: Jackett/Jackett#1576 (comment)

From the Jackett page, click the "add indexer" button so that the pop up window with the full list of indexers appears.

You'll then need to open your browser's development toolbar (in Chrome just hit F12) and go to the JavaScript Console and enter the following:

////hack to add all free indexers in Jackett
$(document).ready(function () {
	EnableAllUnconfiguredIndexersList();
@asiellb
asiellb / table-to-json.js
Created March 15, 2021 23:09 — forked from johannesjo/table-to-json.js
Snippet to convert html table to json (to be used with google chrome or similiar)
function tableToJson(table) {
var data = [];
// first row needs to be headers
var headers = [];
for (var i=0; i<table.rows[0].cells.length; i++) {
headers[i] = table.rows[0].cells[i].innerHTML.toLowerCase().replace(/ /gi,'');
}
// go through cells
@asiellb
asiellb / app.js
Created March 15, 2021 05:06 — forked from FSDevelop/app.js
Read/write xls files with Nodejs
var express = require('express');
var Excel = require('exceljs');
var app = express();
app.listen(3000, function() {
console.log('Trying to read a xlsx file on port 3000...');
var workbook = new Excel.Workbook();
var filename = 'InputFile.xlsx';
const COL = 'B';
@asiellb
asiellb / old_file_killer.rb
Created March 1, 2021 06:56 — forked from pelgrim/old_file_killer.rb
A Ruby script to delete files older than X days in a given directory.
#!/usr/bin/env ruby
# A Ruby script to delete files older than X days in a given directory. Pretty simple.
# Like this: file_control.rb /User/pelgrim/Documents '*.pdf' 7
# The command above you remove ALL your pdfs inside Documents older than SEVEN DAYS.
# Quickly written by pelgrim < guskald at gmail dot com >
unless ARGV.size == 3
puts "Usage: file_control <directory> <filename pattern> <max age>"
exit 1
@asiellb
asiellb / remove-old-files.sh
Created March 1, 2021 06:53 — forked from rponte/remove-old-files.sh
Shell script to remove (delete) old files
# removes files older than 10 days under specific dir
find /my/dir -mtime +10 -type f -delete
# another example: deleting files older than 2 days under current dir
find . -mtime +2 -type f -delete
# deleting files older than 5h (5*60min=250min) under current dir
find . -mmin +250 -type f -delete
@asiellb
asiellb / removeOlderThanDays.sh
Created March 1, 2021 06:51 — forked from hatifnatt/removeOlderThanDays.sh
Simple script to delete files older than specific number of days from FTP
#!/bin/bash
# Simple script to delete files older than specific number of days from FTP. Provided AS IS without any warranty.
# This script use 'lftp'. And 'date' with '-d' option which is not POSIX compatible.
# FTP credentials and path
FTP_HOST="ftp.host.tld"
FTP_USER="usename"
FTP_PASS="password"
FTP_PATH="/ftp/path"
# Full path to lftp executable
@asiellb
asiellb / compact.py
Created January 28, 2021 00:45 — forked from Xion/compact.py
PHP compact() function in Python
def compact(*args):
''' compact() function, analoguous to the PHP version.
Converts a series of (possible nested) iterables containing variable names
into a dictionary mapping those names to variable values.
Example:
>>> x, y, z, a, b, c = 1, 2, 3, 4, 5, 6
>>> compact('x', ['y','z'], ['a', ['b'], [['c']]])
{'a': 4, 'b': 5, 'c': 6, 'x': 1, 'y': 2, 'z': 3}
'''
def _compact_arg(res, arg):
@asiellb
asiellb / daemon.js
Created January 4, 2021 06:00 — forked from kumatch/daemon.js
Node.js daemon example
var fs = require('fs');
var INTERVAL = 1000;
var cycle_stop = false;
var daemon = false;
var timer;
process.argv.forEach(function (arg) {
if (arg === '-d') daemon = true;