Skip to content

Instantly share code, notes, and snippets.

packs = None
if hasattr(dmd, 'ZenPackManager'):
packs = dmd.ZenPackManager.packs
else:
packs = dmd.packs
phase2 = False
for pack in packs():
try:
@Hemie143
Hemie143 / zenoss-backup.md
Created April 12, 2017 14:38 — forked from JosefJezek/zenoss-backup.md
Zenoss Backup

Zenoss Backup

#/bin/bash

export ZENHOME=/opt/zenoss

cd /opt/zenoss/backups
rm -f *.tgz *.log
def power(x, y, p):
res = 1
x = x % p
while y > 0:
if y & 1:
res = (res * x) % p
y = y//2
x = (x * x) % p
https://forum.doom9.org/showthread.php?t=105920&page=403
Reading the .lwi file generated by LWLibavAudioSource (The resumed first lines):
https://forum.doom9.org/showthread.php?t=151159&page=230
@Hemie143
Hemie143 / map_script.php
Created November 6, 2019 22:38
Geocache rotating image
<?php
// File and rotation
$overFilename = 'Map_Plain.png'; // this is the file that goes over top
$underFilename = 'Map_Gat.png'; // the underneath image
// calculate the rotation
//$degrees = $_GET["angle"];
if (date("G") < 5)
{$hr = (date("G") + 24);}
else {$hr = (date("G"));}
@Hemie143
Hemie143 / tictactoe_medium.py
Last active June 25, 2020 19:22
tictactoe medium
from random import randint
class Player:
def __init__(self, type, symbol):
self.type = type
self.symbol = symbol
class TicTacToe:
import random
class Board:
def __init__(self):
self.field = list(EMPTY_CELL * 9)
# self.cells = set(range(9))
def show_field(self):
print('---------')
from string import digits
import random
class Mesh:
def __init__(self, state=" " * 9):
self.state = list(state)
self.turn = "O" if abs(state.count("X") - state.count("O")) == 1 else "X"
self.status = "Game not finished"
self.start()
from random import randint, choice
class Player:
def __init__(self, level, symbol):
self.level = level
self.symbol = symbol
@Hemie143
Hemie143 / zenfixit.py
Created December 14, 2020 08:34 — forked from James-Newman/zenfixit.py
ZenFixIt.py A script to fix common Zenoss problems (Created by Zenoss Inc. posted for posterity)
#!/usr/bin/env python
##########################################################################
#
# Copyright 2009 Zenoss, Inc. All Rights Reserved.
#
##########################################################################
__doc__ = """zenfixit
Apply common remedies for problems, and look for other issues.