Skip to content

Margus Roo –

If you're inventing and pioneering, you have to be willing to be misunderstood for long periods of time

  • Cloudbreak Autoscale fix
  • Endast

Author: margusja

Harilik nädalavahetus

Posted on August 4, 2008 - July 10, 2017 by margusja

Laupäev. Tsiklimehed kes kogunesid Jõgeval arvasid et ülikõva oleks vaadata kuidas langevarjurid kaubamaja katusele hüppavad. Kuna kutid olid oma lava kohe kaupsi kõrvale paigaldanud siis ega nad sealt kaugemale ei viitsinud minna ja tahtsid sealtsamast tsekkida kuidas rahvas hüppab. Kuna seal lähedal ühtegi kohta polnud kuhu maanduda siis oli ainus enamvähem sile koht kaubamaja katus

Alguses tegime lihtsalt trenni 🙂

Ok, klient on kuningas, me siis panime sinna.

Pühapäeval hakkas vihma sadama. Siis läksin sukelduma 🙂

Posted in Fun, LangevarjundusLeave a comment

Tilsi demo

Posted on August 1, 2008 by margusja

Demo. Tegelikult peaks asi välja nägema umbes sedasi:

Maandumiskoha analüüs, varuplatside valik, varustuse valik vastavalt maandumisalale. Juhul kui mingit kola küljes siis kuidas seda kinnitada jne.

AGA! päriselus juhtub alati millegipärast teisiti 🙂 Üks näide.

Maandume Ridali 45. sünnipäevapidustustele. Minu plaanist vaadata üle plats – Tilsi staadion, sellele tõmmatakse kohe vesi peale, kiire pidavat olema. Hea et kaasa sai võetud Balance-260 selleks tarbeks kui ei usalda sinna natuke kiirema kupliga minna.

Kohe peksti peaaegu lennukisse tagasi ja hoo pealt jooksis mingi vana, et pane ikka lipp ka külge. Mina, et kuhu ma selle lipu panen, kõik varustus millega ma lippu harilikult kinnitan kodus. Kuna aga vana tahtis mulle lippu külge pookida siis lihtsalt auk sisse ja ülemine ots jalarihma külge. Ma siis, et alla on ka midagi vaja muidu on nagu kalts järgi ja juhendasin et mingi vee pudel ja nõõr abiks. Lennukisse kõndimise pealt vana installis pudeli ja nõõri lipu alumisse otsa.

Kuna polnud aega seda lippu kuidagi ka pakkida siis kahmasin lihtsalt pudeli ja lipu vasaku käega vastu rinda ja lennukist siis Tilsi staadioni kohal jee 🙂

Tõmbasin avamisrõnga, mul oli sattunud vedru konfis kama, ja sain mõnusad tropikeerid, tnx kellelegi õpilasele kes pakkimist vist õpib. Ok oli siis vaja sipelda need lahti. Lipu viskasin nüüd käest ja vaatasin selle peale kuidas Vana installitud pudel alla kadus – lendas küljest minema. Lipp lopendas järgi nagu ranitsaklapp.

Tislsi staadion on suur staadion. Sinna oleks võinud ka kiirema varjuga vabalt minna. AGA! kogu see staadion oli rahvast täis kes jooksid riburada ringi. Kui mina maanduma tulin aeglase ja rahuliku balance-260ga siis mingi mutt-noor ema oma titevankriga arvas et ma kukun otse alla, teatavasti tiibvari liigub natukene siiski edasi, seda mutt ei teadnud. Samas ta tajus vist seda, koguaeg liikus oma vankriga edasi – samas suunas kuhu mina oleks maanduma pidanu. Mitte et mul probleem selle varjuga kuhugi mujale maanduda.

Selline blogi siis 🙂 oi vinge… ossum! hmm… ok kaduge nüüd siit. Ärge arvake et see igapäevaseks saab… noh et ma bloggin 🙂 ok Musi 🙂

Posted in Langevarjundus1 Comment

ITIL, coffemachine and servicedesk

Posted on July 14, 2008 by margusja

“How’s that job going?” the Boss asks hurriedly, ducking into Mission Control.

“Which job?” I ask.

“The installation,” he responds, obviously believing that I have some idea of what he’s talking about.

“The installation?” I ask.

“The server installation.”

“What server installation?” I ask, beginning to wonder if the Alzheimer’s is kicking in.

“The WEB server – for PR.”

Okay, so it’s Alzheimer’s – which is a bit of a shame actually as I could have kept all those aluminium pots I threw away a year ago. Unless…

“Are you doing the server install for PR?” I ask the PFY.

“What server install for PR?” the PFY asks – and I KNOW he can’t have Alzheimer’s because he eats takeaways and avoids deodorant like vegetarian food.

“The Web Server,” the Boss repeats with more than a touch of frustration. “The new Public Relations Web server!”

“WHAT NEW PUBLIC RELATIONS WEB SERVER?!” the PFY and I snap.

“It’s in your helpdesk queue!” the Boss says, FINALLY giving us a bit of useful information.

“Ah, the SERVICE desk queue,” I say, being ITIL compliant. “When did that go in?”

“This morning,” he replies.

“Ah, and what priority did you give the Job?”

“High.”

“High,” I say to the PFY. “What’s the response time on that?”

“One working day,” the PFY says.

“Oh, ok, so we’ll probably get back to you on Monday,” I say. “Unless of course we fail to meet our response target in which case the job will escalate to you and you can follow-up with us Monday lunchtime.”

“So… the server’s not going to be ready by the weekend?!” the Boss gasps.

“No, no,” the PFY says, calming the Boss down a little.

“Oh good.”

“No,” the PFY continues. “What he’s saying is we don’t have to get back to you to have the whole ‘What server?’ ‘The Web Server’ ‘What Web Server?’ ‘The PR Web Server’ ‘What PR Webserver?’ conversation until monday. If we meet our response target.”

“B-But… we need the server up and running before the weekend!” the Boss gasps. “The company’s running an online promotional competition which they’ve advertised in a mailout!”

“Hmmm,” the PFY says. “And they waited until now to worry about the server?”

“Not exactly,” the Boss says, guilt oozing from his pores.

“YOU waited until now to worry about the server?”

“No,” the Boss blurts. “The developers said it would run on any web server, so PR put it on their web server last night but overnight it had a meltdown and we need a replacement server!”

“What sort of meltdown?”

“The whole thing collapsed – the disk filled up and the database log thing went berserk and the web server crashed and they can’t fix it,” the Boss gabbles. “So we need a server before the weekend!”

“In that case you should ring the service desk and get the priority changed to Urgent,” I say to the Boss. “Because then the response time drops to two hours.”

“Just look at it now pleeeease,” the Boss pleads.

“I’d like to,” I lie. “I honestly would, but if I do that then I’d be resolving a non-urgent call before an urgent one – which would show up when they analyse the KPIs which are set as part of our annual bonus calculations. I need to fix the urgent call first or get your job made urgent.”

“So what’s the other urgent call?”

“Someone wants us to put SNMP into the coffee machine so the know when the beans need to be refilled,” the PFY responds.

“THAT’S NOT BLOODY URGENT!”

“It was logged in the service desk as urgent,” the PFY says. “Apparently the CEO was here last week and someone offered him a coffee but couldn’t give him one because the beans were out and the refills were locked away to stop people stealing them for home…”

“Well, can’t you change my call?”

“Only the owner of a job or the service desk can change it’s priority,” the PFY says. “Because apparently SOME people thought that we’d deprioritise calls we didn’t want to do…”

“I…” the Boss says, getting the guilty look again. “I’ll go and change the priority and be right back!”

…two minutes later…

“So when will the server be ready?”

“I think we can probably have it run up by next Wednesday.”

“But it’s URGENT, you need to get started now.”

“I would but I have to deal with the Critical jobs first.”

“What critical jobs?”

“The coffee machine job,” the PFY says. “It’s just been upgraded to Critical. Apparently the CEO asked for a raincheck on the coffee!”

“But you never said there was a critical!”

“There wasn’t one then,” I say. “It got upgraded.”

“So how does the urgency thing work?” the Boss snaps.

“High is priority 2, Urgent is priority 1 and Critical is priority 0.”

“So Critical’s as important as it gets?”

“Yup!”

“Right!’ the Boss says, stomping out.

“Quick,” I say to the PFY. “Change the required resolution time of the cof…”

“Onto it!” the PFY snaps, updating his service desk call. “but I was just thinking – have you looked into the urgency mapping to see if it supports…”

“Negative numbers?” I ask. “Already onto it and it does…One Super Duper Critical coming up!”

Posted in FunLeave a comment

Fedora 8 ja RocketRaid-1640

Posted on June 13, 2008 - June 13, 2008 by margusja

Panen siin endale paari reaga kirja. Päris segane installeerimise käik oli.

Arhidektuur: i386

Meedia: Fedora-8 dvd

Lisaseadmed: väline usb dvd ja väline usb fd seade.

RocketRaid-1640 draiver http://www.highpoint-tech.com/BIOS_Driver/rr1640/Linux/RR154x_1640-fc8-v2.18-011108.tgz

Lasin raidi draiveri image fd peale ja kukkusin installima.

dd-ga andsin teada et ma soovin omaltpoolt ka draivereid lisada.

Kui jõudis kätte koht kus draiverit küsida siis kenasti oli mul see võimalus ja usb fd oli sda
– ilmselt kuna tal muid selliseid seadmeid polnud.  Okei kenasti näitas et loeb draiveri sisse ja ka kõrvalaknas jooksev logi tõendas seda. Natukese aja pärast teatas et midagi on viga ja et kas tahad jätkata või manuaalselt draiveri listist valida – ilmselt seetõttu et nüüd ilmus sda-ks raid mille olin rocketRaid kontrolleriga teinud. Ok siinkohal, peale mitmeid katseid avastasin et jätkamine on kõige tulemuslikum. Mingil hetkel küsib jälle draiverit, ilmselt tahab veel midagi saada ja sda see seade ju enam ei ole. Siis sai valitud sdb talle. Sellega rahul läks edasi. Kõik kena. Install läbi ja reboot. Peale rebooti tuli kuhugi maani ülesse, ilmselt kerneli ta pidi leidma, siis kui /proc /sys jne pardatsioone hakati tegema siis oli häda käes ja sinna ta jäi.

Siis tegin seda mida oleks pidanud alguses lugema – lugesin rocketraidi mauaali ja seal selgus et on script mida peale installi ja enne rebooti peab tegema. Ainuke jama oli selles, et minu installitavas masinas peale df mountimist mina ühegi nipiga ei suutnud sealt midagi korraliku lugeda. Samas panin selle fd teise masina taha Fedora-7 ja seal toimis kenasti. Deem! Okei, võtsin siis mälupulga ja kopeerisin kogu df kola sinna ja lasin instaleeritava masina rescue modes ülesse. fd ja usb pulk külge. Proovisin korra veel vastavalt rocketRaidi maunuaalile fd mountida kuid ikka ebaõnn. Nüüd mountisin usb pulga ja see õnnestus kenast ja ma nägin vastavalt manuaalile õigeid faile. Käivitasin vastavalt manuaalile skripti, samas märkasin et scripti töötamise ajal mis oli käivitatud usb pulgalt, luges ta aktiivselt ka midagi fd-lt. Igatahes teatas skript et kõik on broo ja peale restarti ka mu F8 ja rocketraid kenasti toimetasid.

Posted in LinuxLeave a comment

Kuidas paigaldada Mysql replica’t

Posted on June 11, 2008 - June 11, 2008 by margusja

Mul on kaks serverit vhost1 ja vhost2

Paigaldan mõlemasse serverisse mysql-server paketi. Mina kasutan > yum install mysql-server
vhost1 masinas oleva mysql serveri seadistan master serveriks. Master serveri seadistamine on lihtsam.
Ava /etc/my.cnf
[mysqld] sektsioonis lisad rea:
server-id= [n] #kus n on unikaalne täisarv sinu mysql serverite gruppis mida kavatsed peegeldada.
log-bin=/path/[mysql-bin-log-file] # fail kuhu master logib muudatused binary kujul.

Loome master mysql serverisse kasutaja slave mysql serveri jaoks.

GRANT REPLICATION SLAVE, REPLICATION CLIENT
ON *.*
TO ‘replicant’@’slave_host’
IDENTIFIED BY ‘my_pwd’;

Seadistame vserver2’s asuva slave mysql serveri.

Ava /etc/my.cnf

[mysqld] sektsiooni lisa:

mysql-id=[n] # n on unikaalne täisarv sinu mysql serverite grupis

logime mysql CUI peale: > mysql mysql

Siin kasutame CHANGE MASTER TO lauseid. http://dev.mysql.com/doc/refman/5.0/en/change-master-to.html

mysql>change master to master_host = ‘[mysql master server IP]’;
mysql>change master to master_user = ‘[slave user]’;
mysql>change master to master_password = ‘[slave user password]’;
mysql>start slave;

slave mysqlserver on seadistatud master mysqlserveri jaoks.

Sünkroniseerime master- ja slave mysql serveri.

Juhul kui teil oli master mysqlserver kasutuses ja see sisaldab andmeid siis tuleks need enne kanda ka slave mysqlserverisse.

Teeme master mysqlserverist dumpfaili.

# mysqldump –user=root –password=my_pwd –extended-insert –all-databases –master-data > /tmp/backup.sql

Enne kui dumpfail lasta slave mysqlserverisse tuleb slave seisma panna:
>mysql stop slave;

Kui vaatad backup.sql faili siis on seal read:

CHANGE MASTER TO MASTER_LOG_FILE=’bin.000846′ ;
CHANGE MASTER TO MASTER_LOG_POS=427 ;

Juhul kui teete synkroniseerimist muul kujul siis hoolitsege et need laused saaksid slave mysqlserverisse.

laeme dumpfaili slave mysqlserverisse:

# mysql < /tmp/backup.sql

>mysql start slave;

Posted in LinuxLeave a comment

Mac OS X Leopard default browser

Posted on May 21, 2008 by margusja

Kuna asi käis vastavalt minu loogikale läbi ussimu**i siis panen siia endale tulevikuks kirja. Tegelikult oli asi väga lihtne. Avad mac OS X vaikimisi default browseri Safari. Preferences ja sealt valid default web browser mis iganes sulle meeldib.

Posted in MacLeave a comment

SVN hints

Posted on May 6, 2008 - March 3, 2010 by margusja

svn mkdir -m “message” file:///var/svn/repos/project – Loome reposse uue projekti kausta.

svnadmin load /var/svn/repos/ –parent-dir project project < svn.dump – Laseme dump faili reposse.

Vahel juhtub, et saad korralikult segi svn kataloogi. Näiteks palju lokaalseid faile on kustutatud ja reposse pole lastud. status “!”
Mina tegin nii. Kindlasti saab ka ühe reaga aga seda järgmine kord.


svn status | grep ! | awk {'print "svn delete " $2'} | sh

Posted in LinuxLeave a comment

Mac OS X 10.4 root parooli vahetus

Posted on March 10, 2008 by margusja

Click Restart at the login window
While the computer is restarting, hold down “Command-S” until you see text scrolling through the window. This boots the computer into single user mode.
At the Localhost% prompt type:
/sbin/mount -uw /
/sbin/SystemStarter
You will then see various services starting up.

When the Localhost% prompt reappears, type:
passwd root
It will then ask you to type the new root password twice, so do so.

After entering the new password, type:
reboot

Posted in MacLeave a comment

Plaan c++, postgre, pdf

Posted on February 19, 2008 - March 13, 2008 by margusja

Vastavalt sellele kuidas mul vaba ajaga on annan tead kuidas projekt areneb.

Eesmärk: Vastavalt sisendandmetele sooritatakse postgreSQL andmebaasis päring ning kasutades programmeerimiskeelt C++ tekitatakse PDF fail mis hiljem prinditakse.

Kasutatavad ressursid:
Programmeerimiskeel – C/C++
PostgreSQL db layer for C++ – libqxx (http://pqxx.org/development/libpqxx/)

Alustan vaikselt C postgreSQL connect testi.
Vajalikud headerid:
libpgeacy.h – port install libpgeacy
libpq-fe.h – see tundub poevat postgre dev paketis – fink install postgresql82-dev

Hetkel on asi sellises seisus ja kell on 00:30 aitab. Magama:
make all
Building target: tousuleht
Invoking: MacOS X C Linker
gcc -o “tousuleht” ./pgconnect.o
Undefined symbols:
“_connectdb”, referenced from:
_main in pgconnect.o
“_fetch”, referenced from:
_main in pgconnect.o
“_doquery”, referenced from:
_main in pgconnect.o
“_disconnectdb”, referenced from:
_main in pgconnect.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [tousuleht] Error 1

Selgus et MAC OS X ei oma sellist tooli nagu ldd aga omab hoopis otool -L

linux.ee pealt aidati ka:

[17:17] <Kang> Margusja_: postgres’i teek tundub puudu olevat.
[17:17] <Kang> -lpsql
[17:19] <kaups_AU> Margusja_: -lpgsql ?
[17:19] <Kang> failinimi on kuju libXYZ.so või libXYZ.a
[17:19] <kaups_AU> või mis iganes selle postgresi libra nimi võiks olla
[17:20] <Kang> sellele vastavalt gcc võti on -lXYZ
[17:21] <jussuf> -lpq peaks postgresi lib olema

Peale väikest otsimist paigaldasin fink abil libpqxx2 ja libpqxx2-shlibs

Jälle üks fakt, et igasugused poolautomaatsed builderid on saatanast.
kasutasin käsureal gcc asemel g++ compilaatorit ja hetkel tundub et mul on vajalikud libraryd olemas
libpqxx on see mida ma siis vajan.

Ja mida me veel õppisime. gcc on c compiler ja g++ on c++ compiler.

Kellelgi on sama probleem: http://archives.postgresql.org/pgsql-interfaces/2003-01/msg00115.php

Uhh nii!
Sain ka Mac OS X 10.5.2 peal postgre connection algfaasi kokku.
kasutasin C library (libpq) (C koodis #include libpq-fe.h)
Kuna gcc ei leidnud kohe libpq libraryt siis tuli minu süsteemis talle see ette anda -L/gw/lib -lpq – Selgitame:
-l lingib mingi library koodi külge. syntax: -lXXXX kus XXXX on mingi library, antud juhul oli tegu libpq kus lib jäetakse siis ära. Süsteemis asus library /sw/lib/libpq.a

Hetkel on kenasti asi seal maal, et postgresi baasiga on korralik ühendus olemas kasutades libpq ja C programmeerimiskeelt. Samuti saan andmebaasis andmeid kenasti lugeda ja kuvada.

Tänase õhtu nokitsemine lõppes sellega, et saan vastava CODE sisestamisega vastu vastava CODE andmed.

Asi on siis niikaugel et postgreSQL-ist saan seda mida tahan ja C array-sse suudan ka kogu selle kola kenasti panna.

Natuke nokitsemist ja Mac OS X 10.5 pdflib pakk peal ja kompilaator ka rahul.

Probleeme oli korra mõningate funktioonide leidmisega:

“_HUnlock”, referenced from:
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_CurResFile”, referenced from:
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_pdf_t1open_fontfile in libpdf.a(p_type1.lo)
“_FSpOpenDF”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FMGetFontFormat”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FSpOpenResFile”, referenced from:
_pdf_t1open_fontfile in libpdf.a(p_type1.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FMGetFontContainer”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfontfile in libpdf.a(ft_hostfont.lo)
“_HLock”, referenced from:
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_GetResource”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_CopyCStringToPascal”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfontfile in libpdf.a(ft_hostfont.lo)
“_GetEOF”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FMGetFontFromFontFamilyInstance”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_CloseResFile”, referenced from:
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_pdf_t1open_fontfile in libpdf.a(p_type1.lo)
_pdf_t1open_fontfile in libpdf.a(p_type1.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FSpGetFInfo”, referenced from:
_pdc_init_output in libpdf.a(pc_output.lo)
“_FSGetCatalogInfo”, referenced from:
_FSPathMakeFSSpec in libpdf.a(pc_file.lo)
“_FSpSetFInfo”, referenced from:
_pdc_init_output in libpdf.a(pc_output.lo)
“_UseResFile”, referenced from:
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_pdf_t1open_fontfile in libpdf.a(p_type1.lo)
_pdf_t1open_fontfile in libpdf.a(p_type1.lo)
_pdf_t1open_fontfile in libpdf.a(p_type1.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FSClose”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FSpMakeFSRef”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FMGetFontFamilyFromName”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_ReleaseResource”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FSRefMakePath”, referenced from:
_FSMakePath in libpdf.a(pc_file.lo)
“_FSPathMakeRef”, referenced from:
_FSPathMakeFSSpec in libpdf.a(pc_file.lo)
“_PBMakeFSRefSync”, referenced from:
_FSMakePath in libpdf.a(pc_file.lo)
“_Get1IndResource”, referenced from:
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
“_Get1NamedResource”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FSOpenResourceFile”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_GetHandleSize”, referenced from:
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_ResError”, referenced from:
_pdf_t1open_fontfile in libpdf.a(p_type1.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_Count1Resources”, referenced from:
_pdf_get_metrics_type1 in libpdf.a(p_type1.lo)
_pdf_t1open_fontfile in libpdf.a(p_type1.lo)
“_FSRead”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
ld: symbol(s) not found

Need lahenesid vastavalt siis kompilaatorile -framework võtmetega antavate parameetritega:

gcc -L/sw/lib/ -lpq -I /sw/include/postgresql/ -I/sw/include/ -lpdf -framework CoreServices pgconnect.c -o pgconnect

Peale seda kompilaator kaebas:Undefined symbols:
“_FMGetFontFormat”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FMGetFontContainer”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfontfile in libpdf.a(ft_hostfont.lo)
“_FMGetFontFromFontFamilyInstance”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
“_FMGetFontFamilyFromName”, referenced from:
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
_fnt_get_hostfont in libpdf.a(ft_hostfont.lo)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Puudu oli Fonts.h mis asus Mac OS X ApplicationServises framework kaustas.
Lisasime veel ühe framework-i ja kompilaator rahul
gcc -L/sw/lib/ -lpq -I /sw/include/postgresql/ -I/sw/include/ -lpdf -framework CoreServices -framework ApplicationServices pgconnect.c -o pgconnect

PDF fail luuakse kenasti – hetkel on küll loodava faili taustal PDFLIB reklaamurl.

Posted in Linux, Mac, Windows1 Comment

Internet Protocol (IP) Layers Explained

Posted on February 13, 2008 - January 22, 2009 by margusja

All IP packets have at least one header, which is known as the IP header; sometimes this header is also called a Layer 3 or network header. The IP header is simply a series of bits which have been grouped into fields of a set size. All IP headers have the same structure; the only difference will be which bits have been set to “1” to either turn on a field’s value or to represent a binary number within a field. Let’s take a closer look at the fields in an IP header:

Ver. IHL Type of service Total length
Identification Flags Fragment offset
Time to live Protocol Header checksum
Source address
Destination address
Option + Padding
Data

Here is one example packet between my computer and www.neti.ee webpage:

ip-packet

An IP packet has 14 fields; let’s go through these fields one at a time.
Version
This is a 4-bit field that indicates the IP version, written in binary. For example if you are using IPv4, the bits will be set to 0100; if you are using IPv6, the bits will be set to 0110.

IHL or header length
This 4-bit field indicates how long the IP packet header is; this value is used to distinguish which part of the IP packet is the header, and which part is the actual data. If you take a look at the picture of the IP packet, you’ll notice that it is 32 bits wide. Now take a look at the length of the packet: the data is not part of the header, the options are optional, but all other fields are required. This means that the minimum header length is five 32-bit words, or binary 0101. You’ll sometimes see these words translated into bytes; that is, five words multiplied by 4 bytes (32 bits divided by 8 bits to make a byte) equals a header length of 20 bytes. If the options are used, the header length will be at least six 32-bit words. Since this is a 4-bit field, the maximum length will be 2 to the power of 4 minus 1, or 15. This effectively limits the size of an IP header to 60 bytes (15 words multiplied by 4 bytes).

Type of Service (sometimes called TOS) flags
This field is 8 bits long; the first 3 bits are called precedence bits and the last 5 bits represent the type of service flags. These flags were originally created to prioritize which packets should be delivered and which packets could be dropped if a router became congested. Since then, other protocols have been invented to prioritize traffic and most routers ignore these flags even if they have been set.

Total length; also called packet length or datagram length
This 16-bit field represents the total length of the IP packet, meaning both the data and the header. The minimum size is 21 bytes (default header size plus one byte of data). Since this field is 16 bits long, the maximum packet size is 2 to the power of 16 minus one, or 65,535 bytes. (The minus one represents the illegal length value of 0.)

Identification
Every IP packet is given an identification number when it is created; that number is contained within this 16-bit field. It is possible for an IP packet to be separated into smaller “fragments” before it reaches its final destination; each fragment still belongs to the original IP packet, so each fragment will have the same identification number.

Flags
This field contains three flags as follows:
reserved flag: must always be 0
don’t fragment flag: if set to 0, this flag is off, meaning you can fragment the IP packet; if set to 1, this flag is on, meaning you don’t fragment this IP packet
more fragments flag: if set to 0, there are no more fragments; if set to 1, there are more fragments of this IP packet yet to arrive

Fragment offset
If an IP packet has been fragmented, each fragment will have a value in this 13-bit field indicating where this fragment’s data fits into the original IP packet. For example, let’s pretend an IP packet containing 128 bytes of data was fragmented into two fragments each containing 64 bytes of data. The fragment containing the first 64 bytes of data would have a fragment offset of 0 as its data belongs at the very beginning of the original IP packet. The fragment containing the last 64 bytes of data needs to indicate that its data starts after the first 64 bytes. Since the number in this field represents an 8-byte multiple, its fragment offset will be 8 (8 multiplied by 8 = 64 bytes).

Time to Live (often called TTL)
Whenever an IP packet passes through a router, the router will decrease the TTL by one; if the TTL ever reaches 0, the packet will be thrown away under the assumption that it must be undeliverable as it hasn’t been delivered by now. The original TTL value depends upon the operating system; your FreeBSD system uses a default TTL of 64. Since this is an 8-bit field, the maximum allowable TTL is 255 (2 to the power of 8 minus 1; the minus 1 is for the non-allowable TTL of 0).

Protocol
This 8-bit value specifies which protocol’s data is contained within the IP packet and gives a good indication of what type of information will be contained within the data portion of the packet. The protocol numbers that appear in this field are found in the “/etc/protocols” file on your FreeBSD system.

For example, the protocol number 1 represents the ICMP protocol. This means that this IP packet does not contain any data from an application; instead, it contains a small amount of ICMP data. We’ll be taking an in-depth look at ICMP and how it affects your firewall in a separate article.

A protocol number of 6 indicates the TCP protocol. You may remember from earlier articles that TCP is a connection-oriented transport. This IP packet will have an additional header known as a TCP header that will be located just after the IP header and before the beginning of the actual data that is being delivered.

A protocol number of 17 indicates the UDP protocol, which is the connectionless transport. This IP packet will have a UDP header located just after the IP header and before the beginning of the data that is being delivered.

Header Checksum
Whenever an IP header is created or modified, a CRC (cyclic redundancy check) is run on the bits contained within the IP header. Basically, some math (the CRC algorithm) is done which results in an answer known as the checksum. When the IP packet is received, the same CRC is repeated on the header; if this results in the same answer (checksum), all of the bits of the IP header must have arrived in the correct order. If the CRC results in a different checksum, some of the bits in the header didn’t arrive, meaning the IP packet was somehow damaged during transit.

Source Address
This will be the IP address of the host that sent the IP packet.

Destination Address
This will be the IP address of the host that is to receive the data contained within the IP packet.

Options and Padding
This is the only field in an IP packet which is optional, as all other fields are mandatory. This field is used to provide special delivery instructions not covered by the other fields in an IP header. It can allow for up to 40 bytes worth of extra instructions; these instructions must be in 32-bit words. If an instruction doesn’t quite fill up a 32-bit word, the missing bits will be filled in with “padding” bits.

Data
The last field in an IP packet is called the data field. This will be the actual data that is being sent from one host to another. The data field may start with a Layer 4 header, which will give additional instructions to the application that will be receiving the data; alternately, it may be an ICMP header and not contain any user data at all.

Posted in LinuxLeave a comment

Posts navigation

Older posts
Newer posts

The Master

Categories

  • Apache
  • Apple
  • Assembler
  • Audi
  • BigData
  • BMW
  • C
  • Elektroonika
  • Fun
  • Hadoop
  • help
  • Infotehnoloogia koolis
  • IOT
  • IT
  • IT eetilised
  • Java
  • Langevarjundus
  • Lapsed
  • lastekodu
  • Linux
  • M-401
  • Mac
  • Machine Learning
  • Matemaatika
  • Math
  • MSP430
  • Muusika
  • neo4j
  • openCL
  • Õpetaja identiteet ja tegevusvõimekus
  • oracle
  • PHP
  • PostgreSql
  • ProM
  • R
  • Turvalisus
  • Varia
  • Windows
Proudly powered by WordPress | Theme: micro, developed by DevriX.