aknorr
aknorr
Reputation Top 1%
Alexander Knorr
9 Snippets  (97th place)
Published
1 Channel
Created
0 Channels
Following
Jul 11, 2017
Last Visit
Oct 4, 2015
Registered
216 points  (138th place)
Reputation
Serious Code Generator
Junior Judge
Junior Popular Coder
Serious Popular Coder
Junior Autobiographer
Senior Autobiographer
Junior Famous Coder
Serious Famous Coder
Junior Wise Coder

Recent Snippets See all snippets by aknorr

public by Fabrício Godoy created Apr 24, 2016  1067  0  4  0

CUE Splitting

CUE Splitting: cue_splitting.sh
# Ref: https://wiki.archlinux.org/index.php/CUE_Splitting

shnsplit -f audio.cue -t "%n. %p - %t" -o flac audio.flac
cuetag.sh audio.cue [01]*.flac

;

public by atucom created Feb 1, 2016  192919  0  3  0

automatically log speedtest results to file with timestamp for logging.

automatically log speedtest results to file with timestamp for logging.: lolbandwidth.py
#!/usr/bin/python
#stolen and modified from the reddit post about the raspbeery pi tweeting at comcast
#run this every 10 minutes (or w/e) with cron:
#"crontab -e"
#*/10 * * * * /home/pi/lolbandwidth.py
import os
import sys
import csv
import datetime
import time

def test():
        #run speedtest-cli
        print 'running test'
        #install with "pip install speedtest-cli"
        csvlog = '/home/pi/speed_data.csv'
        a = os.popen("speedtest-cli --simple").read()
        print 'ran'
        #split the 3 line result (ping,down,up)
        lines = a.split('\n')
        print a
        ts = time.time()
        date =datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
        #if speedtest could not connect set the speeds to 0
        if "Cannot" in a:
                p = 100
                d = 0
                u = 0
        #extract the values for ping down and up values
        else:
                p = lines[0][6:11]
                d = lines[1][10:14]
                u = lines[2][8:12]
        print date,p, d, u
        #save the data to file for local network plotting
        out_file = open(csvlog, 'a')
        writer = csv.writer(out_file)
        writer.writerow((ts*1000,p,d,u))
        out_file.close()
        return
        
if __name__ == '__main__':
        test()
        print 'completed'


;

public by opexxx created Sep 4, 2015  1716  0  3  0

ドキュメントを絞り込んで開く

ドキュメントを絞り込んで開く: search-document-by-percol.zsh
function search-document-by-percol() {
    DOCUMENT_DIR="$HOME/Dropbox/Documents/ $HOME/Desktop/ $HOME/Google\ ドライブ"
    SELECTED_FILE=$(echo $DOCUMENT_DIR | xargs find | \
        grep -E "\.(xlsx|xls|pptx|ppt|docx|doc|pdf|txt|odp|odt|ods|xmind|mm|glink|gsheet)$" | percol --match-method migemo)
    if [ $? -eq 0 ]; then
        cygstart $SELECTED_FILE
    fi
}
alias sd='search-document-by-percol'


;

public by Alexander Knorr created May 4, 2015  1827  0  3  0

DomainTrustDiagram.txt

DomainTrustDiagram.txt: domainTrust
digraph test {
 rankdir = LR
 
 "semikron.com" -> "skd.semikron.com"[label = "Trusts"]
 "semikron.com" -> "ski.semikron.com"[label = "Trusts"]
 "semikron.com" -> "ska.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skch.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skusa.semikron.com"[label = "Trusts"]
 "semikron.com" -> "sksk.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skza.semikron.com"[label = "Trusts"]
 "semikron.com" -> "ske.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skind.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skcn.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skdtest.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skkor.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skj.semikron.com"[label = "Trusts"]
 "semikron.com" -> "sknl.semikron.com"[label = "Trusts"]
 "semikron.com" -> "sksf.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skbr.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skuk.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skf.semikron.com"[label = "Trusts"]
 "semikron.com" -> "skhk.semikron.com"[label = "Trusts"]
 "ska.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skbr.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skch.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skcn.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skd.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skd.semikron.com" -> "prodsk.com"[label = "Trusts"]
 "skdtest.semikron.com" -> "semikron.com"[label = "Trusts"]
 "ske.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skf.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skhk.semikron.com" -> "semikron.com"[label = "Trusts"]
 "ski.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skind.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skj.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skkor.semikron.com" -> "semikron.com"[label = "Trusts"]
 "sknl.semikron.com" -> "semikron.com"[label = "Trusts"]
 "sksf.semikron.com" -> "semikron.com"[label = "Trusts"]
 "sksk.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skuk.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skusa.semikron.com" -> "semikron.com"[label = "Trusts"]
 "skza.semikron.com" -> "semikron.com"[label = "Trusts"]
}


;

public by aknorr created Apr 30, 2015  171891  0  3  0

convert VHD file to RAW Image

convert VHD file to RAW Image: vhd2raw.cmd
qemu-img convert -O raw source.vhd output.raw

;