Skip to content

Instantly share code, notes, and snippets.

@stefaang
stefaang / cygwin-ls
Last active April 8, 2019 11:37 — forked from billziss-gh/cygwin-ls
Cygwin ls and hidden files
#!/bin/python
import os
import sys
import argparse
parser = argparse.ArgumentParser(description='List with cygwin')
parser.add_argument('-a', '--all', action='store_true', help='include all files')
parser.add_argument('-A', '--almost-all', action='store_true', help='include all files except . and ..')
args = parser.parse_args(sys.argv[1:])
#! /bin/bash
# Copyright (C) 1996-2011, 2012 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# The GNU C Library is distributed in the hope that it will be useful,
@stefaang
stefaang / wdhws.sh
Last active March 21, 2024 01:31
Hardware control script for PR2100/PR4100
#!/bin/bash
#
# Post-init script for FreeNAS on Western Digital PR2100/PR4100
# wdhws v1.0 by TFL
#
# BSD 3 LICENSE
#
# thanks unix stackexchange question 231975
setup_tty() {
@stefaang
stefaang / davput.py
Created December 31, 2017 12:54 — forked from fheinle/davput.py
Recursive upload with cadaver
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" perform recursive uploads using cadaver
cadaver does not support recursive directory upload.
This script will upload a given path to a given URL
"""
print "==== VRAAG 12 ===="
for monsterhp in [300, 600, 850, 900, 1100, 3500]:
t = 0
print "new monster",monsterhp
while monsterhp > 0:
if t % 4 == 0:
monsterhp -= 35
# print " warriorhit", monsterhp,"left"
if monsterhp <= 0:
print " warrior overkill", -monsterhp,t
from math import ceil
import roman # pip install roman
N = 12500e3
jaar = 1
while N > 0:
n = roman.toRoman(jaar)
N = N-len(n)*250
if jaar % 43 == 0:
N = ceil(N * .85)