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
/* | |
* Author: Peter Maynard (pete[at]port22[co/uk]) | |
* Date: 2023 September 04 | |
* Summary: | |
* Serialises a structure and writes to disk as a file. | |
* The data can be read back in and accessed as a normal | |
* struct. | |
* | |
* The data stored on disk is plain text so be careful | |
* where you store it |
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
# Copyright 2019 Gentoo Authors | |
# Distributed under the terms of the GNU General Public License v2 | |
EAPI=7 | |
PYTHON_COMPAT=( python2_7 python3_5 python3_6 python3_7 ) | |
inherit distutils-r1 | |
DESCRIPTION="Reference homeserver for the Matrix decentralised comms protocol" |
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 !! | |
sudo ./laf | |
[sudo] password for osaka: | |
[>] Allowing traffic to 443 | |
from * | |
[>] Allowing traffic to 80 | |
from * | |
[>] Allowing traffic to * | |
from 127.0.1.1 | |
[>] Allowing traffic to * |
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/python | |
# pip install --upgrade google-api-python-client | |
import urllib2 | |
import json | |
import time | |
import subprocess | |
from apiclient.discovery import build | |
from apiclient.errors import HttpError |
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
pandoc --toc \ | |
--toc-depth=4 \ | |
--bibliography=../MyLibrary.bib \ #bittext file | |
--filter pandoc-citeproc \ | |
--csl=ieee.csl \ # referrence format | |
--number-sections \ | |
--template style/template.tex \ # latex template optional | |
-V documentclass=report \ | |
-V papersize=a4paper \ | |
-V fontsize=12pt \ |
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/bash | |
FILE="file.md" | |
COUNT=$(wc -w -l -c -m "$FILE" | tr -s ' ' | sed 's/^//' | sed 's/ /,/g' | cut -b 2- ) | |
DATETIME=$(date +%Y-%m-%d-%H-%M) | |
echo $COUNT,$DATETIME >> "tracker.csv" |
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/python | |
## sudo apt-get install python-networkx python-pydot | |
# Converts from tab indented lines to graph modelling language (GML) | |
# Example indented lines: | |
# | |
# Duqu 2.0 : SAND | |
# Spear-phishing : SAND | |
# Exploit CVE-2014-4148 : SAND | |
# Target downloads and opens word document : SAND |
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 | |
### BEGIN INIT INFO | |
# Provides: xmpp-443 | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: socat port forward 443 -> 5222 | |
# Description: Forwards data from port 443 to port 5222 using socat. | |
### END INIT INFO |
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
# Create a screened bash instance. | |
screen -S term01 bash | |
# Open a new terminal window and send the command 'ls\n' - the newline runs the command. | |
screen -S term01 -p 0 -X stuff "ls\n" | |
# -S <name> is the screen name | |
# -p 0 - tells it to use the first window, there can be more than one. (Default one) | |
# -X stuff '<cmd>' - Send the specified command to a running screen session. |
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 lxml import etree | |
import csv, argparse | |
def readData(data_file, listop=False): | |
if listop: | |
data = [] | |
else: | |
data = set() | |
with open(data_file, 'rb') as f: | |
reader = csv.reader(f) |
NewerOlder