Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

2007-12-17

Home <--> Work synchronization

What's a pity that major hosters do not offer free version control system. Google, sourceforge - that's all for programming projects.

I'd like to have some simple solution for the synchronization of small notes and todo lists at home and work computers.

I've come across OpenSVN project. The rules contain almost no restrictions on contents. It's slow, but it's quite enough for files <10к. Well, I hope that it will be no more bugs with backups ).

At the work computer with constant connect to Internet I've set up a scheduler, now I'm sure that I Can download everything at the home one, if needed.

2007-12-09

Ubuntu + Pocket PC + Bluetooth = ?

I've learnt a lot of uninteresting stuff.

Now I can not only copy files on PocketPC via Bluetooth under Ubuntu, but also connect to Internet.

No visual configurators, just google and emacs.

The secret was in the magic phone number *99#.

2007-11-28

20,000 Lines Under the Sea

I wanted to write a small script for installing/changing pictures for folders containing photos in Nautilus.

I dug into sources, dug out the required Corba interfaces, understood how bonobo and its python wrapper work.

Under old Ubuntu with Gnome 2.16.1 this script works, under the new one with Gnome 2.20 Bonobo.GeneralError with an empty message is thrown.
#!/usr/bin/env python
import bonobo
import Bonobo

bonobo.activate()
obj = bonobo.get_object ('OAFIID:Nautilus_Metafile_Factory', 'Nautilus/MetafileFactory')
print dir(obj)
I do not like it, but I have no choice - I have to edit ~/.nautilus/metadata

Update 03.12.2007 - The presentation slides Guadec2003 - PyOrbit

Update 17.12.2007 - I got evidence that this is a bug. I'm curious, for how long it will remain unnoticed

2007-11-22

Shoot and run story about installing Ubuntu Gusty on Dell 1520.

The two main problems:

Media direct button
1.00002 At this point I worried for nothing, rmbr.exe utility easily works from the console of Vista repair disk, so Windows can be teared down painless. For some reason I had not managed with the placement of media-direct loader at a logical disk, so I placed both grubs at primary partitions, did not install grub in mbr, started rmbr.exe 3 2 and everything works. It is left to think of the place where on boot under the 8th run level autologin will happen, and to choose the media combine - MythTV, Freevo or Elisa.



Sleep
More with Google than with my own brains I came to the magic row for /etc/defaults/acpi-support, ater it suspend and hibernate began to work middling well.


MODULES="uvcvideo bcm43xx ehci_hcd uhci_hcd"

And for nvidia drivers is required

POST_VIDEO=false
POST_VIDEO=false

Hibernate hangs up if mixer applet or ekiga are running, they do not let to upload snd_hda_intel(sound) and uvcvideо (web camera).


Update 23.11.2007: Here is the description of what I managed to do and what I did not

2007-11-13

Shattleworth strikes back

dscn3730 While Ballmer is trying to impose Windows to Nigerian schoolchildren by foul means, Ubuntu is slowly and steadily spreading in the whole world.

Returning home with a freshly bought Dell Inspion 1520 under my arm, I found in the mailbox a package with two Ubuntu discs. As they say - it's a destiny )

I wanted to spend some time under Vista, get used to baubles, but evidently now I will set up Linux, just at weekends. The keeping of two OSes is a kind of schizophrenia - something you do here, something - there, the constantly shortcuts confusing, and you bite your elbows when you have to reboot for the sake of something.

I'm planning the following:
From LiveCD to sort out the sound and a problem with the hard drive. If everything will be ok, Windows can be teared down.
Update 14.10.2007: I booted from LiveCD and installed irqbalance_0.55-2_amd64.deb and linux-backports-modules-2.6.22-14-generic_2.6.22-14.9_amd64.deb. Could invent nothing more sensible, uploaded all snd_ modules manually and executed modprobe snd_hda_intel. Now sound works.

To remove Recovery and Media Direct partitions, create tiny(5-10м) Media Direct partition at the end of disk. To install Grub there. To set up under Windows Media Direct button for the working with this partition. If everything will be ok, I'll move further.
Update 16.11.2007: I could not place MediaDirect part with grub on logical disk for some reason. But with /dev/sda4 it works.
dscn3747 The further I get the more discoveries I have. Three operating systems pre-installed by dell to the new computer - it's cool. Moreover, initially I thought that bios menu item Diagnostic starts diagnostic programm from the first hidden partition of the hard disk. Not by any means. If to arm with grub and boot from (hd0, 0) then DOS but very pretty testing programm is started. It's the 7th year of the twenty-first century, on my new computer the mouse is working under DOS again ).
And from BIOS tests with the text-mode interface are run. Maybe it is embedded in BIOS? Then maybe, the first hidden partition is not needed at all?

Instead of Vista I've installed Ubuntu with the second grub, and the first grub is set to start ubuntu with some 8 run level, which will boot the absolute minimum, just for mplayer starting ).

Yes, one more thing: after the instalattion I'll have to fix splash screen, but it seems to be very easy.

Link Dump: What is MediaDirect 3? Inside the Dell Utility Partition

Update 26.11.2007: And my little sister received Ubuntu disks just on her birthday. That's marketing ))

2007-09-06

Yet another text processor

When the matter is alternative to visual editors ala MS Word and Open Office only TeX and its derivatives are usually mentioned. At link ltu I met yet another interesting project - Lout document formatting system.

The whole range of formatting features in Lout is implemented on the base of 23 primitive operations and hem... an interesting concept Galley.

With this small basis even the concept of page(!) is possible to define. And the marking language itself can be used as an example of why lazy evaluation matters.

I liked one of basic units p - width available to an object mines the object width. I.e. 1p is a margin for right edge alignment and 0.5p is a margin for centering.

I wonder what language problems forced the author to switch to the creation of a new project...

Hem.. whether ideas implemented in Lout can be used for the creation of a new wiki dialect? At first sight tables formatting using // and @Onerow combinators is more pleasant than to edit sheet of <td> and <tr>.

2007-02-05

Linux: Fun stuff

# man factor

NAME

factor - factor numbers

DESCRIPTION

Print factors of each NUMBER; read standard input with no arguments.

2007-01-18

Freebsd on Qemu

I'm continuing the installing-unwrapping actions. So amazing... no problems again.

But in the beginning I was very afraid... to write under FreeBSD 5.5? By no means, guys! Crypto protection... linux... it's not grand.

Well, I've downloaded Qemu+KQemu installed, made iso image of the installation disk, or more exactly, since I have CD-ROM on Windows machine only, I made nrg first and then
dd if=nero_img.nrg of=iso_img.iso bs=1024 skip=300 

By means of qemu-img I've made an empty file image. Booted
qemu -L . -cdrom freebsd-5.5.iso  -hda freebsd.qcow -boot d -m 128

As a blind kitten I nuzzled up sysinstall. Bada-bing - and loaded the fresh-installed system
qemu -L . -hda freebsd.qcow -m 128 -localtime -redir tcp:8080:10.0.2.15:5000 -redir tcp:10022:10.0.2.15:22


As for the magic -redir option I had to google a little... that's all is because the most easy way of net raising is described here in the veeery bottom...

When googled, I've known about pkg_add, pkg_delete and installed bash, python and Emacs 21.
And the last:
export DISPLAY=10.0.2.2:0


What's a pity that there is no built 22nd Emacs for FreeBSD 5.5 ;(
So far I'm afraid of building.

2007-01-16

Cygwin sshd and windows domain users

Life is good!

Follow step by step the How to install OpenSHH sshd server om Windows XP

ssh-host-config
When the script asks you about "privilege separation", answer yes
When the script asks about "create local user sshd", answer yes
When the script asks you about "install sshd as a service", answer yes
When the script stops and asks you for "CYGWIN=" your answer is ntsec tty


Run

net start sshd


Nothing "you most likely have to manually edit /etc/group". Configure on bash with a little bit different parameters

mkpasswd -d > /etc/passwd
mkgroup -d -local > /etc/group


Check it — everything works!

2006-11-06

Ubuntu update again... boring

I've updated my all three Ubuntus — at home on the laptop, at work under coLinux and on a usual computer of my little sister. Everything took place almost without adventures.

It's good that it is almost impossible to drive Linux to the completely idle state. Without looking into what is what I tried to cross upstart and the old 2.6.11 coLinux kernel. Naturally, nothing has worked. Not a problem, I booted with init=/bin/bash parameter ant apt-geted sysvinit back.

Linuxant still has not shared builds of modem drivers for the new Ubuntu. I've downloaded a package with srcs. Something there is incompatible with the new kernel. hcfpciconfig --rcstart initializes nothing. I had to do everything at full scale of hcfpciconfig.

2006-09-18

A brief HOWTO live under Linux

For some reason my interaction with Linux recently follows the algorithm:

  1. Extremely need some missing functionality in a necessary program

  2. For a long time I whimper, but stand it

  3. At last I read manuals suppose what if this feature exists and if does not how this program can be integrated with others

  4. Google for an external program implementing the necessary piece

  5. Put all together and get what I wanted.



For example, http client elisp implementation can not work through proxy with authorization, all who use it can not do it accordingly. It is possible to write in Live Journal using Emacs, but to post it is not. I googled, found a variant... and for a long time hardly tried to understand the implementation details so that to create a correct config. The result is here.

I constantly wanted to have a possibility of copying the full path to a current selection in a file manager - in Far it is done with Ctrl-Shift-F combination. After that in any program execute File->Open and insert this file name. Voila. I do not know how to get the same functionality in Nautilus but for mc I've found a console utility for working with clipboard and created an additional item of the user menu:


~/.mc/menu 1 Copy current location to clipboard
echo -n %d/%p | xclip -selection clipboard


It turned out that X server supports whole three kinds of clipboards...

2006-09-03

And why in E-macs moving to the beginning of a line is done by C-a?

Because A is the first letter in the alphabet?

2006-07-05

coUbuntu from ISO

I forgot - on weekends I've raised Ubuntu Dapper on coLinux. Installed Midnight Comander, adjusted Apt through proxy. It's great!
The details:

Ho to raise Ubuntu on coLinix having on tap only installation CD/DVD of this distributive can be read in the article Howto Install Debian Sarge image from scratch.

True, in the installator I used only first two steps — mount CD and load installator components. To raise the base system there is a command — debootstrap.

About the net adjusting is written here.

Midnight Commander binaries, which wil work in coLinux console (packages from repository are buggy for some reason) are here.

As for APT through proxy, it was interesting, the first Google link sent me to... /usr/share/doc/apt/ for examples :)

I've created a file /etc/apt/apt.conf with about the following contents:
Acquire
{
// HTTP method configuration
http
{
Proxy "http://user:pass@proxy_ip:port";
Timeout "30";
};
};


It works.

2006-06-28

U-U-U-UbuntU

At last I've received DVD with Ubuntu Dapper, which I ordered at filepost.ru.

I updated without the Internet, to get the fastest result I had to remove some old packages from universe/multiverse.

Three days... so far everything is OK. Gdm now loads a little bit earlier but it seems that the whole systems loads faster. Gnome, video driver i810 and Eclipse are still cramped in 256M. Go on living on vesa.

Now I'm planning to run Ubuntu on Windows using coLinux, get familiar with apt work through proxy and using a small utility download required dependency packages.

2006-06-19

Python-inotify on Ubuntu

By hook or by crook I've stuck into my system the package python-inotify.

There is a library in Python for building rmp packages. What's a pity that it's not for deb.

I've come across a strange roughness, fixed it by explicitly setting the folder with h files.

file: setup.py

module1 = Extension(
'_inotify',
sources = ['inotifymodule.c'],
include_dirs = ['folder where source has been unpacked'])

python setup.py bdist_rpm
fakeroot alien python-inotify-0.1.0-1.i386.rpm


I have to see if it is possible to build python libraries in Scons.

2006-05-04

Linux: Ubuntu on coLinux

I've discovered in coLinux Wiki a way of the installation Ubuntu and Debian to pure coLinux. A couple of years ago I started from ready Debian image and ever since update it from time to time. It turned out, I could just take installation Cds and make a clean installation.

IMHO ready installator installing and setting everything — net, sound, X would be a best variant for a beginner in Linux. Guarantee support all hardware (well, since on Windows everything works), no troubles with disks formatting — just study the system, get accustom to soft. And then, in a beautiful moment — done in a wink - and you are on Linux with the minimum of unpleasant feelings.

Actually, two years ago I did exactly so :)

2006-03-22

Linux: Apt friend


UPDATE For now the tool placed here is not fully compatible with Ubuntu Edgy. Nevertheless 3,4 person a month downloads it. I have fixed it long time ago and successfully continue using it, but I'm just lazy to share the new version. If you really need it please leave a comment or mail me kmmbvnr _at_ inbox.ru.


Gosh, I've carried to an acceptable level a script so that I'm not ashamed to share it.

I've brought the freebie Ubuntu spreading upon myself and the problem arise:

Some day my friend visited me and said: «Oh, you are watching video with such a funny player, share it with me!»

Yes, indeed, in theory nothing prevents me from the copying a deb file to a flash drive, but there is one trouble with the dependencies. The banal mplayer pulls a lot of stuff. Well, it is possible to rummage in deb file and get whatever it needs but it is very ungraceful.

Yes, if there is fast Internet on a computer and the required repositories are registered the trouble is fall away though it leaves a bad taste - one more downloading is not nice.

So, the problem is: There is a computer A with Ubuntu on board to which we desire to install some packages. There is a computer B where these packages are already installed or the Internet is faster/cheaper/freebie. The connection between the two computers is established in the very democratic way — by Winchester or flash drive. It is required to gather packages and missing dependencies in one folder.

Existing solutions for now:

1) apt-get --print-uris
1a) debget
2) a little bit magic with status file
3) my variant is apt-dist


1) The easiest and flexiblest way of getting all required packages is to emulate their installation at the initial computer, to see what is required and after that just download it on the computer 2. For this purpose computer 1 should have good or bad access to the Internet.

Set up sources.list at the computer 1, connect to the Internet and execute apt-get update. By this command we get packages list located in remote repositories. Now we can use synaptic, aptitude or even dselect for searching names of packages with the required functionality. Instead of the installation packages by means of these programs execute the command apt-get -qq --print-uris install package_name_1 package_name_2 and so on. --print-uris option forces apt-get just print packages location urls instead of the downloading and installation. And --qq option turns off the redundant screen output. Copy these urls to a file and go to the computer 2.

At the computer 2 we can download packages from the just received file by executing the following commands:

cat our_file | awk 'print "wget -O " $2 " " $1}' > wget-script
sh -x ./wget-script

By the first command we create script file that contains sequence of calls of the console downloader wget for the each package downloading. By the second command we run this script for the execution.

The main disadvantage of the first variant is that the packages regardless of their presence in the local repository will be downloaded over again. If in a net/at a local computer there is a proxy cashing deb packages (apt-cacher or apt-proxy) it is possible to force wget to download through it (by some additional tricks with url) but there is more easy way:

1a) The package debian-goodies among other things offers debget command, which download deb file by using the local base of apt-get. Packages downloading from local mirrors can be easily realized by means of it.

The disadvantages of debget are impossibility to set the required package version, need root rights and errors that appear while trying to download deb from cdrom. The key to these problems solution is described in the 2nd variant.

2) From the computer 1 take file /var/lib/dpkg/status containing information about the installed packages. This file is the only thing we need to create a configuration on the machine 2, which is indistinguishable from the computer 1 for apt. The creation of the own configuration makes needless writing rights to /var/cache/apt, hence we do not need root rights.

First of all in some folder, e. g. /tmp/dist create the following folder structure:

/tmp/dist/
archives/
partial/
lists/
partial/
status
sources.list
apt.conf

where status file is just that file from the computer 1, sources.list file should contain the list of repositories from where you'd like to take packages (you can just copy /etc/apt/sources.list).

And apt.conf file should have the following contents:

APT {
Architecture "i386"; //Use here computer 1 architecture name ( most likely, it is i386 or x64)
Get::Download-Only "true" //We'll only download packages on computer 2
};
Dir {
//The locations of file with the information about the installed packages
State "/tmp/dist";
State::status "status";

//Folder for deb files storying
Cache::archives "/tmp/dist/archives";
Cache "/tmp/dist"

//sources.list location
Etc "/tmp/dist"
}

Do not forget to change /tmp/dist to the path to a folder with your configuration. Experience has shown that in apt.conf it is possible to use relative paths everywhere except Cache::archives parameter.

Execute:

export APT_CONFIG="/tmp/dist/apt.conf"
apt-get update
apt-get install package_name

Since in apt.conf file the option APT::Get::Download-Only is set to true the installation will not occur, but the needed packages will be downloaded. But packages will be downloaded not from the local repositories since apt does not download anything from local repositories at all but immediately use the packages from the given location. Cd-roms and snapshots on hard drives are out in the cold again.

It's just the right time to remember that apt is responsible only for downloading packages of needed version and command dpkg unpacks and configures the packages in the debian-based distributions.Apt-get addresses exactly to it when installing a package. Immediately the action plan has become clearer — disable option APT:: Get:: Download-Only, then apt will make an attempt to install packages, but if instead of the original dpkg substitute script wrapping around the command cp (copy) the packages will not be installed but just copied in the right place. Actually, it is the core of the 3d method.

3) The common disadvantage of all the methods mentioned above is the necessity of any preliminary actions on the computer 1. Although the need of passing packages happens rather by accident. About computer 1 is usually known just what kind of distributive is installed on it, and that its owner has an official CD release of this distribution. In principle, this information is quite enough to form and copy to a flash drive all the missing packages and their dependencies. But if a couple or triple of them are already installed in the computer, it's nothing. The first step is to create status file of pseudo machine on which would be installed all packages from official cd / dvd. Since cd / dvd could potentially contain packages conflicting between each other, we will not record information about possible conflicts to the status file then apt will believe that everything is fine. And when you try to complete installation only packages missing on the official Cds will be downloaded and installed only.

In general, all these routine steps, I realized once and for all in a small script. For whom is interested in the details - I recommend to look at the source (28Kb) I do not tell how to use this script for purpose, because ANY script gotten from strange places (some blog on the side, freebie hosting) you have to CHECK WITH EYES. Anything may happen.

I like the result. No pre-shamanistic dances on a softless computer, the computer may not be connected to Internet at all, and purely theoretically it could be any debian-based system.

Root rights are not necessary on donor computer.

P.S. NO WARRANTY
P.P.S Big thanks to Jason Gunthorpe <jgg@debian.org> author of the APT Offline HOWTO.

2005-11-14

Linux on the Notebook

I helped to a friend to configure fresh-installed Ubuntu Linux. It was long. I haven't seen such problem before. X server starts, no errors in log, but the screen stays blank.

It turned out that is the standard problem for ATI Radeon drivers. Before starting it is necessary to load chipset specific AGP module.

In our case it was intel-mch-agp.

2005-11-12

Linux: MIDI Setup

There is my translated forum message. Of corse it can be extended and improved, but in order just to not forget, i will leave it as is.

For happy owners of sound cards without midi support, there is only one way to get listen midi sound is to install timidity, the software midi emulator.

I want to write about my timidity setup expirience.
$> apt-get install timidity
$> sudo /etc/init.d/timidity start

I saw error, OK, I went to /etc/timidity, and saw that it contains only one line that includes missing file.

I don't remember its name, but just looking on it, helps me to understand that something called freepars is missing. I open synaptic and found that package with exactly same name are exists.
Cool!

Later i saw that even timidity package recomends freeparst to install.

$>apt-get install freepats

One more time:
$> sudo /etc/init.d/timidity start

And one more error.

Once, i don't remember details, but it was realy easy to understood that we need to load some kernel module responsible for midi. But i have to brutforce the what exactly midi module i need to load.

And than, in order to make this module load automatically on start, i wrote it in /etc/modules,

Thats all.

2005-08-04

Linux on the server

Installer, with kernel 2.4 cannot found the CD-ROM. Kernel 2.6 when ACPI is turned on, hangs up in the begining of load. Manufacturer provides drivers for hardware RAID only for Red Hat and Suse with kernels 2.4.11-*. It's horrible.

I was faced with an interesting thing. Although, server have 1Gigs of RAM, kernel writes - "Warning only 896MB will be used".

Problem can be easily solved by recompiling kernel with support for more than 4 Gigs RAM. But it's still interresting - why it not works by default?

Host bridge: Intel Corp. Server Memory Controller Hub (rev 05)
VGA compatible controller: Intel Corp. Graphics Controller (rev 05)
PCI bridge: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03)
USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)
USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)
USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)
USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)
PCI bridge: Intel Corp. 82801 PCI Bridge (rev d3)
ISA bridge: Intel Corp. 82801FB/FR (ICH6/ICH6R) LPC Interface Bridge (rev 03)
IDE interface: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 03)
IDE interface: Intel Corp. 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03)
SMBus: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 03)
Ethernet controller: Intel Corp. 82541GI/PI Gigabit Ethernet Controller (rev 05)
PCI bridge: Intel Corp. PCI Bridge Hub A (rev 09)
PCI bridge: Intel Corp. PCI Bridge Hub B (rev 09)