Saturday, September 26, 2009

dia : A program for drawing structured diagrams

Word processor and spreadsheet applications can be used to draw a diagram; flow-chart or whatever diagrams. But we will find dificulties when doing in it because the applications are not designed for this job.

Ubuntu, the most growing GNU/Linux distribution, provide an application named Editor Diagram (dia) as dia-gnome package. The -gnome sufix show this application is developed by GNOME team and to do in GNOME desktop environment.

Just install dia use apt-get command line or Synaptic, or "Add/Remove..."





After installation completed, the application can be found in Applications -> Graphics -> Editor Diagram Dia.

There are more than 30 diagrams every simbols are provided already; flow-chart, jigsaw, logic, ladder, electrics, electronics, Gane and Sarson (DFD) and so on.

dia's working file is saved with .dia suffix and it can be exported to many file formats; DXF, PNG, JPG dan SVG and so on.



Screenshoot


Using Ubuntu Jaunty Jackalope - language-pack-id


Wednesday, May 6, 2009

Problem after update Ubuntu 8.04 Server software

I just update Ubuntu 8.04 Server software by command:

$ sudo apt-get update && sudo apt-get upgrade

The process it self is ok, but my apache web server can not run.

$ sudo /etc/init.d/apache2 restart

Say error in /etc/apache2/sites-enabled/000-default.save

I remove the file then apache work fine again :)

Root without password in Ubuntu

Since I use Hardy Heron, I found that we can get root console / command
prompt without a password.

I do not know, why Ubuntu team do this. But it was help me when I must
enter the admin functions but I do not know the admin user name and
password.

How to get in it?

When system is booting and prompt a GRUB menu, I press ESC key. Then I
select "Recovery mode". After the system show a selection action box, I
select "root". Than I get a sign: #

Sunday, February 8, 2009

Deleting Old Files In Linux

When my scheduled database backup run, I have many old files we do not neet them anymore. So, I have a question for my self: How to remove them automatically just after backup is done?

So, I try to read 'find' command manual. The command is "man find" (without double quotes) if you do not know :) then I found these option:

-atime n
File was last accessed n*24 hours ago. When find figures out
how many 24-hour periods ago the file was last accessed, any
fractional part is ignored, so to match -atime +1, a file has to
have been accessed at least two days ago.


-ctime n
File’s status was last changed n*24 hours ago. See the comments
for -atime to understand how rounding affects the interpretation
of file status change times.

-name pattern
Base of file name (the path with the leading directories
removed) matches shell pattern pattern. The metacharacters
(‘*’, ‘?’, and ‘[]’) match a ‘.’ at the start of the base name
(this is a change in findutils-4.2.2; see section STANDARDS CON‐
FORMANCE below). To ignore a directory and the files under it,
use -prune; see an example in the description of -path. Braces
are not recognised as being special, despite the fact that some
shells including Bash imbue braces with a special meaning in
shell patterns. The filename matching is performed with the use
of the fnmatch(3) library function. Don’t forget to enclose
the pattern in quotes in order to protect it from expansion by
the shell.

-delete
Delete files; true if removal succeeded. If the removal failed,
an error message is issued. If -delete fails, find’s exit sta‐
tus will be nonzero (when it eventually exits). Use of -delete
automatically turns on the -depth option.


So, with options combination I get a command:
$ find . -name 'backup_*.db' -ctime +30 -delete

That is! I put the command in my backup script than run by cron every weeks and my old files will be deleted just after backup is done.