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 python3 | |
from dataclasses import dataclass | |
from enum import Enum | |
from typing import List | |
from pystemd.systemd1 import Manager | |
@dataclass | |
class ServiceActiveState(str, Enum): |
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
<?php | |
// This file is silently disabled if not configured | |
if ( ! isset($config['sentry_dsn'])) | |
{ | |
return; | |
} | |
if (defined('SENTRY_LOADED')) | |
{ |
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 re | |
import nltk as nltk | |
from word2number import w2n | |
def replaceTextnumberWithNumber(text): | |
#print(f'-- BEFORE --\n{text}') | |
tagged_number_words = 'ten/CD thousand/CD nine/CD hundred/CD ninety/CD eight/CD seven/CD six/CD five/CD four/CD three/CD two/CD one/CD eighty/CD seventy/CD sixty/CD fifty/CD forty/CD thirty/CD twenty/CD nineteen/CD eighteen/CD seventeen/CD sixteen/CD fifteen/CD fourteen/CD thirteen/CD twelve/CD eleven/CD zero/CD' |
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
Not found: | |
2603 192.36.171.0/24 | |
2603 194.68.13.0/24 | |
6677 31.209.144.0/20 | |
6677 31.209.192.0/18 | |
6677 85.220.0.0/17 | |
6677 157.157.0.0/16 | |
6677 192.147.34.0/24 | |
6677 194.105.224.0/19 |
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
table inet filter { | |
chain inbound { | |
type filter hook input priority 0 | |
policy drop | |
ct state invalid counter drop | |
ct state { established, related } counter accept | |
ip protocol icmp counter accept | |
ip6 nexthdr ipv6-icmp counter accept |
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
from collections import defaultdict | |
import requests | |
import csv | |
import ipaddress | |
import datetime | |
print(f'# {datetime.datetime.utcnow()}') | |
assignmentsFile = requests.get('https://www.iana.org/assignments/ipv6-unicast-address-assignments/ipv6-unicast-address-assignments.csv') | |
assignmentsFile.raise_for_status() |
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
# Switch sha512 out for any other if you want | |
# Use hexdigest if you want a "normal" hex version of the digest | |
def hashFile(path): | |
with open(path, 'r') as fh, mmap.mmap(fh.fileno(), 0, prot=mmap.PROT_READ) as map: | |
return hashlib.sha512(map).digest() |
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/python3 | |
''' | |
The script looks for a line similar to: | |
PublicKey=eP5bTA845m1hTnp0bjgFnw4efn+NHQ7WrXVwVmffwhY= | |
Then it goes back one line and uses that if it is a comment | |
# Example comment | |
Example file content |
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
<?php | |
define(LDAP_OPT_DIAGNOSTIC_MESSAGE, 0x0032); | |
$handle = ldap_connect('ldap://9.0.0.1'); | |
$bind = ldap_bind($handle, '[email protected]', 'super good password'); | |
if ( ! $bind) | |
{ | |
if (ldap_get_option($handle, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extended_error)) |
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
<?php | |
/** | |
* Observium | |
* | |
* This file is part of Observium. | |
* | |
* @package observium | |
* @subpackage authentication | |
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited |
NewerOlder