This file contains 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
echo 'deb http://zenbook:9000/1-mpz-debian-10 stable/' | sudo tee /etc/apt/sources.list.d/omnipackage_mpz.list | |
curl -fsSL http://zenbook:9000/1-mpz-debian-10/stable/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/omnipackage_mpz.gpg > /dev/null | |
apt update | |
apt install mpz |
This file contains 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
[Interface] | |
Address = <...> | |
MTU = 1412 | |
PrivateKey = <...> | |
DNS = <...> | |
PostUp = iptables -t nat -A POSTROUTING -o %i -j MASQUERADE; iptables -A FORWARD -i %i -m state --state RELATED,ESTABLISHED -j ACCEPT; iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu | |
PostDown = iptables -t nat -D POSTROUTING -o %i -j MASQUERADE; iptables -D FORWARD -i %i -m state --state RELATED,ESTABLISHED -j ACCEPT; iptables -D FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu | |
[Peer] |
This file contains 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
logstash_1 | [2019-08-23T23:17:02,778][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"logstash", :_type=>"_doc", :routing=>nil}, #<LogStash::Event:0x38719c08>], :response=>{"index"=>{"_index"=>"logstash-2019.08.23-000007", "_type"=>"_doc", "_id"=>"3X_EwGwBGHFJvHqx3Ny1", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [service] of type [text] in document with id '3X_EwGwBGHFJvHqx3Ny1'. Preview of field's value: '{type=system}'", "caused_by"=>{"type"=>"illegal_state_exception", "reason"=>"Can't get text on a START_OBJECT at 1:12"}}}}} |
This file contains 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
%matplotlib inline | |
%config InlineBackend.figure_format = 'svg' | |
import matplotlib.pyplot as plt | |
plt.style.use('ggplot') | |
import numpy as np |
This file contains 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
%matplotlib inline | |
from matplotlib import pyplot as plt | |
from IPython import display | |
display.set_matplotlib_formats('svg') | |
from matplotlib import style | |
style.use('ggplot') |
This file contains 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
def benchmark(what) | |
start = ::Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
yield | |
finish = ::Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
puts "#{what} took #{finish - start} seconds" | |
end |
This file contains 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
def benchmark(what) | |
start = ::Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
yield | |
finish = ::Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
sap "#{what} took #{finish - start} seconds" | |
end |
This file contains 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
#!/usr/bin/env python | |
import ctypes | |
import wave | |
import sys | |
pa = ctypes.cdll.LoadLibrary('libpulse-simple.so.0') | |
PA_STREAM_PLAYBACK = 1 | |
PA_SAMPLE_S16LE = 3 |
This file contains 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
/* ~/.mozilla/firefox/XXXXXX.default/chrome/userContent.css */ | |
input { | |
border: 2px inset white; | |
background-color: white; | |
color: black; | |
-moz-appearance: none !important; | |
} | |
textarea { | |
border: 2px inset white; |
This file contains 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
def normalize_volume(file) | |
output = `ffmpeg -i '#{file}' -af "volumedetect" -f null /dev/null 2>&1` | |
raise "Error getting audio volume from #{file} (#{$?})" unless $?.success? | |
max_volume = output.scan(/max_volume: ([\-\d\.]+) dB/).flatten.first | |
mean_volume = output.scan(/mean_volume: ([\-\d\.]+) dB/).flatten.first | |
return if !max_volume || !mean_volume | |
max_volume = max_volume.to_f | |
mean_volume = mean_volume.to_f | |
target_volume = -14.0 | |
adjustment = target_volume - mean_volume |
NewerOlder