Monday, 11 February 2008

За колегите: Упражнявайте базите данни!

Здравейте, на нашата "голяма" Група!

В чекмеджето на нашата обща пощенска кутия (softuerni_07@вие.знаете.къде) днес сложих едно архивче. Целта му е да улесни всички при упражненията по бази данни.
Работата е там, че ни преподават основите на езика SQL чрез MS-SQL сървър. Само инсталацията на това чудовище е около едно CD, да не говорим колко пространство ще заеме на твърдия диск. Е, нужно ли е да използваш балистична ракета за да убиеш комар? (Аналогията не е много добра, защото всъщност езика SQL е по-голямото и значимо нещо отколкото иснтрумента, в който се използва. Но това е друга тема.) Тогава как да си помогнем за упражненията? Как да започнем с изучаването на един от най-лесните, приятни и мощни езици? Тук ще дам три връзки, които предоставят само едно първоначално насочване:
  1. SQLite - проектът. Сайтът на една наистина оригинална и все по-популярна идея.
  2. SQLite в Wikipedia - нещата обяснени малко по-подробно.
  3. SQL в W3Schools - едно много достъпно входно ниво за езика, с реална възможност за изпробване на наученото онлайн.

Що се отнася до файловете в архива:
  1. sqlite3.exe - тази самостоятелна програмка е напълно достатъчна за да си направите и редактирате база данни от командната линия (DOS Prompt). Ако все пак не обичате черния екран с мигащата чертичка, можете да използвате другата програмка
  2. SQLiteSpy.exe - това е графичната обвивка на горната програма - един малък, но достатъчно добър редактор, в който бързо се създават обектите на базата данни и се пишат заявките. Да, така е - всичко става много по-лесно, когато е визуално ориентирано.
  3. SQLiteSpy.db3 и World.db3 - съотвтно пък са две примерни бази от данни. Да, тук базата данни е един единствен файл в *.db3 формат (от 3-та версия на SQLite).

По-простичко трудно би могло да бъде, особено като се има предвид, че SQLite покрива минимум CRUD принципа (какво представлява той можете да разберете отново от Wikipedia) заложен в SQL стандарта. Накратко казано този принцип е свързан с базовите операции, които използваме при работата си с обектите на базата данни:
  • Create - това са операциите свързани със създаване на обекти и записи от данни (CREATE, INSERT).
  • Read или Retrieve се отнася до операциите за извличане на данни (SELECT, JOIN, UNION).
  • Update е свързан с операциите за обновяване на съществуващите данни в базата (ALTER, UPDATE).
  • Delete има отношение към изтриването на обекти и данни (DROP, DELETE).
Тук не е включена само функционалността за възстановяване и конкурентен достъп до данните (чрез COMMIT / ROLLBACK блокове), но това са по-скоро допълнителни екстри на сървърите и се отнасят за групово изпълнение на останалите опреции по извличане и модификации на данни и обекти.
Надявам се, че SQLite ще ви е от полза при изучаването на базите от данни.

Friday, 1 February 2008

Lets speak some more Linux: Ubuntu-server

This post should be called: Ubuntu 7.10 Server edition or the struggle of a newbie with the console.

So the main question is - how to make things happen?

If you have less than moderate experience with the terminal it might be quite a test. And I would almost make a mistake - at first I panicked and took a wrong path but first things first...


Installing the server edition of the fine Ubuntu system is not much different from the variant with the alternate cd. You have this text mode installer, which asks you almost the same things. Almost. Lets point some situations:

* In the first place I shouldn't let it configure the network through the DHCP. Not a problem - fixable situation but cost me time to figure it out for I'm almost completely unfamiliar with the networking and stuff (ashamed).

* In the second place - the big advantage of the server edition is that it asks you to choose from and installs for you
  • DNS server - lets you provide and use the DNS (Domain Name System) service.
  • LAMP server - tool-chain for web developers, including Apache Web server, MySQL database server and PHP/Perl/Python programming languages, all these tuned for Linux.
  • Mail Server - managing electronic mail is always useful.
  • OpenSSH server - the free distribution of the server, which manages secure shell connections.
  • PostgreSQL Server - powerful and robust object-relational database server.
  • Print Server - manages the printers in the office and the jobs assigned to them.
  • Samba file server - this one lets you have a seamless local network and file-sharing system along with Windows machines.
with just one after you've made your mind.
CAUTION! - at this version (7.10 - the Gutsy Gibbon) just skip the mail server. Installing it cost me reinstalling the system - after rebooting the new system, you end up sudo-less, which in Ubuntu means you have no eyes, you have no ears and you definitely have no fingers. This is a situation where you basically have only around two toes on the left foot. That's all. And if you can manage the whole system this way you must be quite a guru.

* I wont address here the issue of partitioning the hard drives (especially when speaking for software RAID), because it is an enormous and quite different subject (in my case the partitioning was already done and I just formatted the available partitions).

* If you're connected to Internet the ATP will want to configure itself. This process may substantially slow down at 40%, 60% or 80% or just take forever. I had once the last case - on the next morning I should start the installation again. Somewhere in the Ubuntu forums someone said it happens sometimes. An easy work-around is if you just unplug the PC from the network, so you'll just let the APT will configure itself later.

After installing the specialized servers (remember! NO Mail Server in Gutsy!) it is almost done. If there are no glitches and delays the whole installation may take around twenty minutes. Cool! :)

There. After the reboot you're already there - at your shiny terminal. Don't forget that in Ubuntu you have up to seven virtual terminals (accessible by pressing Ctrl-Alt + F1 to F7).
So what's first?
For a moment I didn't know what to do. But there are things that must be done: check your network for example

Getting to know the console of your distro is like slowly and inevitably falling in love. Its like raising a child (not that I have one but you know what I mean).

....
And the lost path of thoughts made this post unproperly finished. But as long as this whole blog is some sort of a draft I publish it in such state. If questioned, answeres will be sought and eventually provided.

Честит Рожден Ден!

Днес моят много-уважаван колега, Тошко достигна Христовата възраст! Айде, живот и здраве и като утроиш тези две тройки да се радваш на много правнуци ;)

И купонът си е купон, но работата си е работа и за това трябва да се захващам със следващия пост...

Много здраве и голяма веселба!

Thursday, 24 January 2008

In Memorium: Heath Ledger

Една звезда угасна преди да достигнала най-големия си блясък!
Heath Ledger почина. Това как е станало не е от толкова голямо значение, колкото факта, че няма повече да ни радва с таланта си от екрана. Защото той беше наистина един много обещаващ актьор. Това личеше дори и в забавните му роли от "10 неща, които мразя в теб" и "Като рицарите". Дори противоречивия Холивуд забеляза наистина сериозното му превъплъщение за "Планианта Броукбек".
Аз да си призная съм голям BATMAN почитател и страшно се зарадвах, когато разбрах, кой ще играе ролята на Джокера в "The Dark Night" (отново на интересния Кристофър Нолан), бях много силно заинтригуван - определено очаквам вълнуващо изпълнение.
Това за съжаление е последния филм нa Heath.
А още нямаше 30.
Почивай в мир Heath и дано поне Господ се радва на играта ти там горе!

Tuesday, 22 January 2008

Lets speak some Linux: How to make an alias of a command

The first thing to mention is that almost all of my Linux experience comes from the realm of Ubuntu. This is very nice system. It appeared little strange to me the first time, because my first Linux was SuSE 9.3 ... but I'm gettin' off the topic (it's gonna be chaos I told you). About distributions I'll talk later.

So. Ubuntu. No root password, still nifty super-user access.
Now the aliases. Simply put the alias is just a Linux command. It is a way to define a replacement for other Linux command. Generally one uses it to ease their lives by replacing a more complex command (with usually a big set of parameters) with a much shorter representation.

If you google for the 'alias linux' a lots of nice and detailed resources will come up.
Nevertheless in a nutshell my comprehension of the subject - there are two basic ways for defining an alias:

* In a file. When logged in Ubuntu as a regular user in your environment (e.g. your user's home directory) there is a hidden file called .bashrc. This is a configuration file for your bash shell, so everything defined here applies to the terminal window you use with your account (if you sudo
for example, the scope will change, and different configuration is applied). If you scroll down the file to line around 60-70 you will stumble upon lines which define some quick aliases. These are just simple examples but you can get the point. The syntax is:
$ alias alias_name='regular_linux_commad -with -options'
or just
$ alias ecl='/home/user/eclipse/eclipse'
if I want to run my eclipse IDE from the command line the fast way.

* On the console or inline. That's the quicker way - you just issue the command and the shell remembers it. Quicker but dirtier because the shell remembers your alias only for the current session. So if you want your alias to last for good (or at least for the lifetime of your Linux distribution or /home partition) after being defined only once, you'd better use the first way.
A thing about the above example - in aliases where you specify a path on a partition might appear traitorous, especially if you write relative paths in your alias - they become dependent on where you are at the moment. So if you ever use path in an alias, just make it absolute. Avoid the relative ones.
To summarize - the alias command defines aliases to complex commands and it's purpose is to simplify your experience with the shell. Put in other way the alias might be thought of as one-line shell script. That's a funny approach :D

That's for now. See you ;)

Thursday, 17 January 2008

Честит Рожден Ден!

Днес баща ми има рожден ден (61). Честито, тате! Да си ми жив и много здрав още по две!

Може би тук е момента да ти кажа, колко много те обичам и че осъзнавам какво ти е било през последните шантави години. Всички преминахме през трудни периоди, но малко неща могат да се сравнят с това света ти внезапно да се преобърне с главата надолу.

За сега толкова. Темата ще е с продължение...
Here we are! or Здавейте! (A word in my native language)

What is Internet if not a Reign of Structured Chaos.
Likewise this my blog will tend to be an initial spot, a starting point for massive display of topic shifting. Not only that but in time (if I'm safe and sound) it'll become a multilingual (for now just bilingual) one.
So what's the story? A blog is supposed to be a place where you can write anything and everything, and where you can save an escaping thought. For good! So I will. I intend to. Let's see what happens. Re-check after one year. Would it really be a genuine hotchpotch of topics? Would it have a substantial feedback if ever any?
Time will show.

И сега малко завръщане към родния език.
Не знам какво точно ще се получи от този дневник с времето и дали въобще, ще го поддържам, но ако даде Господ, тук ще има споделени мисли по много различни теми, като започнем от компютрите, като преминем през киното и стигнем до човешките взаимоотношения. Предвид, че това не са теми, а цели Вселени и факта, че не само темите, а и патоса ще варира
много - от сериозен и делови, до крайно шеговит, значи наистина се очертава един съвсем нормален, човешки миш-маш от мисли.

Хайде сполай ти и сполука johnniepop и дъъълги години да го списваш ;p

А на вас, които четете, дано намерите нещо и за себе си.
And to all of you who read this stuff, I hope you'll find something for your own.

Good luck!