понедельник, 15 сентября 2014 г.

transfer archive log to standby manually with rman

Sometimes for resolve gap in oracle standby you need to copy some archivelog from primary database. And the simplest way to do it - rman which is connected to both databases
So we have situation which oracle can't resolve gap automatically. In alert log a lot of messages like this:
Fetching gap sequence in thread 2, gap sequence 3886-3888

We just connecting with rman to primary and standby:
rman target 'sys/'@primary auxiliary 'sys/'@standby

and then run:
backup as copy archivelog sequence between 3886 and 3889 thread 2 auxiliary format '+DATA';

That's all. :)

пятница, 7 января 2011 г.

dell e4200, troubles with sound (ubuntu 10.10)


asimakov@asimakov-laptop:~$ sudo lshw -C multimedia
*-multimedia
description: Audio device
product: 82801I (ICH9 Family) HD Audio Controller
vendor: Intel Corporation
physical id: 1b
bus info: pci@0000:00:1b.0
version: 03
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: driver=HDA Intel latency=0
resources: irq:47 memory:f6adc000-f6adffff

add some magic lines to /etc/modprobe.d/alsa-base.conf

asimakov@asimakov-laptop:~$ cat /etc/modprobe.d/alsa-base.conf | grep snd-hda-intel
options snd-hda-intel model=3stack-dig
options snd-hda-intel enable_msi=1
options snd-hda-intel single_cmd=1


more information here: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/274424

воскресенье, 3 февраля 2008 г.

create executable file from lisp source (sbcl)

This is a very simple lisp file:

(print "Hello. World!")

At first, need compile this file:

:~$ sbcl --noinform
* (compile-file "helloworld.lisp" :output-file "helloworld")

; compiling file "/home/asimakov/helloworld.lisp" (written 04 FEB 2008 12:44:58 AM):
; compiling (PRINT "Hello. World!")

; /home/asimakov/helloworld.fasl written
; compilation finished in 0:00:00
#P"/home/asimakov/helloworld.fasl"
NIL
NIL
*

Next, load module binfmt_misc and mount binfmt_misc filesystem:

:~$ sudo modprobe binfmt_misc
:~$ sudo mount -t binfmt_misc none /proc/sys/fs/binfmt_misc

At last, register fasl filetype (from root of course) by the specyfing a byte pattern:

:~$ echo ":lisp:M::\x23\x20FASL::/usr/lib/sbcl/sbcl-run:" > /proc/sys/fs/binfmt_misc/register

or by extension:

:~$ echo ':lisp:E::fasl::/usr/lib/sbcl/sbcl-run:' > /proc/sys/fs/binfmt_misc/register

That's all, you can execute fasl from command line:

:~$ chmod +x helloworld.fasl ; ./helloworld.fasl
"Hello. World!"


See also:
Documentation for binfmt_misc: http://www.kernel.org/doc/Documentation/binfmt_misc.txt

среда, 28 ноября 2007 г.

read stream in sbcl

(with-open-stream (files
(sb-ext:process-output
(sb-ext:run-program "/usr/bin/cat" '("/path/to/file")
:output :stream)))
(loop :for line = (read-line files nil nil)
:while (and
(my-mega-condition-p line))
line) :do (princ line) (terpri)))

понедельник, 5 ноября 2007 г.

imap, gnus & gmail.com

~/.gnus.el

(setq user-mail-address "asimakov@gmail.com")
(setq user-full-name "Alexey Simakov")
(load-library "smtpmail")
(load-library "nnimap")
(load-library "starttls")
(setq gnus-select-method '(nnimap "imap.gmail.com"
(nnimap-address "imap.gmail.com")
(nnimap-server-port 993)
(nnimap-authinfo-file "~/.imap-authinfo")
(nnimap-stream ssl)))

(setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-default-smtp-server "smtp.gmail.com"
send-mail-function 'smtpmail-send-it
message-send-mail-function 'smtpmail-send-it
smtpmail-smtp-service 587
smtpmail-auth-credentials '(("smtp.gmail.com"
587
"asimakov@gmail.com"
nil)))
(add-hook 'gnus-topic-mode-hook 'gnus-topic-mode)

~/.imap-authinfo
machine imap.gmail.com login asimakov@gmail.com password MyPassword port 993


get CA certificates and put them in ~/Mail/certs/

$ cd ~/Mail/
$ wget http://members.cox.net/mynameisdavid/archive/certificates.zip
$ unzip certificates.zip
$ mv cer certs

суббота, 28 июля 2007 г.

remote swank server, emacs & unicode

.emacs:
(add-to-list 'load-path "~/elisp/slime")
(require 'slime)
(setq slime-net-coding-system 'utf-8-unix)
(set-language-environment "utf-8")
(slime-setup)

swank.lisp:
(require 'asdf)
(asdf:oos 'asdf:load-op 'swank)
(setq swank:*use-dedicated-output-stream* nil)
(swank:create-server :coding-system "utf-8-unix")

On remote host:
$ sbcl --load swank.lisp

ssh tunnel for slime using putty:
Putty Configuration Menu->New Session->Connection->SSH->Tunnels:
Source port: 4005
Destination: localhost:4005

Putty Configuration Menu->Session:
Host name or ip: user@host-with-swank

ssh tunnel for slime using ssh:
ssh -2 -N -f -L 4005:localhost:4005 user@host-with-swank

Connect to slime:
M-x slime-connect


Links:
Emacs for Windows
SLIME