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
name: "Close stale issues" | |
on: | |
schedule: | |
- cron: "15 4 * * 1,3,5" | |
jobs: | |
stale: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/stale@v3 |
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
# Installation of a decent editor, emacs | |
$ sudo apt install emacs | |
# Prerequisites to build Python | |
$ sudo apt install make build-essential libssl-dev zlib1g-dev libbz2-dev \ | |
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ | |
xz-utils tk-dev libffi-dev liblzma-dev python-openssl | |
# Installation of pyenv | |
$ curl https://pyenv.run | bash |
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
sudo apt-get install -y build-essential | |
sudo apt-get install -y libssl-dev openssl # for pip | |
sudo apt-get install -y libsqlite3-dev # for sqlite | |
sudo apt-get install -y tk-dev # for tkinter | |
PYTHON_VERSION=3.6.1 | |
wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz | |
tar -xf Python-$PYTHON_VERSION.tar.xz | |
rm Python-$PYTHON_VERSION.tar.xz |
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
sudo -u postgres createuser <username> | |
sudo -u postgres createdb <database> | |
sudo -u postgres psql | |
psql (11.2 (Ubuntu 11.2-1)) | |
Type "help" for help. | |
postgres=# alter user <username> with encrypted password '<password>'; | |
ALTER ROLE | |
postgres=# grant all privileges on database <database> to <username>; | |
GRANT |
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
user_pref("beacon.enabled", false); | |
user_pref("browser.bookmarks.showRecentlyBookmarked", false); | |
user_pref("browser.ctrlTab.previews", true); | |
user_pref("browser.pocket.enabled", false); | |
user_pref("browser.search.geoip.url", ""); | |
user_pref("browser.search.showOneOffButtons", false); | |
user_pref("browser.search.suggest.enabled", false); | |
user_pref("browser.urlbar.trimURLs", false); | |
user_pref("browser.urlbar.formatting.enabled", false); | |
user_pref("datareporting.healthreport.service.enabled", false); |
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
# Run this script with one argument: | |
# ./newspipe-heroku.sh <name-of-your-newspipe-instance> | |
HEROKU_APP_NAME=$1 | |
git clone https://github.com/newspipe/newspipe.git | |
cd newspipe/ | |
heroku create $HEROKU_APP_NAME | |
heroku addons:add heroku-postgresql:hobby-dev | |
heroku config:set HEROKU=1 |
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/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import networkx as nx | |
import primo | |
from primo.linking.find_links import FindLinks | |
G = nx.DiGraph() |
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 sys, marshal, functools, subprocess | |
child_script = """ | |
import marshal, sys, types; | |
fn, args, kwargs = marshal.load(sys.stdin) | |
marshal.dump( | |
types.FunctionType(fn, globals())(*args, **kwargs), | |
sys.stdout) | |
""" |
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/sh | |
servername="Server" | |
for ip in echo `grep -i unban /var/log/fail2ban.log | awk '{print $NF}' | tail -n 10` | |
do | |
for email in `whois $ip | perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}' | sort | uniq` | |
do | |
echo "Sending email to $email..." | |
echo "Hi, |
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/env python | |
# -*- coding: utf-8 -*- | |
import json | |
import requests | |
# https://github.com/CIRCL/bgpranking-redis-api/tree/master/example/api_web/client | |
from bgpranking_web import api | |
with open("/var/log/fail2ban.log", "r") as f: |