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

Friday, 13 September 2013

Apt-Cache Server and Ubuntu

I have to admit, that I don't know how I lasted this long without an apt-cache server. Everytime I would update the systems I have on one of the locations I would download updates on each of the machines, because I was too impatient to wait for one of them to finish to go to the next one I ran them all simultaneously and of course that made it even worse ;) So now I finally set up the apt-cache server. Setting it up according to the Ubuntu help web page worked quite well, with one minor exception - Import of existing packages with the following command:
sudo /usr/share/apt-cacher/apt-cacher-import.pl -l /var/cache/apt/archives
That created the links in the apt-cacher directory, but afterwards would issue errors in the logs when trying to change the files there and the clients access was denied and they downloaded the files anew from the net.
So just skip that one (I did not try to import the whole CD/DVD image, don't know what that one does, but it might work better since it would copy files and not link them on disk).

So now, first time apt-get update or upgrade command fetches/refreshes the cache, the next machine that does the query gets files cached and downloads everything from the LAN with full speed ;)

For instructions just follow the above link, and you should be fine.

So happy apt-ing ;)

Sunday, 11 March 2012

Compiling custom module from external patch in Ubuntu 11.10 (asm58 sensors patch)


The result of the following commands is that you gain a copy of the default ubuntu kernel packages, with just your patch added (one module and one help file).

  • Install the required packages (linux sources and required programs/files to build the new kernel package).
  • Install the dependencies required for building the kernel
$ apt-get build-dep linux kernel-wedge fakeroot makedumpfile
  • Install the kernel source code
$ apt-get install linux-source
  • Extract the current ubuntu kernel source (into an allready prepared directories - by linux-source package)
$ cd /usr/src/
$ tar -xjf linux-source-x.y.z.tar.bz2
$ cd linux-source-x.y.z
$ wget http://n.neonatus.net/files/asm58-linux-3.0.0.patch
$ patch -p1 <asm58-linux-3.0.0.patch
  • My builds always failed with the error of not being able to touch a certain file so for that reason I create a directory beforehand so that the build goes through without an error
$ mkdir debian/stamps
  • Prepare to build the source
$ fakeroot debian/rules clean
  • Build the kernel packages
$  AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-generic-pae
You could also use binary - to build binary packages for all flavours - or select your flavour according to your hardware - they are listed in the debian.master/config/$ARCH/ directory.
  • If you are lucky enough to have multiple cores or processors utilize them during build add "DEB_BUILD_OPTIONS=parallel=2" variable in front of the command where 2 is the number of cores/processors you have available to the OS like this:
$ DEB_BUILD_OPTIONS=parallel=2 AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-generic-pae
During the build the kernel configure script will ask you to define the following:
 Asus Mozart-2 (SENSORS_ASM58) [N/m/y/?] (NEW)
Enter the letter m and press enter, which signifies to build the object as module so you can load/unload it at need. 

Now we wait... and wait... (hope you have a fast computer, or you'll) wait some more...
When the compiling finishes you will be left with a couple of new *.deb packages in your /usr/src directory, which you can install with dpkg command.
$ dpkg -i ../linux-headers-3.0.0-16-generic-pae_3.0.0-16.29_i386.deb
$ dpkg -i ../linux-image-3.0.0-16-generic-pae_3.0.0-16.29_i386.deb
Reboot and (if not allready selected) select the new kernel in the grub boot menu.
Log into the newly booted system and verify if all is fine by loading the asm58 module:

$ modprobe asm58
and verify that it is loaded ok:
$ lsmod |grep asm58
asm58                  13122  0
Now you can use the functionality of the newly compiled module by configuring lm-sensors - run sensors-detect and afterwards verify that the command sensors returns values from the sensor.


Good luck, and write a comment if you need help ;)

#Links:

Sunday, 11 December 2011

ASM58 (Asus Mozart-2) Linux 3.0 kernel patch

Hi everyone, long time since last post...

Well I have been doing some autumn cleaning and discovered my home server did not have sensors installed. Upon discovering it has a barely supported chipset, that does get detected by the sensors-detect script, but there is actually no driver included.


The sensor is found on the following Asus mainboards:
  • P4B533-VM
  • P4S333 (in conjunction with another asus chip?)
  • P4S333-VM
  • Terminator P4
I have googled a bit and (All raise hands and give praise to the GNU) discovered that somenoe - namely Michael Loßin has once upon a time written the driver code for linux kernel 2.6.x tree. And he deserves the gratitude for the work he put in. I have only modified his code, so that it compiles cleanely and works on the Linux kernel 3.0 tree.

The patch is available here.

Works like a charm with lm_sensors - here is the output:

asm58-i2c-0-77
Adapter: SiS96x SMBus adapter at 0xe600
in0: +1.79 V
in1: +3.41 V
in2: +3.02 V
in3: +3.12 V
fan1: 2393 RPM
fan2: 1125 RPM
temp1: +42.0°C
temp2: +56.0°C


Please post a comment if you find it usefull

Monday, 21 February 2011

Heey greetings from MaStory on my Nokia N900

I discovered a blogger client for maemo, which enables me to add news to my blog and also takes care of adding the media.

I loooove it!
(This is what it looks like editing the entr on the phone)

Sunday, 20 February 2011

Perl script to convert n900 pwsafe export into KeePassX XML

I wanted to have an option of exporting data from pwsafe on my Nokia n900, so I wrote this script. All you have to do is export the file on N900. Transfer it as securely as possible to your computer and run the script

./pwsafe2keepassx_n900.pl < PWsafe_n900_txt_output_file > out_keepassx.xml


The script can be downloaded here.

Drop me a comment if you like it or if you have any comment of how to improve it further.

Tuesday, 18 November 2008

Ubuntu, VirtualBox and suspend

Hey, I know, long time no write, well, long time no time left...

and allways running around requires me to suspend my laptop a lot, mainly when suspending it with VirtualBox running. Well after resuming the suspend VirtualBox froze most of the times. Killing the program and restarting it did not work, removing the module was impossible, so the only fix was the reboot. Well until smarter thought came ofcourse.

Create an pm script (in Ubuntu go to /etc/pm/sleep.d/) create a newfile named 90virtualbox with the following contents:


#!/bin/sh

USR_RNNG=$(ps aux |grep VirtualBox |grep -v grep |cut -f1 -d' ')
if [ "x$USR_RNNG" != "x" ]; then
if [ $(id -u) -eq 0 ]; then
su $USR_RNNG -c $0
else
for VMS in $(VBoxManage list runningvms |egrep "^[0-9]"); do
VBoxManage controlvm $VMS savestate
done
fi
fi
exit 0

Dont forget to make the script executable (chmod +x 90virtualbox).

Well that works for me, now before doing ACPI suspend the virtualbox machines are suspended nicely and afterwards you have to start them again, but they are up in a heartbeat (well 5 seconds in my case).

You can do that either by running VirtualBox gui and starting them or running:
VBoxManage start UUID|name_of_virtual_machine

Happy virtualizing...

Wednesday, 2 April 2008

Iliad - The E-book reader

The "heads" here at my workplace have purchased a couple of E-book readers - iRex Iliad models for possible integration into a big launch of a electronic newspaper release (which did not quite make it onto the drawing board) which leaves me with one of the gadgets in my greedy little hands. The preciousss... Oh and did I mention it runs GNU/Linux? This is where the fun begins...

The wiki.mobileread.com page has a list of programs of different sorts available for the Illiad reader and the instructions on installing them. You can install additional or improved reader software, or even ssh package that enables you to work remotely with the full shell on the Linux computer.
You can even play mp3's on it while reading your favourite book.

The Illiad is actually quite good with displaying pages from PDF or (properly formated) HTML pages, and with the help of the additional FBReader you can also read plucker, CHM and a bunch of other e-literature types.

Hey and there is also an option of installing a web browser. You can choose between Dillo (minimalist browser) and Minimo (mozilla for memory/screen challenged devices) allthough they might be usable as a last resort with speed being the biggest problem on Illiad.

The computer supports WiFi, LAN connection and USB, it can load media an programs from CF, MMC or USB slots.

You do have to install an additional peace of software to make all of the above work - the "developer shell" which invaluates your software guarantee, so be carefull about it.

It can also download and upload files to/from a network SMB share either via WiFi or LAN, and you can also make it connect and sync at predefined intervals if you want your daily newspapers/comics etc. on it every morning.

Overall it is an interesting toy, but it lacks in certain areas:
  • speed (horrible, horrible, slow..., reading is ok if you dont mind waiting between the pages to switch and resizing of fonts also takes a while)
  • no back light (not by default not by option), which means you have to read it like a book (under some kind of light source)
  • the memory is a bit on the small size, but if you don't actually keep all the books on it, but exchange them via keys, CF, mmc you actually get some good mileage
  • sometimes the pen is off (yes I know there is calibration in the settings page, but none the less on some pdf pages it is _allways_ 5-7 mm to the right of the point where you touch the screen)
Other than that I am quite impressed with the thingy (especially after discovering the possibility to install additional reading software - after writing an half witted CHM automated parsing and HTML conversion service).

So all in all a toy for geeks, but not really useful for general public I'd say.

Thursday, 10 January 2008

ATI Radeon X1270 and Fedora 8

The continuation of the saga that is one of my previous blog entries. I have been using "the other" OS for a while now, and have not noticed that my Linux did not use the correct resolution until I tried to view some pictures on it and they were odd shaped to say the least ;)
So I checked and surely the screen resolution was set to 1280x1024 and would not budge to anything higher (even if manually inserted as Modes line into the xorg.conf). After googling for a while I stumbled upon this and this site.

Sadly the radeonhd driver can not offer 2D and 3D acceleration yet, but I am not that much into games so I don't mind right now... If I need 3D I can still switch to fglrx driver (on 1280x1024 max).
Vieos work quite ok on xshm driver for xine and work ok in Kaffeine (mplayer does not perform ok - neither video nor alsa seems to be ok with it).

glxgears runs on about 600 in windowed mode and drops to about 90 in full screen mode.

If you had better results with the specified card please don't hesitate to leave me a note...

Saturday, 15 December 2007

Fedora 8 on HP Compaq 6715b laptop

First run:
  • check media (check ok)
  • continue (anaconda crash...)
reboot...
  • check media (skip)
  • continue (no X install method - X detection failed)
  • ... let disk druid do the partitioning (remove linux only partitions and create new ones - we'll see how Vista likes that one)...
  • install Grub on /dev/sda6 (MBR is reserved for vista because it behaved badly on previous installs)
reboot... (boot into Vista to see if all is ok with it... checked out ok, used neosmart easybcd to change the boot loader)
another reboot... booting to Fedora 8
  • Booted into text mode, system-config-display croaked...
  • off to the drawing board...
  • somehow eth0 failed to establish connection via dhcp... ran dhcpclient manually
  • installed livna repo (http://www.mjmwired.net/resources/mjm-fedora-f8.html#yum)
  • installed amarok, mplayer, xine (the goodies we need to have a distro multimedia capable)
  • installed ATI proprietary drivers from livna kmod-fglrx and
  • ran yum update to get current (~450MB worth of upgrades... on 100mbit link + package upgrade time = ~1h)
reboot
  • (forgot to change the runlevel so had to do init 5 first) but other than that PERFECT Xorg picture! yaaay!
  • fglx_glxgears measures around 200 in window mode and ~60 in fullscreen mode 1680x1050
  • tried to install some packages via pirut (system-config-packages) and got _REALLY_ slow download speed and unresponsive pirut windows at time.
  • ATI driver seems to be having some problems at times (creates shadows on parts of display that dissapear only after exiting X server session).
The conclusion:
After twiddling around a bit and setting up software and the hardware
the conclusion is that f8 is currently not really ready for everyone (for instance my wifi card did not work correctly, networkmanager did not discover any wifi networks and even manual configuration failed - keeps asking for password. I could not install ndiswrapper from an rpm package because there was no kmod for the updated kernel I am running... so unusable for me -
untill I find enough time to get all the bits and pieces running that is ;)

PS: suspend to disk works perfectly now as it seems (only tested a couple of times) (suspend to RAM fails to awake again

UPDATE (27.12.2007): after running yum update today all the above mentioned defects were fixed. WiFi now works perfectly - without ndiswrapper even and the later can be installed since there is a kernel update available now... So thumbs up for Fedora 8! I'm off fiddling with it now ;)