Skip to content

Instantly share code, notes, and snippets.

Alex P-B chozabu

Block or report user

Report or block chozabu

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
@chozabu
chozabu / tc.sh
Created Dec 1, 2016
bitcoins net limiter, altered to to make port selectable limit up/down and wipe iptables rules
View tc.sh
# Copyright (c) 2013 The Bitcoin Core developers & Chozabu
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#network interface on which to limit traffic
IF="wlp3s0"
#limit of the network interface in question
LINKCEIL="1gbit"
#limit outbound in/out on selected port to this rate
LIMIT="1kbit"
@chozabu
chozabu / tc.sh
Created Dec 1, 2016
An altered version of tc.sh - given a port it will limit up/down traffic
View tc.sh
# Copyright (c) 2013 The Bitcoin Core developers & Chozabu
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#network interface on which to limit traffic
IF="wlp3s0"
#limit of the network interface in question
LINKCEIL="1gbit"
#limit outbound in/out on selected port to this rate
LIMIT="1kbit"
@chozabu
chozabu / views_stripe.py
Last active Sep 8, 2016
Notes to self: The minor work I needed to do in app space to use djstripe.
View views_stripe.py
from djstripe.contrib.rest_framework.views import SubscriptionRestView
class CustomSubscriptionRestView(SubscriptionRestView):
'''
This route expects data in this format \n
{
"stripe_token": "token-from-stripe.js",
View time_subquerys.py
"""time_subquerys.py: A quick task to compare subquerys on represent with."""
__author__ = "Alex 'Chozabu' P-B"
__copyright__ = "Copyright 2016, IAgree"
from django.core.management.base import BaseCommand, CommandError
from represent_app import models
import time
@chozabu
chozabu / time_subquerys.py
Created Aug 5, 2016
updated for pre-evaluated query
View time_subquerys.py
"""time_subquerys.py: A quick task to compare subquerys on represent with."""
__author__ = "Alex 'Chozabu' P-B"
__copyright__ = "Copyright 2016, IAgree"
from django.core.management.base import BaseCommand, CommandError
from represent_app import models
import time
View time_subquerys.py
"""time_subquerys.py: A quick task to compare subquerys on represent with."""
__author__ = "Alex 'Chozabu' P-B"
__copyright__ = "Copyright 2016, IAgree"
from django.core.management.base import BaseCommand, CommandError
from represent_app import models
import time
View picofix.py
#!/usr/bin/env python2
"""picofix.py: reboot the a router when it fails to contact a distant node."""
__author__ = "Alex 'Chozabu' P-B"
import pyping
from time import sleep
from datetime import datetime
@chozabu
chozabu / views_push.py
Created Jun 12, 2016
Overriding Django Push Notifications "create" method to reassign user for an object if they send an identical regId
View views_push.py
"""views_push.py: Views for push notifications, to register a device that would like to get push notifications."""
__author__ = "Alex 'Chozabu' P-B"
__copyright__ = "Copyright 2016, IAgree"
from push_notifications.api import rest_framework
from dj_represent import settings
from rest_framework.response import Response
@chozabu
chozabu / client_query_view.py
Created Dec 24, 2015
hobby code to allow a client to construct their own queries for a django server (do not use)
View client_query_view.py
# /basic_api/?table=Post&sortby=-liquid_sum&startat=39
def db_query(request):
if len(request.POST) == 0:
r_get = request.GET
else:
r_get = request.POST
# table whitelist?
rdata = {"Post": Post, "Tag": Tag, "Topic": Topic, "User": User}
View fixed_hash_to_words.py
#copyright luke stanley & alex P-B
#AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
import hashlib
#from dictionary import lessFrequentButStillAutoSuggestableWords
#https://en.wiktionary.org/wiki/Wiktionary:Frequency_lists/PG/2005/08/60001-70000
"""
var script = document.createElement('script');
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(script);
lessFrequentButStillAutoSuggestableWords = [];
You can’t perform that action at this time.