Register now and start sharing your code snippets.
-->

How to disable Oracle's variable name scanning

SQL posted 2 months ago by christian

Normally Oracle will scan SQL for variables and prompt for the value at runtime, to disable this feature use the “set scan off” command:

   1  set scan off;
   2  
   3  select * from links where href = 'http://...&....';

Tagged sql, oracle, disable

How to change the Apache 2 server signature on Debian Etch

Apache posted 4 months ago by christian

Install mod_security, for some stupid reason it’s not included in Debian Etch, and for some even more stupid reason you’re not allowed to change the value of the Server header.

Anyway, to change the server signature, and enable voodoo magic:

   1  <IfModule mod_security2.c>
   2      # Basic configuration options
   3      SecRuleEngine On
   4      SecRequestBodyAccess On
   5      SecResponseBodyAccess Off
   6  
   7      # Handling of file uploads
   8      # TODO Choose a folder private to Apache.
   9      # SecUploadDir /opt/apache-frontend/tmp/
  10      SecUploadKeepFiles Off
  11  
  12      # Debug log
  13      SecDebugLog /var/log/apache2/modsec_debug.log
  14      SecDebugLogLevel 0
  15  
  16      # Serial audit log
  17      SecAuditEngine RelevantOnly
  18      SecAuditLogRelevantStatus ^5
  19      SecAuditLogParts ABIFHZ
  20      SecAuditLogType Serial
  21      SecAuditLog /var/log/apache2/modsec_audit.log
  22  
  23      # Maximum request body size we will
  24      # accept for buffering
  25      SecRequestBodyLimit 131072
  26  
  27      # Store up to 128 KB in memory
  28      SecRequestBodyInMemoryLimit 131072
  29  
  30      # Buffer response bodies of up to
  31      # 512 KB in length
  32      SecResponseBodyLimit 524288
  33  
  34      SecServerSignature "Dummy value"
  35  </IfModule>
  36  

Tagged apache2, signature, server, header, disable

Disable pc speaker beep in Linux

Shell Script (Bash) posted about 1 year ago by marko

Not really a snippet, still a good fix for a big annoyance. Temporarily disable the speaker by removing the driver for it.

   1  sudo rmmod pcspkr

To make the silence more permanent add this line into /etc/modprob.d/blacklist

   1  blacklist pcspkr

Tagged pc speaker, linux, quiet, disable, audio, beep