Skip to content

Instantly share code, notes, and snippets.

View Rand01ph's full-sized avatar
⚠️
raise NotImplementedError

9r0k Rand01ph

⚠️
raise NotImplementedError
View GitHub Profile
@Rand01ph
Rand01ph / logging.yaml
Created June 29, 2016 03:20 — forked from JesseBuesking/logging.yaml
Testing MultiProcessingLog on both Windows 7 Enterprise and Ubuntu Developers Version 10.04_20121120.
---
version: 1
disable_existing_loggers: False
formatters:
simple:
format: "%(name)-20s%(levelname)-8s%(message)s"
handlers:
console:
class: logging.StreamHandler
level: DEBUG
@Rand01ph
Rand01ph / rsyslog_install.sh
Created July 15, 2016 06:49 — forked from grigorescu/rsyslog_install.sh
Script to install rsyslog and dependencies.
#!/bin/sh
#########################
##
## Setup
##
#########################
# Set some vars
@Rand01ph
Rand01ph / GAME_MASTER_v0_1.protobuf
Created July 18, 2016 08:48 — forked from anonymous/GAME_MASTER_v0_1.protobuf
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@Rand01ph
Rand01ph / rsyslog.conf
Created August 15, 2016 12:02 — forked from kamermans/rsyslog.conf
RainerScript version of /etc/rsyslog.conf for Ubuntu with rsyslog 8+
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#
# WARNING: This config has been converted to RainerScript format which could
# affect config files provided by other software in /etc/rsyslog.d/
# It should behave the same as the legacy-format config file that ships
@Rand01ph
Rand01ph / GeneralSerializer.py
Created November 3, 2016 08:08 — forked from robintema/GeneralSerializer.py
General Django Rest Framework model serializer
import logging
from rest_framework import serializers
class GeneralModelSerializer(serializers.ModelSerializer):
""" General model serializer that will serialize a model object. It will return all the model fields.
"""
class Meta:
model = None
@Rand01ph
Rand01ph / _service.md
Created November 17, 2016 02:50 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@Rand01ph
Rand01ph / LinkedList_test.py
Created August 30, 2017 11:29
A LinkedList Problem
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Node:
def __init__(self, data):
self.data = data
self.next = None
@Rand01ph
Rand01ph / LinkedList_test_2.py
Created August 30, 2017 13:18
LinkedList Problem 2
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Node:
def __init__(self, data):
self.data = data
self.next = None
@Rand01ph
Rand01ph / k8s_make_in_china.sh
Created April 29, 2019 15:31
穿越GFW make k8s 源码
docker pull gcr.azk8s.cn/google_containers/kube-cross:v1.12.4-1
docker tag 02d0ab9d1c60 k8s.gcr.io/kube-cross:v1.12.4-1
@Rand01ph
Rand01ph / wsgi.py
Created September 26, 2019 05:59 — forked from rbarrois/wsgi.py
Django uWSGI warmup
# -*- coding: utf-8 -*-
import io
import os
import sys
import time
import wsgiref.util
import uwsgidecorators