Russ Allbery: Review: Winds of Fate
| Series: | Mage Winds #1 |
| Publisher: | DAW |
| Copyright: | 1991 |
| Printing: | July 1992 |
| ISBN: | 0-88677-516-7 |
| Format: | Mass market |
| Pages: | 460 |
| Series: | Mage Winds #1 |
| Publisher: | DAW |
| Copyright: | 1991 |
| Printing: | July 1992 |
| ISBN: | 0-88677-516-7 |
| Format: | Mass market |
| Pages: | 460 |
A while back, I found myself in need of some TLS certificates set up and issued for a testing environment.
I remembered there was some code for issuing TLS certs in Docker, so I yanked some of that code and made a sensable CLI API over it.
Thus was born minica!
Something as simple as minica tag@domain.tls domain.tld will issue two TLS certs (one with a Client EKU, and one server) issued from a single CA.
Next time you re in need of a few TLS keys (without having to worry about stuff like revocation or anything), this might be the quickest way out!
--set_all_file_dates timestring
Set mtime, atime, and ctime of all files and directories to the
given time.
Valid timestring formats are: 'Nov 8 14:51:13 CET 2007',
110814512007.13, 2007110814511300. See also --modification-date=
and man xorriso, Examples of input timestrings.
This action stays delayed until mkisofs emulation ends. Up to
then it can be revoked by --set_all_file_dates with empty
timestring. In any case files which get into the ISO after
mkisofs emulation ended will not be affected, unless another
mkisofs emulation applies --set_all_file_date again.
LEDE developer Jonas Gorski submitted a patch to fix build times in their kernel:
kernel: allow reproducable builds
Similar how we fix the file times in the filesystems, fix the build time
of the kernel, and make the build number static. This should allow the
kernel build to be reproducable when combined with setting the
KERNEL\_BUILD\_USER and \_DOMAIN in case of different machines.
The reproducability only applies to non-initramfs kernels, those still
require additional changes.
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Packages reviewed and fixed, and bugs filed
Patches have been submitted by:
At some point back when the dinosaurs roamed the Earth and I was in
high school, I borrowed my first digital signal processing book from a friend.
I later went on to an engineering education and master's thesis about DSP,
but the very basics of DSP never stop to fascinate me. Today, I wanted to
write something about one of them and how it affects audio processing in
Nageru (and finally, how Debian's policies put me in a bit of a bind on
this issue).
DSP texts tend to obscure profound truths with large amounts of maths,
so I'll try to present a somewhat less general result that doesn't require
going into the mathematical details. That rule is:
Adding a signal to weighted, delayed copies of itself is a filtering operation.
(It's simple, but ignoring it will have sinister effects, as we'll see later.)
Let's see exactly what that means with a motivating example. Let's say that
I have a signal where I want to get rid of (or rather, reduce) high frequencies.
The simplest way I can think of is to add every neighboring sample; that is,
set yn = xn + xn-1. For each sample, we
add the previous sample, ie., the signal as it was one sample ago.
(We ignore what happens at the edges; the common
convention is to assume signals extend out to infinity with zeros.)
What effect will this have? We can figure it out with some trigonometry,
but let's just demonstrate it by plotting instead: We assume 48 kHz sample rate
(which means that our one-sample delay is 20.83 s) and a 22 kHz
note (definitely treble!), and plot the signal with one-sample delay
(the x axis is sample number):
As you can see, the resulting signal is a new signal of the same frequency
(which is always true; linear filtering can never create new frequencies,
just boost or dampen existing ones), but with much lower amplitude.
The signal and the delayed version of it end up cancelling each other mostly
out. Also note that there signal has changed phase; the resulting signal
has been a bit delayed compared to the original.
Now let's look at a 50 Hz signal (turn on your bass face). We need to zoom out a bit to see
full 50 Hz cycles:
The original signal and the delayed one overlap almost exactly! For a lower
frequency, the one-sample delay means almost nothing (since the waveform is
varying so slowly), and thus, in this case, the resulting signal is amplified,
not dampened. (The signal has changed phase here, too actually exactly as much
in terms of real time but we don't really see it, because we've zoomed out.)
Real signals are not pure sines, but they can be seen as sums of many sines
(another fundamental DSP result), and since filtering is a linear operation,
it affects those sines independently. In other words, we now have a very
simple filter that will amplify low frequencies and dampen high frequencies
(and delay the entire signal a little bit). We can do this for all
frequencies from 0 to 24000 Hz; let's ask Octave to do it for us:
(Of course, in a real filter, we'd probably multiply the result with 0.5
to leave the bass untouched instead of boosting it, but it doesn't really
change anything. A real filter would have a lot more coefficients, though,
and they wouldn't all be the same!)
Let's now turn to a problem that will at first seem different: Combining
audio from multiple different time sources. For instance, when mixing video,
you could have input from two different cameras or sounds card and would want
to combine them (say, a source playing music and then some audience sound
from a camera). However, unless you are lucky enough to have a professional-grade setup
where everything runs off the same clock (and separate clock source cables
run to every device), they won't be in sync; sample clocks are good, but they are
not perfect, and they have e.g. some temperature variance. Say we have really
good clocks and they only differ by 0.01%; this means that after an hour of
streaming, we have 360 ms delay, completely ruining lip sync!
This means we'll need to resample at least one of the sources to match the
other; that is, play one of them faster or slower than it came in originally.
There are two problems here: How do you determine how much to resample
the signals, and how do we resample them?
The former is a difficult problem in its own right; about every algorithm
not backed in solid control theory
is doomed to fail in one way or another, and when they fail, it's extremely
annoying to listen to. Nageru follows a 2012 paper by Fons Adriaensen;
GStreamer does well, something else. It fails pretty badly in a number of
cases; see e.g. this 2015 master's thesis
that tries to patch it up. However, let's ignore this part of the problem
for now and focus on the resampling.
So let's look at the case where we've determined we have a signal and need to
play it 0.01% faster (or slower); in a real situation, this number would vary
a bit (clocks are not even consistently wrong). This means that at some point,
we want to output sample number 3000 and that corresponds to input sample
number 3000.3, ie., we need to figure out what's between two input samples.
As with so many other things, there's a way to do this that's simple, obvious
and wrong, namely linear interpolation.
The basis of linear interpolation is to look at the two neighboring samples
and weigh them according to the position we want. If we need sample 3000.3,
we calculate y = 0.7 x3000 + 0.3 x3001 (don't switch
the two coefficients!), or, if we want to save one multiplication and get
better numerical behavior, we can use the equivalent
y = x3000 + 0.3 (x3001 - x3000).
And if we need sample 5000.5, we take y = 0.5 x5000 + 0.5 x5001. And after a while, we'll be back on integer samples; output sample
10001 corresponds to x10000 exactly.
By now, I guess it should be obvious what's going on: We're creating a filter!
Linear interpolation will inevitably result in high frequencies being
dampened; and even worse, we are creating a time-varying filter, which means
that the amount of dampening will vary over time. This manifests itself as
a kind of high-frequency flutter , where the amount of flutter depends on
the relative resampling frequencies. There's also cubic resampling (which
can mean any of several different algorithms), but it only really reduces
the problem, it doesn't really solve it.
The proper way of interpolating depends a lot on exactly what you want
(e.g., whether you intend to change the rate quickly or not);
this paper
lays out a bunch of them, and was the paper that originally made me understand
why linear interpolation is so bad. Nageru outsources this problem to
zita-resampler,
again by Fons Adriaensen; it yields extremely high-quality resampling
under controlled delay, through a relatively common technique known as
polyphase filters.
Unfortunately, doing this kind of calculations takes CPU. Not a lot of CPU,
but Nageru runs in rather CPU-challenged environments (ultraportable laptops
where the GPU wants most of the TDP, and the CPU has to go down to the
lowest frequency), and it is moving in a direction where it needs to resample
many more channels (more on the later), so every bit of CPU helps. So I coded
up an SSE optimization of the inner loop for a particular common case
(stereo signals) and sent it in for upstream inclusion. (It made the
code 2.7 times as fast without any structural changes or reducing precision,
which is pretty much what you can expect from SSE.)
Unfortunately, after a productive discussion, suddenly upstream went silent.
I tried pinging, pinging again, and after half a year pinging again, but to
no avail. I filed the patch in Debian's BTS,
but the maintainer understandably is reluctant to carry a delta against upstream.
I also can't embed a copy; Debian policy would dictate that I build against
the system's zita-resampler. I could work around it by
rewriting zita-resampler until it looks nothing like the original, which
might be a good idea anyway if I wanted to squeeze out the last drops of speed;
there are AVX optimizations to be had in addition to SSE, and the structure
as-is isn't ideal for SSE optimizations (although some of the changes I have
in mind would have to be offset against increased L1 cache footprint,
so careful benchmarking would be needed). But in a sense, it feels like just
working around a policy that's there for good reason. So like I said, I'm
in a bit of a bind. Maybe I should just buy a faster laptop.
Oh, and how does GStreamer solve this? Well, it doesn't use linear interpolation.
It does something even worse it uses nearest neighbor. Gah.
Update: I was asked to clarify that this is about the audio resampling done
by the GStreamer audio sink to sync signals, not in the audioresample element, which solves
a related but different problem (static sample rate conversion).
The audioresample element supports a number of different resampling methods;
I haven't evaluated them.
text/html; /usr/bin/firefox --new-tab %s;
text/html; /usr/bin/elinks -force-html -dump %s; copiousoutput
and I added the proposed "~/.muttrc" addition verbatim:
bind attach <return> view-mailcap
alternative_order text/plain text/html
unauto_view *
auto_view text/html
For work related mails, where the use of html crap mails is a sad reality I can not avoid,
I stick to Icedove. But beside of the many crashes
everyone encountered recently it also crashes when I try to reach
"Preferences -> Advanced -> Config Editor". So no chance to adjust
the handling of http/https links in the UI. Luckily that configuration is still text, well XML,
in a file called mimeTypes.rdf in in the profile directory.
So I manually replaced "/usr/bin/iceweasel" with "/usr/bin/firefox" and a restart later clicking
on http and https links works again. Yay.
There s a few different posts out there on how to run Perl apps, such as Mojolicious-based, on Heroku, but I d like to show how to deploy a Perl Dancer application on Heroku.
The startup script of a Dancer application (bin/app.pl) can be used as a PSGI file. With that in mind, I was able to take the good work of Miyagawa s Heroku buildpack for general PSGI apps and hack it a little bit to use Dancer s, specifically. What I like about Miyagawa s approach is that uses the fantastic cpanm and makes it available within your application, instead of the monotonous cpan, to solve dependencies.
Let s make a simple Dancer app to show how to make this happen:
/tmp $ dancer -a heroku
+ heroku
+ heroku/bin
+ heroku/bin/app.pl
+ heroku/config.yml
+ heroku/environments
+ heroku/environments/development.yml
+ heroku/environments/production.yml
+ heroku/views
+ heroku/views/index.tt
+ heroku/views/layouts
+ heroku/views/layouts/main.tt
+ heroku/MANIFEST.SKIP
+ heroku/lib
heroku/lib/
+ heroku/lib/heroku.pm
+ heroku/public
+ heroku/public/css
+ heroku/public/css/style.css
+ heroku/public/css/error.css
+ heroku/public/images
+ heroku/public/500.html
+ heroku/public/404.html
+ heroku/public/dispatch.fcgi
+ heroku/public/dispatch.cgi
+ heroku/public/javascripts
+ heroku/public/javascripts/jquery.js
+ heroku/t
+ heroku/t/002_index_route.t
+ heroku/t/001_base.t
+ heroku/Makefile.PL
Now, you already know that by firing perl bin/app.pl you can get your development server up and running. So I ll just proceed to show how to make this work on Heroku, you should already have your development environment configured for it:
/tmp $ cd heroku/
/tmp/heroku $ git init
Initialized empty Git repository in /private/tmp/heroku/.git/
/tmp/heroku :master $ git add .
/tmp/heroku :master $ git commit -a -m 'Dancer on Heroku'
[master (root-commit) 6c0c55a] Dancer on Heroku
22 files changed, 809 insertions(+), 0 deletions(-)
create mode 100644 MANIFEST
create mode 100644 MANIFEST.SKIP
create mode 100644 Makefile.PL
create mode 100755 bin/app.pl
create mode 100644 config.yml
create mode 100644 environments/development.yml
create mode 100644 environments/production.yml
create mode 100644 lib/heroku.pm
create mode 100644 public/404.html
create mode 100644 public/500.html
create mode 100644 public/css/error.css
create mode 100644 public/css/style.css
create mode 100755 public/dispatch.cgi
create mode 100755 public/dispatch.fcgi
create mode 100644 public/favicon.ico
create mode 100644 public/images/perldancer-bg.jpg
create mode 100644 public/images/perldancer.jpg
create mode 100644 public/javascripts/jquery.js
create mode 100644 t/001_base.t
create mode 100644 t/002_index_route.t
create mode 100644 views/index.tt
create mode 100644 views/layouts/main.tt
/tmp/heroku :master $
And now, run heroku create, please note the buildpack URL, http://github.com/damog/heroku-buildpack-perl.git:
/tmp/heroku :master $ heroku create --stack cedar --buildpack http://github.com/damog/heroku-buildpack-perl.git
Creating blazing-beach-7280... done, stack is cedar
http://blazing-beach-7280.herokuapp.com/ git@heroku.com:blazing-beach-7280.git
Git remote heroku added
/tmp/heroku :master $
And just push:
/tmp/heroku :master $ git push heroku master
Counting objects: 34, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (30/30), done.
Writing objects: 100% (34/34), 40.60 KiB, done.
Total 34 (delta 3), reused 0 (delta 0)
-----> Heroku receiving push
-----> Fetching custom buildpack... done
-----> Perl/PSGI Dancer! app detected
-----> Bootstrapping cpanm
Successfully installed JSON-PP-2.27200
Successfully installed CPAN-Meta-YAML-0.008
Successfully installed Parse-CPAN-Meta-1.4404 (upgraded from 1.39)
Successfully installed version-0.99 (upgraded from 0.77)
Successfully installed Module-Metadata-1.000009
Successfully installed CPAN-Meta-Requirements-2.122
Successfully installed CPAN-Meta-2.120921
Successfully installed Perl-OSType-1.002
Successfully installed ExtUtils-CBuilder-0.280205 (upgraded from 0.2602)
Successfully installed ExtUtils-ParseXS-3.15 (upgraded from 2.2002)
Successfully installed Module-Build-0.4001 (upgraded from 0.340201)
Successfully installed App-cpanminus-1.5015
12 distributions installed
-----> Installing dependencies
Successfully installed ExtUtils-MakeMaker-6.62 (upgraded from 6.55_02)
Successfully installed YAML-0.84
Successfully installed Test-Simple-0.98 (upgraded from 0.92)
Successfully installed Try-Tiny-0.11
Successfully installed HTTP-Server-Simple-0.44
Successfully installed HTTP-Server-Simple-PSGI-0.14
Successfully installed URI-1.60
Successfully installed Test-Tester-0.108
Successfully installed Test-NoWarnings-1.04
Successfully installed Test-Deep-0.110
Successfully installed LWP-MediaTypes-6.02
Successfully installed Encode-Locale-1.03
Successfully installed HTTP-Date-6.02
Successfully installed HTML-Tagset-3.20
Successfully installed HTML-Parser-3.69
Successfully installed Compress-Raw-Bzip2-2.052 (upgraded from 2.020)
Successfully installed Compress-Raw-Zlib-2.054 (upgraded from 2.020)
Successfully installed IO-Compress-2.052 (upgraded from 2.020)
Successfully installed HTTP-Message-6.03
Successfully installed HTTP-Body-1.15
Successfully installed MIME-Types-1.35
Successfully installed HTTP-Negotiate-6.01
Successfully installed File-Listing-6.04
Successfully installed HTTP-Daemon-6.01
Successfully installed Net-HTTP-6.03
Successfully installed HTTP-Cookies-6.01
Successfully installed WWW-RobotRules-6.02
Successfully installed libwww-perl-6.04
Successfully installed Dancer-1.3097
29 distributions installed
-----> Installing Starman
Successfully installed Test-Requires-0.06
Successfully installed Hash-MultiValue-0.12
Successfully installed Devel-StackTrace-1.27
Successfully installed Test-SharedFork-0.20
Successfully installed Test-TCP-1.16
Successfully installed Class-Inspector-1.27
Successfully installed File-ShareDir-1.03
Successfully installed Filesys-Notify-Simple-0.08
Successfully installed Devel-StackTrace-AsHTML-0.11
Successfully installed Plack-0.9989
Successfully installed Net-Server-2.006
Successfully installed HTTP-Parser-XS-0.14
Successfully installed Data-Dump-1.21
Successfully installed Starman-0.3001
14 distributions installed
-----> Discovering process types
Procfile declares types -&gt; (none)
Default types for Perl/PSGI Dancer! -&gt; web
-----> Compiled slug size is 2.7MB
-----> Launching... done, v4
http://blazing-beach-7280.herokuapp.com deployed to Heroku
To git@heroku.com:blazing-beach-7280.git
* [new branch] master -&gt; master
/tmp/heroku :master $
And you can confirm it works:
Please note that the environment it runs on is deployment . The backend server it uses is the great Starman, also by the great Miyagawa.
Now, if you add or change dependencies on Makefile.PL, next time you push, those will get updated.
Very cool, right? :)
I just recently quit my job at the startup company I had been working in for almost five years. In startup terms, such long time might be a whole lifetime, but in my case, I grew liking it more and more as the years came, I had evolved from being just another engineer, to lead a team of seven great developers, with decision-making tasks and strategy planning for our technical infrastructure. It s been such a great long teaching journey that I m nothing but pleased with my own performance, learned lessons and skills and all I provided and was provided by the project.
Leaving a city like New York is not an easy task. You have it all there, you start making a life and suddenly, before you know it, you already have a bunch of ties to the place, people, leases, important dates, all kinds of shit. Seriously, all kinds of crazy ass shit start to fill up your baggage. You wake up everyday to get into the subway and commute surrounded by all of this people that are just like you: so similar yet so immensely different. No, leaving the city is not an easy task, it s not something to take lightly. You know how people just say my cycle has ended in this place as an euphemism not to end in bad terms with anyone? Well, ending a cycle is indeed a reality, I got to a point where I felt like I needed to head into a different direction, take on new challenges and overall, peace out and hope the best to everyone, specially to myself.
This was me, on my last day at work, last Friday of June:
(Some) people seem to be anxious to know what I m doing next, and my answer is, go mind your own fucking business. However, life is short and I would love to do any of the following:
Three months of coding is about to end.It has officially begun on May 23rd and we are getting near to the final submission deadline on August 15th.
You can checkout my Debian wiki page to know more about myself.
I have worked on improving voice, video and chat communication (Real Time Communication) with free software, one of the RTC project for Debian.
My mentors are Iain.R.Learmonth and Daniel Pocock.Both of them were dedicative and I could learn many new things from them within these three months.I have contacted my mentors through personal mail, Debian outreach mailing lists and IRC(#debian-data and #debian-soc). They were very responsive to my queries. Thank you Iain and Daniel for improving and enlightening me.
My initial task is e-mail mining. I have to allow the client to login to the mail using IMAP, extracts the To , From and CC headers of every email message in the folder and then scan for the phone numbers, SIP addresses, XMPP addresses in the body of the message.These extracted details should be written in the CSV file also.The extracted phone numbers, SIP addresses, XMPP addresses and ham call signs should be made into a click able link using Flask.
I have also attended DebConf-16 (conference of Debian developers, contributors and users) in Cape Town in the middle of three months (Form July 2nd to July 9th).I gave a talk on my progressing GSoC project.I have learnt many new things about Debian, their projects and their packages apart form my GSoC project.I have met Debian developers, contribuors and some of the fellow GSoC students.
I have written previous blog posts related to GSoC-2016 in the following links.
Weekly Report for GSoC16-week 1 and week2
Weekly Report for GSoC16-Community bonding period
Weekly reports sent to Debian-outreach list.
Email-Mining is the repository I have created on GitHub to work on my project.
I have divided the tasks and coded individually to combine together.Snippet folder in the file contains the code for each tasks.
Following are the commits I have made in the repository.
https://github.com/Jaminy/Email-Mining/commits/master My tasks have been extended to add a gravatar on the page listing details for each email address, maintain a counter for each hour of the day in the scraper for each mail, show a list of other people that have been involved in email conversations and make the contact information on the detail pages machine readable. https://github.com/Jaminy/Email-Mining/issues
My mentor suggested me to work on at least three issues before final submission.I have worked on each of them individually in the snippet folder except the last one.I will be working on it after GSoC.
Mailmine.py script contains the final code which combines all snippets into one.
Three pull requests are to be merged after the confirmation from my mentor.
These are the abstract about what I have done within these three months.
It was an amazing and thrilling coding ride.
Stay tuned for the elaborated blog posts with DebConf experience and many more.
A year ago today, I started working for Booking.com. I wish I could say that the time has flown by, but it really hasn t. It has been one hell of a ride on all fronts: work, learning experiences, friends, but specially at home, since working for this company didn t come without a complete life change. So far so good, and for that I m grateful :)
I like to read Planet Perl Iron Man, but since I m less and less of a user of Google Reader these days, I prefer to follow interesting feeds on Twitter instead: I don t have to digest all of the content on my timeline, only when I m in the mood to see what s going on out there. So, if you wanna follow the account, find it as @perlironman. If interested, you can also follow me. That is all.
RVM hates my guts. And it doesn t matter, because I hate RVM back even more. Since I was technologically raised by aging wolfs, I have strong reasons to believe that you just shouldn t have mixed versions of software on your production systems, specially, if a lot of things are poorly tested, like most of Ruby libraries, aren t backward compatible. I was raised on a world where everything worked greatly because the good folks at projects like Debian or Perl have some of the greatest QA processes of all time, hands down. So, when someone introduces a thing like RVM which not only promotes having hundreds of different versions of the same software, both on development, testing and production environments, but also encourages poor quality looking back and looking forward, there isn t anything else but to lose faith in humanity.
But enough for ranting.
I had to deliver this side project that works with the Twitter API and the only requirement pretty much was that it had to be both run from the shell but also loaded as a class within a Ruby script. And so I did everything locally with my great local installation of Ruby 1.8.7. When it came the time to load on the testing/production server I found myself on a situation where pathetic RVM was installed. After spending hours trying to accommodate my changes to run properly with Ruby 1.9.2, I set up a cron job using crontab to run my shit every now and then. And the shit wasn t even running properly. Basically, my crontab line looked something like this:
*/30 * * * * cd /home/david/myproject && rake awesome_task
And that was failing, crontab was returning some crazy shit like Ruby and/or RubyGems cannot find the rake gem . Seriously? Then I thought, well, maybe my environment needs to be loaded and whatever, so I made a bash script with something like this:
#!/bin/bash
cd /home/david/myproject
/full/path/to/rvm/bin/rake -f Rakefile awesome_task
And that was still failing with the same error. So after trying to find out how cron jobs and crontab load Bash source files, I took a look at how Debian starts its shell upon login. And while that didn t tell me that much that I didn t know, I went to look at the system-wide /etc/profile and found a gem, a wonderful directory /etc/profile.d/ where a single shitty file was sitting, smiling back at me, like waiting for me to find it out and swear on all problems in life: rvm.sh. /etc/profile is not being loaded when I just run /bin/bash by my crappy script, only when I log in, I should ve known this. Doesn t RVM solve the issue of having system-wide installations so the user doesn t have to deal with, you know, anything outside of his own /home ?
So I had to go ahead and do:
#!/bin/bash
source /etc/profile
cd /home/david/myproject
/full/path/to/rvm/bin/rake -f Rakefile awesome_task
And hours later I was able to continue with work. Maybe this will help some poor bastard like myself on similar situation on the future.
Of course one can argue that I could ve installed my own RVM and its Ruby versions, but why, oh why, if it was, apparently, already there. Why would I have to fiddle with the Ruby installations if all I want is get my shit done and head to City Bakery where I can spend that money I just earned on chocolate cookies? My work is pretty simple to run with pretty much any ancient version of Ruby, nothing fancy (unless you call MongoMapper fancy). RVM is a great project that doesn t solve an issue, but just hides some really fucked up shit on the Ruby community.
#!/bin/bash
while [ 1 ]; do
read -p "What shall I say? "
espeak "$REPLY"
done
It was a hit. He said what he wanted to hear and hit the keys, my job was to spell for him.
Oh, also: he discovered key combinations that did things that were unsurprising to me (like taking the screen grab above) and also things that I'm still scratching my head about (like causing a prompt on the screen that said: "Downloading shockwave plugin." No thanks. And, how did he do that?
--use-pdebuild-internal. This was based on a patch from
Rafa D ugo cki.
You can get the latest version of git-pbuilder from
my scripts page.
shared_buffers for which a rule of thumb says that is should be set to 0.25*RAM.
In DBaaS, when you scale the DB instance up or down, parameters are adjusted for you by the cloud
provider, e.g. AWS RDS uses parameter groups for that reason, where particular parameters are
defined depending on the size of the RAM of the RDS instance.
So what can you when you do not have RDS or any other DBaaS? You can always keep several
configuration files on your instance, each for a different memory size, you can rewrite you config
every time you change the size of the instance or you can use Ansible role for that.
Our Ansible role will be very simple, we will have two tasks. One will change the PostgreSQL config,
the second one will just restart the database server:
---
- name: Update PostgreSQL config
template: src=postgresql.conf.j2 dest=/etc/postgresql/9.5/main/postgresql.conf
register: pgconf
- name: Restart postgresql
service: name=postgresql state=restarted
when: pgconf.changed
ansible_memtotal_mb. Since it returns RAM size in MBs, we will stick to MBs.
We will define the following parameters, you can adjust them to your needs:
shared_buffers, as 0.25*RAM size,work_mem, as shared_buffers/max_connections,maintenance_work_mem, as RAM GBs times 64MB,effective_cache_size, as 0.75*RAM size.postgresql.conf.j2 are below:
max_connections = max_connections
shared_buffers = (((ansible_memtotal_mb/1024.0) round int)*0.25) int*1024 MB
work_mem = ((((ansible_memtotal_mb/1024.0) round int)*0.25)/max_connections*1024) round int MB
maintenance_work_mem = ((ansible_memtotal_mb/1024.0) round int)*64 MB
effective_cache_size = (((ansible_memtotal_mb/1024.0) round int)*0.75) int*1024 MB
max_connections to you specific needs. An example playbook could look like:
---
hosts: my_postgres
roles:
- postgres-config
vars:
- max_connection: 300
$ ansible-playbook playbook.yml
The gig poster
Nano Kino 7"
Welcome to gambaru.de. Here is my monthly report that covers what I have been doing for Debian.
Debian Android
There's been a bunch of coverage of this attack on Microsoft's Secure Boot implementation, a lot of which has been somewhat confused or misleading. Here's my understanding of the situation.This will create a text file profile.coz with the instrumentation information. To show what part of the code affect the performance most, use a web browser and either point it to http://plasma-umass.github.io/coz/ or use the copy from git (in the gh-pages branch). Check out this web site to have a look at several example profiling runs and get an idea what the end result from the profile runs look like. To make the profiling more useful you include <coz.h> and insert the COZ_PROGRESS or COZ_BEGIN and COZ_END at appropriate places in the code, rebuild and run the profiler. This allow coz to do more targeted experiments. A video published by ACM presenting the Coz profiler is available from Youtube. There is also a paper from the 25th Symposium on Operating Systems Principles available titled Coz: finding code that counts with causal profiling. The source code for Coz is available from github. It will only build with clang because it uses a C++ feature missing in GCC, but I've submitted a patch to solve it and hope it will be included in the upstream source soon. Please get in touch if you, like me, would like to see this piece of software in Debian. I would very much like some help with the packaging effort, as I lack the in depth knowledge on how to package C++ libraries.coz run --- program-to-run
Next.