Skip to content

Instantly share code, notes, and snippets.

View DustinAlandzes's full-sized avatar

Dustin Alandzes DustinAlandzes

View GitHub Profile
@DustinAlandzes
DustinAlandzes / groupCopy.py
Last active June 3, 2018 03:20
An OxideMod python plugin that copies group permissions, literally a c+p from flamingmojo's blog: https://flamingmojo.wordpress.com/2016/07/15/making-a-plugin-starting-off/
import BasePlayer
class GroupCopy:
def __init__(self):
self.Title = "Group Copyer"
self.Author = "FlamingMojo"
self.Version = V(1,0,0)
self.HasConfig = False
def Loaded(self):
@DustinAlandzes
DustinAlandzes / CreateDataTable.cs
Created June 3, 2018 02:47
Some C# OxideMod examples from the documentation: http://docs.oxidemod.org/rust/#getting-started
using System.Collections.Generic;
using Oxide.Core;
namespace Oxide.Plugins
{
[Info("Epic Stuff", "Unknown", 1.0)]
[Description("This example illustrates how to create a data file")]
class EpicStuff : CovalencePlugin
{
class StoredData
import feedparser
d = feedparser.parse("http://external.cloud.theadsontop.com/rss/display?namespace=prospects&displayRid=ri.display.main.display.46fe604f-9f63-49d6-8029-9aec0602d656")
for item in d['items']:
print(item['link'])
import requests
import subprocess
import json
import sys
import threading
import time
from Queue import Queue
numberOfViewers = int(sys.argv[1])
builderThreads = int(sys.argv[2])
<html>
<head>
<title>Redirecting</title>
<script>
// We take in the url and delay parameters
// set window.location to "url", after "delay" milliseconds
//https://davidwalsh.name/query-string-javascript
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
from channels import bindings
from .models import Liveblog
class LiveblogBinding(bindings.WebsocketBinding):
model = Liveblog
stream = "liveblogs"
from channels.generic import websockets
class ExampleDemultiplexer(websockets.WebsocketDemultiplexer):
mapping = {
"liveblogs": "liveblog_channel"
}
from channels.generic import websockets
class ExampleConsumer(websockets.JsonWebsocketConsumer):
def receive(self, content):
print(content) # {"test": "data"}
sudo apt-get remove teamviewer-host
wget https://download.teamviewer.com/download/linux/teamviewer-host_armhf.deb
sudo apt install teamviewer-host_armhf.deb
def check_time(path):
t = time.time()
channel_layer.send(u"http.request", {"reply_channel": u"http.response.test", "path": path, "method": "GET", "headers": {'host': 'localhost'}})
response = channel_layer.receive_many([u'http.response.test'])
print str(time.time() - t) + ' ' + str(len(response[1]['content']) if response and response[1] else '')