This file contains hidden or 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
""" | |
Parses the electronic account statements in the data format used by the | |
Finnish bank Nordea (.nda / "TITO") and converts it to CSV. | |
Usage: | |
python parse_nordea_nda.py < Konekielinen-tiliote\(YY-MM-DD\).nda > result.csv | |
OR parse multiple: |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Extract dependency information from a gradle projects by simply checking | |
# what its build scripts download in the Gradle cache and extracting the POM | |
# XML files from each. | |
# | |
# Usage: | |
# | |
# ./this_script.bash path/to/project "./gradlew assembleDebug" | |
# |
This file contains hidden or 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
#include <stdio.h> | |
static int convertHeaderAndGetLength(FILE *in, FILE *out, int typedTag) { | |
int value = 0; | |
int bitshift = 0; | |
int first = 1; | |
while (1) { | |
int byte = fgetc(in); | |
if (byte == EOF) { | |
if (!first) fprintf(stderr, "unexpected EOF on length read\n"); |
This file contains hidden or 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
""" | |
BLE sniffer for Linux. Requires hcidump and hcitool executables to | |
be available (e.g., apt-get install bluez-hcidump). Run as root. | |
Works with Python 2.7 (which is still the likely version of system Python) | |
If you get | |
Set scan parameters failed: Input/output error | |
try to fix with: |
This file contains hidden or 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
# record lossless video to screengrab.mp4 after waiting 5 seconds, override without asking | |
sleep 5 && \ | |
ffmpeg -y -video_size 1920x1080 -framerate 25 -f x11grab -i $DISPLAY -c:v libx264 -crf 0 -preset ultrafast screengrab.mp4 | |
# lossless encoding of screengrab.mp4 with high quality, no audio ("-an", instead of "-c:a copy") | |
# CRF: "For x264, sane values are between 18 and 28. The default is 23" | |
# from start to 2 minutes | |
ffmpeg -ss 00:00:00 -i screengrab.mp4 -t 00:02:00 -c:v libx264 -preset slow -crf 22 -an output.mp4 | |
# change video container without re-encoding |
This file contains hidden or 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
# MIT License | |
# | |
# Copyright (c) 2019 Otto Seiskari | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
from pathos.multiprocessing import ProcessingPool as Pool | |
def parallel_map(func, array, n_workers): | |
def compute_batch(i): | |
try: | |
return func(i) | |
except KeyboardInterrupt: | |
raise RuntimeError("Keyboard interrupt") | |
p = Pool(n_workers) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder