Skip to content

Instantly share code, notes, and snippets.

View CanadianJeff's full-sized avatar

Jeffery Wilkins CanadianJeff

  • Vancouver BC CANADA
View GitHub Profile
@CanadianJeff
CanadianJeff / clean_apachelogs.sh
Created November 15, 2015 06:17
Clean cPanel Apache Logs
#!/bin/bash
echo "Stopping HTTPD"
service httpd stop &>/dev/null
killall httpd &>/dev/null
rm -rf /tmp/sess_*
find /home/share -name 'error_log' -exec rm -rf {} \;
find /home/*/public_html -name 'error_log' -exec rm -rf {} \;
find /var/www/apache -name 'error_log' -exec rm -rf {} \;
import random
import string
import threading
import time
import sys
import socket
import JustIRC
def get_random_nick():
random_part = "".join([random.choice("abcdef0123456789_") for i in range(10)])
@CanadianJeff
CanadianJeff / botnetclient.py
Last active April 20, 2016 13:18
Botnet Client For Observing C&C Servers
#!/usr/bin/env python
#### TODO LIST ####
# on dissconnect put message "hes dead jim!"
# put child procs pid number into a global variable
# while no socket check and empty the queue
###################
import sys, os, random, time, socket, errno, thread, binascii, struct, unicodedata
try:
2016-08-18 20:27:32.607000 New connection: 52.202.215.126:38674 (ec2-52-202-215-126.compute-1.amazonaws.com)
2016-08-18 20:27:32.611000 IP: 52.202.215.126 CITY: Ashburn
2016-08-18 20:27:32.615000 IP: 52.202.215.126 REGION: Virginia
2016-08-18 20:27:32.616000 IP: 52.202.215.126 COUNTRY: US
2016-08-18 20:27:32.618000 IP: 52.202.215.126 ORG: AS14618 Amazon.com, Inc.
2016-08-18 20:27:35.721000 IP: 52.202.215.126 PORT: 80 (open)
2016-08-18 20:27:39.723000 IP: 52.202.215.126 SCAN FINISHED IN 0:00:07.103000 SECONDS
@CanadianJeff
CanadianJeff / openwrt-apu2-extras.sh
Last active July 27, 2019 19:35
Extra Packages For LEDE/OpenWRT
opkg install \
amd64-microcode \
block-mount \
coreutils-stty \
flashrom \
irqbalance \
libmount \
luci-app-samba \
luci-app-upnp \
kmod-ath9k \
@CanadianJeff
CanadianJeff / www_cgi-bin_ipset
Created July 31, 2019 23:46
OpenWRT WIP Extras
#!/bin/sh
echo 'Content-type: text/html'
echo ''
saveIFS=$IFS
IFS='&'
eval "$QUERY_STRING"
IFS=$saveIFS
ACTION=${action}
IP=${ip}
RULESET=${ruleset}
@echo off
SET GAMEINFO=..\gameinfo.txt
ECHO "GameInfo"> %GAMEINFO%
ECHO {>> %GAMEINFO%
ECHO game "Left 4 Dead 2" // Window title>> %GAMEINFO%
ECHO type multiplayer_only>> %GAMEINFO%
ECHO nomodels 1 >> %GAMEINFO%
ECHO nohimodel 1 >> %GAMEINFO%
ECHO l4dcrosshair 1 >> %GAMEINFO%
/* the (*) in C code is a pointer */
/* the 2nd time you reference a pointer leave out the (*) */
/* to stop code at a location put raise(SIGINT); */
/* https://www.programiz.com/c-programming/c-pointers */
// getLine("] ", user_server_data, strlen(user_server_data));
#include <sys/types.h>
#ifndef WIN32
#include <unistd.h>
@CanadianJeff
CanadianJeff / firewall.user
Last active December 5, 2020 02:00
OpenWRT /etc/firewall.user
#!/bin/sh
# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.
# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.
exec >/dev/ttyS0
<?php
//Turn off errors in production since they can potentially reveal request information.
//error_reporting(0);
//Uncomment before public
/* A Generic GET request with cURL
* String $cURL - URL to request
* return array
*/
function ValveGET_cURL($cURL) {