Linux

Nginx, Conditioned Proxy_set_header Assignment

Sometimes it’s needed to assign some proxy header depending on some variable value. But proxy_set_header does not work with “if” cause (at least didn’t work with nginx 1.4.1). So the following construction won’t work:

Some Notes Regarding Rsyslog and Remote Logging for Rails Apps

We use SyslogLogger gem in order to forward rails application log to system log.

in rails Gemfile:

group :production do
  gem "SyslogLogger", "~> 2.0", :require => 'syslog/logger'
end

in config/environments/production.rb

config.logger = Syslog::Logger.new "rails_application_name" 

The problem was that logs actually were forwarded to syslog, messages and user.log and sent to remote server and written to syslog, messages and user.log there. I was asked to make things DRY(ier).

Skype + Pulseaudio 4.0 in Debian Jessie/testing Buzz

After the recent system upgrade of my Debian x64 home desktop I’ve noticed Skype started to make creepy buzzzzzzz sound or no sound at all. The issue is caused by the new version of pulseaudio, 4.0. The workaround is to set environment variable PULSE_LATENCY_MSEC=30: $ PULSE_LATENCY_MSEC=30 skype &>/dev/null & Here is a thread devoted to this issue.

RaspberryPi with Root Partition encryption, unlocked using a flash drive

  • Why unlock using flash drive: Because you don’t have keyboard or monitor connected to your RPi, do you?
  • Information: I was using Pezz’s gist, which helped me a lot. Thank you very much, Pezz.
  • Why Arch linux: because I wanted to try Arch, default kernels of Raspbian and Pidora lack(lacked? Maybe already have) needed encryption modules.

SD card preparation

Download Arch linux image from here: RPi downloads

On your desktop check list of devices:

$ ls -lah /dev | grep sd

brw-rw---T   1 root disk      8,   0 Aug 11 15:43 sda
brw-rw---T   1 root disk      8,   1 Aug 11 15:43 sda1
brw-rw---T   1 root disk      8,   2 Aug 11 15:43 sda2
brw-rw---T   1 root disk      8,   3 Aug 11 15:43 sda3
brw-rw---T   1 root disk      8,   4 Aug 11 15:43 sda4

Now insert SD card into card reader on desktop, and check list once again. You’ll see a new device we’ll write Arch linux image to.