Skip to content

Instantly share code, notes, and snippets.

View CyberLine's full-sized avatar

Alexander Over CyberLine

View GitHub Profile
@ThomasLeister
ThomasLeister / mastodon-tootctl-media-purge.txt
Created February 21, 2019 19:07
How to automatically remove cached media files older that 7 days from your Mastodon instance
This is how to automatically delete cached image previews from your Mastodon instance if they are older than 7 days.
Log in as your "mastodon" User or log in as root and then change to the "mastodon" user, who runs Mastodon:
# su - mastodon
Open crontab:
$ crontab -e
... and add these lines to your crontab:
@Neo23x0
Neo23x0 / audit.rules
Last active March 11, 2025 10:24
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@jcollie
jcollie / commands
Created May 5, 2016 22:45
Ring.com integration with openHAB via IFTTT and my.openHAB
curl -X POST -H "Content-Type: text/plain" -d ON http://localhost:8080/rest/items/ring_front_door_motion
curl -X POST -H "Content-Type: text/plain" -d ON http://localhost:8080/rest/items/ring_front_door_ring
@denji
denji / nginx-tuning.md
Last active May 8, 2025 19:46
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@krakjoe
krakjoe / pthreads.md
Last active September 24, 2024 14:50
pthreads.md

Multi-Threading in PHP with pthreads

A Brief Introduction to Multi-Threading in PHP

  • Foreword
  • Execution
  • Sharing
  • Synchronization
  • Pitfalls
@yohgaki
yohgaki / php-pgsql-escape-literal.patch
Created November 20, 2011 23:49
php-trunk pg_escape_literal patch
Index: ext/pgsql/tests/08escape.phpt
===================================================================
--- ext/pgsql/tests/08escape.phpt (リビジョン 319557)
+++ ext/pgsql/tests/08escape.phpt (作業コピー)
@@ -11,8 +11,9 @@
// pg_escape_string() test
$before = "ABC\\ABC\'";
$expect = "ABC\\\\ABC\\'";
+$expect2 = "ABC\\\\ABC\\\\''"; //the way escape string differs from PostgreSQL 9.0
$after = pg_escape_string($before);
@CyberLine
CyberLine / gist:297979
Created February 8, 2010 08:11
Ubuntu 9.10 Upstart Script to switch xorg.conf on Dell D620/D630 based on docking status. Place in /etc/init/ as gdmswitch.conf and add this line to gdm.conf: "and started gdmswitch"
description "xorg.conf switch"
start on (filesystem
and runlevel [2345]
and started hal
and stopped udevtrigger)
stop on runlevel [016]
emits gdmswitch