Skip to content

Instantly share code, notes, and snippets.

Avatar

Philipp Mundhenk PhilippMundhenk

  • Munich
View GitHub Profile
@PhilippMundhenk
PhilippMundhenk / PortableDate.vba
Last active Mar 7, 2017
In Excel, the date format depends on the locale setting of the computer, e.g. the formula =TEXT(TODAY(),"YYYY-MM-DD") only works correctly on computers set to English locales, and =TEXT(HEUTE(),"JJJJ-MM-TT") works on German computers. This VBA macro adds =PORTABLE_TODAY(), which fixes this problem and works on any computer.
View PortableDate.vba
Public Function PORTABLE_TODAY()
    Dim monthString As String
    Dim dayString As String
    Dim month As Integer
    Dim day As Integer
    
    month = Int(DatePart("m", Now()))
    day = Int(DatePart("d", Now()))
    
    If month < 10 Then
View rclocal.service
[Unit]
Description=boot script
[Service]
#Type=forking
ExecStart=/etc/rc.local
TimeoutSec=0
RemainAfterExit=yes
[Install]
View run_bonnie.sh
bonnie++ -u root -n 200 -d /mnt/hdd -q >> results.csv
cat results.csv | bon_csv2html > results.html
View hddBench.sh
#!/bin/bash
if [ -z "$1" ]; then
echo "Please supply target device"
else
outFile=$2
if [ -n "$outFile" ]; then
echo "logging to $2"
else
echo "no logfile supplied => /dev/null"
outFile="/dev/null"
View hddBench_smallFiles.sh
#!/bin/bash
if [ -z "$1" ]; then
echo "Please supply target device"
else
echo "running test on '$1'"
numberRuns=$3
if [ -z "$numberRuns" ]; then
numberRuns=5
echo "running $numberRuns times (default)"
else
View hddBench_largeFile.sh
#!/bin/bash
if [ -z "$1" ]; then
echo "Please supply target device"
else
echo "running test on '$1'"
numberRuns=$3
if [ -z "$numberRuns" ]; then
numberRuns=5
echo "running $numberRuns times (default)"
else