Skip to content

Instantly share code, notes, and snippets.

View scysys's full-sized avatar
💩
I may be slow to respond.

Sven scysys

💩
I may be slow to respond.
  • Germany
  • 01:06 (UTC +02:00)
View GitHub Profile
@scysys
scysys / mysql_in_out.sh
Created August 12, 2023 19:08
MySQL Remote Access Control Script using CSF
#!/bin/bash
###
# MySQL Remote Access Control Script
# This script generates lists of allowed remote IP addresses for incoming and outgoing MySQL connections,
# taking into account both IPv4 and IPv6 addresses. It then updates the firewall rules using CSF.
#
# Usage: This script is meant to be scheduled to run periodically, e.g., using cron.
#
# Source: https://gist.github.com/scysys/21994b8ec478c799fbdbbbd1ac5fb58c
@scysys
scysys / modify_network.py
Created August 12, 2023 16:09
Packet Payload Modification for Network Traffic
#!/usr/bin/env python3
from netfilterqueue import NetfilterQueue
import scapy.all as scapy
# Configuration variables
original_keyword = b"search"
modified_keyword = b"replace"
def modify_packet(packet):
scapy_packet = scapy.IP(packet.get_payload())
// This is a minimal example demonstrating live streaming.
//
// To run:
//
// flutter run -t lib/example_radio.dart
import 'package:audio_session/audio_session.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:just_audio/just_audio.dart';
@scysys
scysys / gist:1a464a26d155dba560a64d13d37f6322
Created March 27, 2019 11:31
Bootstrap 4: Restore the former "hidden-*" styles known from Bootstrap 3
/*\
* Restore Bootstrap 3 "hidden" utility classes.
\*/
/* Breakpoint XS */
@media (max-width: 575px)
{
.hidden-xs-down, .hidden-sm-down, .hidden-md-down, .hidden-lg-down, .hidden-xl-down,
.hidden-xs-up,
.hidden-unless-sm, .hidden-unless-md, .hidden-unless-lg, .hidden-unless-xl
@scysys
scysys / letsencrypt-hostname.sh
Last active August 24, 2017 13:54 — forked from xgin/letsencrypt-hostname.sh
Secure Plesk installation with hostname certificate by Let's Encrypt
#!/bin/bash -e
### Copyright 1999-2015. Parallels IP Holdings GmbH. All Rights Reserved.
### Secure plesk clean installation with hostname certificate by Let's Encrypt
export PYTHONWARNINGS="ignore:Non-standard path"
LE_HOME=${LE_HOME:-"/usr/local/psa/var/modules/letsencrypt"}
HOSTNAME=$(hostname)
# Use staging server for testing
# --server https://acme-staging.api.letsencrypt.org/directory
@scysys
scysys / gist:51e91e0ee858f303d3319dc16d81f897
Last active June 30, 2017 13:33
PCPIN Chat / IP filter not configured (fix)
DROP TABLE IF EXISTS `pcpin_ipfilter`;
CREATE TABLE `pcpin_ipfilter` (
`id` int(11) NOT NULL,
`address` varchar(45) CHARACTER SET ascii NOT NULL DEFAULT '',
`added_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`expires` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`description` text NOT NULL,
`action` enum('d','a') NOT NULL DEFAULT 'd',
`type` varchar(4) CHARACTER SET ascii COLLATE ascii_bin NOT NULL DEFAULT 'IPv4'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0;
@scysys
scysys / gist:c98f3efb86de92b75489
Created July 18, 2015 14:20
Wordpress String Translate
function stringtranslate_filter_gettext( $translated, $original, $domain ) {
$strings = array(
'Post Comment' => 'Hinterlassen Sie eine Antwort',
);
if ( isset( $strings[$original] ) ) {
$translations = &get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}
return $translated;
}