Skip to content

Instantly share code, notes, and snippets.

View noskla's full-sized avatar
🏳️‍⚧️

Jarosław noskla

🏳️‍⚧️
View GitHub Profile
const fs = require('fs');
const process = require('process');
const { authenticate } = require('@google-cloud/local-auth');
const { google } = require('googleapis');
const SCOPES = ['https://www.googleapis.com/auth/drive'];
const credentials = JSON.parse(fs.readFileSync('./clientsecret.json'));
console.log('Auth...')
@noskla
noskla / akkoma_backup.sh
Created August 25, 2023 01:30
Backup script for Docker release of Akkoma (akkoma.social)
#!/bin/bash
date_today=$(date +"%d_%m_%Y")
akkoma_workdir="/home/$USER/akkoma"
akkoma_db_img_name="akkoma-db"
backup_temp_dir="/home/$USER/backup_tmp"
backup_zip_dir="/home/$USER/backups"
# check working directory
echo "Verifying working directory..."
@noskla
noskla / dl.sh
Created August 19, 2023 21:34
archiwizacja ŚWK (ipla cdn)
#!/bin/bash
REGEX_URL="https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)"
PASTEBIN_DATA="$(curl https://pastebin.pl/view/raw/0ce85bfa 2>/dev/null)"
# Create the out directory if not exists
mkdir -p dl_output
while [[ ${PASTEBIN_DATA} =~ (${REGEX_URL}) ]]; do
# HTTPS enforce
@noskla
noskla / temp.sh
Created December 14, 2019 15:30
Bash script for my OpenBSD server that shows the CPU temperature and alerts me when it's getting too hot for my likings.
#!/bin/sh
if [ "$USER" != "root" ]; then
echo "Not running as root. PC speaker disabled.";
fi
while :; do
TEMP=$(sysctl -a | grep "hw.sensors");
TEMPRAW=${TEMP%".00 degC"*};
// ==UserScript==
// @name z0r.de download button
// @include https://z0r.de/*
// @version 1
// @grant none
// ==/UserScript==
window.addEventListener('load', function(){
// New element
@noskla
noskla / uchrstex.py
Last active May 6, 2019 12:09
Simple script that makes installing extensions from Chrome Store to Ungoogled Chromium a bit less of a headache
#!/usr/bin/python3
# Ungoogled Chromium webstore extensions install utility
# Made by _kana ( http://cyberhangar.org )
import sys, urllib.request, urllib.parse, subprocess, os, re
_cfg = {
# Download directory (without / on the end). Make sure that you have read, write permissions.
# Leave empty to download to script's working directory.
#!/usr/bin/python3
import requests, sys, os
zorde_flash_url = 'https://z0r.de/L/z0r-de_{}.swf'
flashes_count = 7911 # as of 07.08.2018
request_headers = {
'User-Agent': 'NotABot/1.0 (Just archiving on my disk don\'t ban me thanks.)'
}
@noskla
noskla / typing_speed_calculator.py
Created August 23, 2018 22:03
Made this because I was bored.
#!/usr/bin/python3
import time, random
sentences = [
'Is there a time limit on fortune cookie predictions?',
'I know the voices in my head aren\'t real, but sometimes their ideas just absolutely awesome!',
'I got a job at a bakery because I kneaded dough.',
'“Work fascinates me” I can look at it for hours!',
'How come cats butts go up when you pet them?',
@noskla
noskla / z0rdeonwaterfox.js
Last active August 8, 2018 18:51
Tampermonkey script that makes z0r.de work on Waterfox.
// ==UserScript==
// @name z0rdeOnWaterfox
// @namespace http://tampermonkey.net/
// @version 1.0
// @description makes z0r.de work on waterfox
// @author Noone
// @match https://*.z0r.de/*
// @grant none
// ==/UserScript==
@noskla
noskla / bookmark.js
Created July 14, 2018 12:58
Vidlii video downloader, https://www.vidlii.com/
javascript:window.location=document.getElementsByTagName('video')[0].src;
/* Create a new bookmark and put this code in the URL. When you're on Vidlii video website you can just click on that bookmark
and it will easily let you download the video. Will work only with HTML5 players. */