mbank frontem do klienta [polish only]

ci z was co mnie znają ciut bliżej wiedzą, że mam permanentne problemy finansowe.

jakiś czas temu w mbanku wystąpiłem o kartę kredytową (jak chcesz skomentować: co za łoś, ma kłopoty finansowe i jeszcze kartę bierze, to sobie odpuść). mam u nich konta, więc karta od nich była logiczna.

kartę dostałem bezproblemowo.

fajnie.

korzystałem, spłacałem. wszystko fajnie.

do czasu. w pewnym momencie moje konto zostało zablokowane (przez bank, ale na życzenie innej strony). aby je odblokować musiałbym wpłacić kwotę rzędu wartości nowego (prosto z salonu) samochodu.

w sumie to nawet nie duży problem. z jednym haczykiem. karta kredytowa w mbanku jest “spięta" z kontem. a konto zostało zablokowane. jeśli cokolwiek na nie wpłacę – to tak jakbym wyrzucił przez okno – od razu zniknie.

impas. nie mam jak spłacać karty. a nie chcę z niej rezygnować – pomijając wszystko inne – rezygnując musiałbym spłacić całe zadłużenie karty, które jest … istotne.

zadzwoniłem do mbanku. dowiedziałem się, że:

  1. jak nie spłacę karty to oni skierują ją do windykacji (czytaj: napomnienia, komornik, wejście na konto)
  2. skoro konto mam zablokowane to nie mam jak spłacić
  3. aby odblokować konto musiałbym wpłacić “samochód"
  4. aby karty nie skierowali do windykacji muszę rozwiązać umowę na konto, wtedy karta też zostanie skasowana. ale będę musiał od ręki wpłacić całe zadłużenie karty.

oops. zadłużenie karty to kilka średnich krajowych. nie uśmiecha mi się “rzeźbienie" by taką kasę “natrzepać". dodatkowo – nie chcę kasować konta – fajne jest i jak kiedyś w końcu odblokuję, to z przyjemnością będę sobie z niego korzystał.

pani w infolinii była bardzo miła, ale powiedziała, że innej metody nie ma. mogę co najwyżej wysłać do nich podanie pocztą (nie emailem, taką pocztą co to ślimakami ją dostarczają), ale i tak odpowiedzą mi to samo.

no nic. podanie napisałem, przedstawiłem sytuację, powołałem się na długi staż bycia klientem i brak zadrażnień.

2 tygodnie później dostałem odpowiedź. mbank specjalnie dla mnie założył nowe konto (na tyle interesujące, że nawet nie ma nazwy (tak jak mBiznes, eKonto czy eMax, to ma “*** UNNAMED ***"). konto to jest odblokowane i może służyć jedynie do spłat karty.

sprawdziłem – działa.

czyli jednak się da.

wnioski:

  • banki potrafią iść na rękę. czasem wystarczy po prostu poprosić
  • panie z infolinii nie zawsze pomogą, są przygotowane do obsłużenia 99.9% typowych spraw. a czasem się po prostu spada poza ten “nawias" 🙂
  • lubię mbank

finding optimum tables placement in 2-tablespace situation

just recently we got another array for out main production database. this means – we will be able to add new tablespace, thus making everything go faster.

in theory – it's nice. but which tables to move to the other?

the basic assumption is simple – index on table should not be on the same tablespace as the table itself. that's easy. but – should we really put all tables on one tablespace, and all indexes on another?

we decided that the important things that should be “boosted" are seeks and writes. sequential reads are (in our situation) more or less irrelevant.

read on to check how we split the load.

Continue reading finding optimum tables placement in 2-tablespace situation

easy access to postgresql documentation from firefox

for whatever reason i seem to remember names of files in postgresql documentation.

for example – i know, that psql docs are in app-psql.html, base page for configuration options is runtime-config.html. manual for “alter table" sql command, is in sql-altertable.html.

yet full page url (http://www.postgresql.org/docs/current/interactive/app-psql.html) is very long. on the other hand going to http://www.postgresql.org/docs/current/interactive/ is nto really useful, as i need to find specific page which i remember filename, but not necessarily title.

is there any solution? apparently, yes, simply follow these steps:

  1. go to http://www.postgresql.org/docs/current/interactive/
  2. bookmark this page
  3. go to “Bookmarks" -> “Organize Bookmarks…"
  4. find the bookmark that you just created, select it, and click on “properties" in toolbar
  5. in “keyword" enter letter “p" (without quotes)
  6. change url to http://www.postgresql.org/docs/current/interactive/%s.html
  7. press “ok" (you might want to create a special folder to hide this bookmark from standard view, as you will never use it directly)

and that's all. after you've done it, you can simply enter: “p app-psql" in your location edit box, press enter and you will be directed to correct page.

of course this trick works not only with postgresql docs. it can be used for google, search.postgresql.org, anything you want. but using this for postgresql manual will definitely shorten time spent on “going to manual" 🙂

dell powervault md1000 – storage test

i recently got new toy for tests – brand new dell powervault md1000.

what's this, you ask? basically – a rather nice das (direct attached storage) from dell.

the box i got had 15 sas discs, each disc being 72gb, 15krpm.

since this will be used as database storage, i wanted to make some performance tests.

Continue reading dell powervault md1000 – storage test

what fields are usually changed when update’ing?

there was this situation, that we had a lot of tables and a lot of update activity. so, we thought about splitting the most updated tables to parts that are usually stable, and parts (columns) which change often.

but how to know what changes? unfortunately orm that was used issued updates like this:

UPDATE TABLE SET field1='..', field2='...', field3='...' WHERE id = 123;

basically it always updated all fields. (don't even start to comment that orms are by definition broken).

so, i had to find a nice way to find out what was really updated.

Continue reading what fields are usually changed when update'ing?

postgresql tips & tricks

cortilap @ freenode's #postgresql asked about how to create a check() that will allow only one of the columns to be not null.

it doesn't sound cool, let's see:

with 2 columns (a,b) you make a check: check ( (a is not null and b is null) or (a is null and b is not null) or (a is null and b is null))

whoa. and what about 3 columns? 4?

of course it creates some questions about the schema, but is there a way to do it? without such long checks?

one solution is to make a function to check it. but perhaps a simpler solution is possible?

luckily all of the fields are ints.

a quick think, and here we go:

check (coalesce(a*0, 1) + coalesce(b*0, 1) + coalesce(c*0, 1) > 1)

and what is the field was text? same thing, but instead of doing “X"*0, i would do “length(X)*0" 🙂

while + ssh = ?

[ wersja polska poniżej ]

english version

just found this nice brain teaser.

i have this code in bash:

echo -e "1 1\n2 2" | while read A B; do echo "[$A] [$B]"; echo "ZZZ"; done

it will print:

[1] [1]
ZZZ
[2] [2]
ZZZ

which is perfectly valid and sensible.

but if i'll change the command to:

echo -e "1 1\n2 2" | while read A B; do echo "[$A] [$B]"; ssh localhost date; echo "ZZZ"; done

i.e. i added ‘ssh localhost date' which connect to localhost over ssh, logins to my own account, and issues “date" command (can be any command), it shows only:

[1] [1]
Tue Sep 18 15:45:24 CEST 2007
ZZZ

and finishes work. (i have a password-less login in localhost, so it doesn't ask for password).

and the question is: why there is no second step of while loop?

( side note: i know the answer, it's just a riddle for you 🙂

wersja polska

trafiłem właśnie na niezłą łamigłówkę:

poniższa linijka w bashu:

echo -e "1 1\n2 2" | while read A B; do echo "[$A] [$B]"; echo "ZZZ"; done

wypisze:

[1] [1]
ZZZ
[2] [2]
ZZZ

co jest w pełni sensowe i oczekiwane.

ale jeśli zmienię ją na:

echo -e "1 1\n2 2" | while read A B; do echo "[$A] [$B]"; ssh localhost date; echo "ZZZ"; done

tzn. dodam ‘ssh localhost date', co łączy się na moje konto na localhoście i wykonuje polecenie “date" (może to być dowolne polecenie), wynikiem całości jest tylko:

[1] [1]
Tue Sep 18 15:45:24 CEST 2007
ZZZ

i to koniec (mam logowanie bezhasłowe więc nie ma prośby o hasło).

pytanie: czemu nie ma drugiego wykonania kodu w pętli while?

( oczywiście (jak przy poprzednich łamigłówkach) znam odpowiedź ).