This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# They stopped "source.unsplash.com" service | |
# So that script doesn't work anymore unfortunately ... | |
# If started as root, then re-start as user "gavenkoa": | |
if [ "$(id -u)" -eq 0 ]; then | |
exec sudo -H -u YOUR_USERNAME $0 "$@" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
const sidebar = document.querySelector('.sidebarWithSeparator') | |
if (sidebar) sidebar.remove() | |
const question = document.querySelector('[data-test="homepage-questions-card"]') | |
if (question) question.remove() | |
const containers = document.querySelectorAll('.layoutContainer') | |
if (containers.length == 2) { containers[0].remove() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# Inspired by https://gist.github.com/MrHamel/1b640a81ded45bfbac564d2fd4f9532c, but updated for Python3 | |
# Thanks! | |
# | |
import json, psutil | |
def update_top_info(): | |
top_data = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, datetime | |
STRIPE_PRIVATE_KEY='' # Indicate your Stripe private key here | |
params = { | |
'limit': 100, | |
'created[gte]': int(datetime.datetime(year=2022, month=1, day=1, hour=0, minute=0, second=0).timestamp()) # if you want to filter starting in the year 2022 | |
} | |
operations = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import argparse, glob, os | |
try: | |
from mutagen.easyid3 import EasyID3 | |
except ImportError: | |
print('"mutagen" package is required for this to work.') | |
print('Please install it using pip or any other package manager') | |
exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding:utf-8 -*- | |
# Parse the given requirements.txt file (defaults to the local one) and find updates from Pypi. | |
# Optional parameter "dry" will only show the changes without applying them. | |
from importlib.metadata import version | |
from importlib.metadata import PackageNotFoundError | |
from pkg_resources import Requirement | |
import requests, datetime, sys, subprocess, argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
""" | |
This scripts creates a new server listing at APP_PORT (default at 9001). | |
Can be put behind a Caddy server or directly facing the Internet by changing the APP_HOST value too | |
It receives a WEBHOOK request from Github, and based on the data, updates the local code if the push was made on the "prod" branch. | |
Then update the requirements.txt and update the database. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- config:utf-8 -*- | |
import boto3, asyncio, sys, os, datetime | |
def get_sa_max_children(default=12): | |
try: | |
options = None | |
with open('/etc/default/spamassassin', 'r') as f: | |
for line in f: | |
if line.find('OPTIONS=') == 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Warning: This file looses the direction of the value (LTR/RTL) | |
# | |
{ | |
"aa": "Afaraf", | |
"ab": "\u0410\u04a7\u0441\u0443\u0430", | |
"ae": "Avesta", | |
"af": "Afrikaans", | |
"ak": "Akan", | |
"am": "\u12a0\u121b\u122d\u129b", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const fs = require('fs'); | |
function pdfshift(api_key, data) { | |
return new Promise((resolve, reject) => { | |
let asJson = false | |
if ('filename' in data || 'webhook' in data) { | |
asJson = true | |
} |
NewerOlder