Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Michael Brown Supermathie

🏠
Working from home
Block or report user

Report or block Supermathie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Supermathie
Supermathie / mk_new_swap
Created Apr 22, 2014
add a 512MB swapfile
View mk_new_swap
#!/bin/bash -e
# This script adds a 512MB swapfile to the system
function get_new_swapfile() {
for i in `seq 0 99`; do
if [ ! -e /swapfile.$i ]; then
echo /swapfile.$i
return
fi
View hb-test.py
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@Supermathie
Supermathie / parseCSV.py
Created Apr 14, 2014
python CSV example
View parseCSV.py
#!/usr/bin/env python
import csv
import sys
from pprint import pprint
csvreader = csv.reader(sys.stdin)
# Read the header line and extract the column names
header = csvreader.next()
@Supermathie
Supermathie / client config
Last active Aug 29, 2015
salt master config
View client config
ipc_mode: tcp
master: orchestrator.netdirect.ca
root_dir: c:\salt
pki_dir: /conf/pki/minion
id: win7-salt
multiprocessing: False
View gist:9770293
Microsoft IVR: "What would you like assistance with?"
Me: "Office Activation"
Microsoft IVR: "I'm sorry, I couldn't hear you." *Goes back to the very beginning*
...
Microsoft IVR: "What would you like assistance with?"
Me: "Penile Dysfunction"
Microsoft IVR: "OK, I'll get someone on the line."
View gist:9560149
Since the most likely thing I expect to trip up on tomorrow will be selinux, here are some quick notes on it for everyone else as well:
# check selinux audit log
$ sudo seaudit-report /var/log/audit/audit.log
...
Jan 14 14:46:23 (null) (null): audit(1389728783.896:402159): avc: denied { read } for pid=10210 comm=zabbix_server name=SNMPv2-MIB ino=5246 dev=dm-5 scontext=unconfined_u:system_r:zabbix_t:s0 tcontext=unconfined_u:object_r:var_lib_t:s0 tclass=file
...
# hmmm zabbix server can't read the SNMP MIBs. What can he read?
$ sesearch --allow -R -s zabbix_t
View gist:7996969
Description of problem:
A specific customer workload is causing abnormally high system load on RHEL6, whereas the code did not cause the same under RHEL4. The abnormal load relates to the dnotify / inotify subsystems.
Version-Release number of selected component (if applicable):
Tests run on 2.6.32-279.2.1.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
@Supermathie
Supermathie / sample 1
Last active Dec 30, 2015
raw test data
View sample 1
<html><head></head><body data-blackberry-caret-color=3D"#00a8df" style=3D"b=
ackground-color: rgb(255, 255, 255); line-height: initial;"><div id=3D"BB10=
_response_div" style=3D"width: 100%; font-size: initial; font-family: Calib=
ri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; =
background-color: rgb(255, 255, 255);">Let's remember that the information =
in the article was filtered through no less than two people who don't fully=
speak tech. I think I can translate it back:</div> =
=
<div id=3D"response_div_spacer" style=3D"=
width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-se=
View Pending Windows Updates
Cumulative Security Update for ActiveX Killbits for Windows Server 2008 R2 x64 Edition (KB2900986)
Cumulative Security Update for Internet Explorer 10 for Windows Server 2008 R2 Service Pack 1 for x64-based Systems (KB2888505)
Microsoft .NET Framework 4.5.1 for Windows Server 2008 R2 x64-based Systems (KB2858725)
Security Update for Windows Server 2008 R2 x64 Edition (KB2647170)
Security Update for Windows Server 2008 R2 x64 Edition (KB2772930)
Security Update for Windows Server 2008 R2 x64 Edition (KB2853587)
Security Update for Windows Server 2008 R2 x64 Edition (KB2862152)
Security Update for Windows Server 2008 R2 x64 Edition (KB2868626)
Security Update for Windows Server 2008 R2 x64 Edition (KB2868725)
Security Update for Windows Server 2008 R2 x64 Edition (KB2875783)
View gist:7456603
decimal hex chr name
------- ----- --- ----------------------------------------
768 300 ̀ Combining Grave Accent
769 301 ́ Combining Acute Accent
770 302 ̂ Combining Circumflex Accent
771 303 ̃ Combining Tilde
772 304 ̄ Combining Macron
773 305 ̅ Combining Overline
774 306 ̆ Combining Breve
775 307 ̇ Combining Dot Above
You can’t perform that action at this time.