Skip to content

Instantly share code, notes, and snippets.

View alanorth's full-sized avatar

Alan Orth alanorth

View GitHub Profile
@alanorth
alanorth / datacenter-networks.tsv
Created April 16, 2025 07:34
Generate list of bot networks for nginx mapping
12876 (AS12876 - SCALEWAY S.A.S.)
132203 (TENCENT-NET-AP-CN Tencent Building)
13238 (YANDEX - YANDEX LLC)
136907 (HWCLOUDS-AS-AP HUAWEI CLOUDS)
14061 (DIGITALOCEAN-ASN)
14618 (AMAZON-AES)
16276 (OVH - OVH SAS)
16509 (AMAZON-02)
203020 (HOSTROYALE - HostRoyale Technologies Pvt Ltd)
204287 (HOSTROYALE_TECHNOLOGIES - HostRoyale Technologies Pvt Ltd)
@alanorth
alanorth / dspace-handle-server.service
Created April 11, 2025 09:52
/etc/systemd/system/dspace-handle-server.service
[Unit]
Description=DSpace Handle Server
# Only run if the DSpace Handle server is configured on this host
ConditionDirectoryNotEmpty=/home/cgspace.cgiar.org/handle-server
[Service]
Type=forking
User=dspace
ExecStart=/home/cgspace.cgiar.org/bin/start-handle-server
@alanorth
alanorth / ooniprobe-run.timer
Created April 3, 2025 07:10
~/.config/systemd/user/ooniprobe-run.service
[Unit]
Description=Run ooniprobe
[Service]
# https://www.ctrl.blog/entry/systemd-service-hardening.html
ProtectHome=read-only
ProtectKernelTunables=true
ProtectSystem=strict
PrivateDevices=true
PrivateTmp=true
@alanorth
alanorth / jellyfin.container
Created March 14, 2025 16:43
~/.config/containers/systemd/jellyfin.container
[Container]
Image=docker.io/jellyfin/jellyfin:latest
AutoUpdate=registry
PublishPort=8096:8096/tcp
UserNS=keep-id
Environment=TZ=Africa/Nairobi
AddDevice=/dev/dri/:/dev/dri/
Volume=jellyfin-config:/config:Z
Volume=jellyfin-cache:/cache:Z
Volume=/srv/video:/srv/video:ro
@alanorth
alanorth / chrome-104-ips.csv
Created October 23, 2024 13:15
Chrome 104 IPs
ip org network asn country
103.221.57.100 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.101 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.102 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.105 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.106 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.107 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.113 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.115 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.116 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
@alanorth
alanorth / curation.log
Created April 23, 2024 12:49
Log of curations during workflow submission, step 2 (editor), and step 3 (final editor)
2024-04-23 12:44:00,166 INFO e8f31038-977a-41d3-9ce3-c8f213c12691 7eca3e82-151a-421a-bda6-b2071df437b3 org.dspace.curate.Curator @ Curation task: normalizedois performed on: workflow item: 61ad243b-18a2-4691-a4e0-f90eb6b42ece with status: 0. Result: 'Normalized 1 DOI(s)'
2024-04-23 12:44:00,167 INFO e8f31038-977a-41d3-9ce3-c8f213c12691 7eca3e82-151a-421a-bda6-b2071df437b3 org.dspace.curate.XmlWorkflowCuratorServiceImpl @ Curation tasks over item 61ad243b-18a2-4691-a4e0-f90eb6b42ece for step editstep report:%nNormalized 1 DOI(s)All DOIs already normalizedAll DOIs already normalizedAll DOIs already normalizednull: added 2 alpha2 country code(s)Normalized 1 DOI(s)
2024-04-23 12:46:28,096 INFO e8f31038-977a-41d3-9ce3-c8f213c12691 8b975b71-6f76-4ac3-b5c7-52aa4cdd1e3f org.dspace.curate.Curator @ Curation task: normalizedois performed on: workflow item: 61ad243b-18a2-4691-a4e0-f90eb6b42ece with status: 0. Result: 'All DOIs already normalized'
2024-04-23 12:46:28,096 INFO e8f31038-977a-41d3-9ce3-c8f213c12691 8b97
#!/usr/bin/env bash
# run in batch CPU priority, with low-priority IO
rsync_command="chrt -b 0 ionice -c2 -n7 /usr/bin/rsync -av --delete"
rsync_output="start"
until [[ "$rsync_output" == "done" ]]
do
# notice the trailing slash on the rsync source argument
results_rsync=$($rsync_command /home/dspace/solr/ /home/backup/solr)
@alanorth
alanorth / solr.service
Created November 24, 2023 09:05
systemd unit for solr
[Unit]
Description=Solr 8.11.2
After=network.target
[Service]
Type=simple
WorkingDirectory=/var/solr
PIDFile=/var/solr/solr-8983.pid
Environment=SOLR_PID_DIR=/var/solr
@alanorth
alanorth / authentication-ldap.cfg
Created September 28, 2023 05:49
DSpace 7 authentication-ldap.cfg
#---------------------------------------------------------------#
#------------LDAP AUTHENTICATION CONFIGURATIONS-----------------#
#---------------------------------------------------------------#
# Configuration properties used by the LDAP Authentication #
# plugin, when it is enabled. #
#---------------------------------------------------------------#
#
# If LDAP is enabled, then new users will be able to register
# by entering their username and password without being sent the
@alanorth
alanorth / dspace7_harvest_test.py
Created August 22, 2023 06:58
Test harvesting 106,000 items from the DSpace 7 REST API
#!/usr/bin/env python3
import signal
import requests
def signal_handler(signal, frame):
sys.exit(1)