- Author
Mark Biggers <biggers@utsl.com>
- Description
How to rescue a Linux system (OpenSUSE 12.x)
- Ref
System Rescue CD docs: <http://www.sysresccd.org/Online-Manual-EN>
- Ref
chroot, explained: <http://en.wikipedia.org/wiki/Chroot>
- Ref
Change Root (prepare for rescue): <https://wiki.archlinux.org/index.php/Change_Root>
- Ref
OpenSUSE wiki, "Recover root password": <https://en.opensuse.org/SDB:Recover_root_password>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
'''Script to pull data out of GitHub and push into Elasticsearch''' | |
import os | |
import sys | |
import requests | |
import httplib | |
import json # NOQA | |
from urlparse import urljoin | |
from uritemplate import expand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This piece of code is written by | |
# Jianing Yang <jianingy.yang@gmail.com> | |
# with love and passion! | |
# | |
# H A P P Y H A C K I N G ! | |
# _____ ______ | |
# ____==== ]OO|_n_n__][. | | | |
# [________]_|__|________)< |YANG| | |
# oo oo 'oo OOOO-| oo\\_ ~o~~o~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## -*- makefile -*- | |
## biggers@utsl.com, Mark Biggers | |
## GNU Makefile for docker-compose build & run of a Python or other Project | |
## | |
## REFs: | |
## https://docs.docker.com/compose/reference/ | |
## https://github.com/docker/compose/releases | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import collections | |
import json | |
import uuid | |
import aiohttp | |
Message = collections.namedtuple( | |
"Message", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import time | |
from tornado import gen | |
from tornado.concurrent import run_on_executor, futures | |
from tornado.ioloop import IOLoop | |
class TaskRunner(object): | |
def __init__(self, loop=None): | |
self.executor = futures.ThreadPoolExecutor(4) | |
self.loop = loop or IOLoop.instance() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A simple demonstration of running background tasks with Tornado. | |
Here I am using a basic TCP server which handles streams and keeps | |
them open while asynchronously performing a fake task in the | |
background. In order to test it, simply telnet to localhost port 8080 | |
and start typing things to see that the server receives the messages. | |
The advantage to running on an executor instead of conventional | |
threads is that we can more easily shut it down by stopping the | |
tornado IO loop. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#coding=utf-8 | |
import socket | |
import os | |
import errno | |
from tornado.ioloop import IOLoop | |
from tornado.platform.auto import set_close_exec | |
class UDPServer(object): | |
def __init__(self, io_loop=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""pagerduty.py | |
Usage: | |
pagerduty.py trigger [options] <description> [<incident_key>] | |
pagerduty.py acknowledge [options] <description> <incident_key> | |
pagerduty.py resolve [options] <description> <incident_key> | |
Options: | |
-c --conf=FILE A path to a config file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""pycache -- cache a python package from PyPI on S3. | |
A simple script to collect a cache of packages locally and sync them up to an S3 bucket, using directories as namespaces so that different projects can have different dependencies. | |
This is just about the simplest thing that could possibly work. | |
""" | |
import warnings | |
warnings.filterwarnings('ignore') |