Showing posts with label wheezy. Show all posts
Showing posts with label wheezy. Show all posts

20 August 2012

222. Fighting and, eventually, installing HP laserjet P1102w on debian.

This printer is great when it works. It's just always a pain to set up, and it seems to be down to the way the install scripts are written. Setting up the printer was easy in the end -- but getting there? Not so much. Obviously, part of the reason is my own stupidity. Summary: it works on linux, but you'll need a bit of time and patience.

Update: here's an interesting post on the same topic: http://downfromthetrees.com/linux-installing-a-proprietrary-hp-printer-driver.html The only thing I would add is that instead of using sudo as described in that post you may have to use gksu in order to avoid the Magic Cookie error.

The short guide:
You NEED a binary plugin. It blows, but you do. Blowing harder: there's a lot of references to letting hp-setup download it for you -- but I'm willing to bet that it will fail for you.

Anyway, do this:
wget http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-3.12.6-plugin.run
chmod +x hplip-3.12.6-plugin.run
gksudo ./hplip-3.12.6-plugin.run

Hopefully that's good enough to take you through to system-config-printer and/or hp-setup. I did a lot of things, but it was the gksudo ./hplip-3.12.6-plugin.run that did it in the end.

And don't forget to add yourself to the lpadmin and perhaps lp groups:

cat /etc/group|grep lp
lp:x:7:verahill
lpadmin:x:111:verahill
I don't know how necessary it is, but heck, why not?


Here's the full, painful (and probably embarrassing) route I took:
It should not be this difficult to get a bloody printer to work. With older printer models it's been quick and easy, without having to download any 'binary plugins'. This is just effing ridiculous. Guess who's not buying another HP printer...

I reorganised my office, and as part of that decided to move my printer from my desktop to one of my networked boxes to free up some space on my desk. My desktop is running GNOME, while the target box is running KDE.

If you install the hplip packages in debian you end up with a very helpful script called hp-setup. You can run that as a user, but try running it as root via sudo, and you get

Invalid MIT-MAGIC-COOKIE-1 keyhp-setup: cannot connect to X server :0

OK, so you can run it as user. Everything looks great, BUT...you'll find that in this case the install will fail at the step of downloading the magical, mythological 'binary plugin'.

Also, as a user you're unlikely to be able to be able to put files in the places where they belong anyway, so there's that (see e.g. the first comment below).

You then do a bit of googling for hplip-3.12.6-plugin.run, and end up here: https://aur.archlinux.org/packages.php?ID=44646

You do
wget http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-3.12.6-plugin.run
chmod +x hplip-3.12.6-plugin.run
./hplip-3.12.6-plugin.run

This opens a gui where you get to accept the T&C. Not much seems to happen beyond that though. Oh, and you can't do the sudo-thingy because, well, you get the magic cookie error.

OK, take a step back.

sudo lpstat -a

global-mfp accepting requests since Mon 20 Aug 2012 10:46:48 EST
HP-LaserJet-Professional-P1102w-2 accepting requests since Mon 20 Aug 2012 13:49:19 EST
lpoptions -d HP-LaserJet-Professional-P1102w-2

lpq
HP-LaserJet-Professional-P1102w-2 is ready

Test it:
lp /etc/fstab
request id is HP-LaserJet-Professional-P1102w-2-1 (1 file(s))

 lpq
HP-LaserJet-Professional-P1102w-2 is ready and printing
Rank    Owner   Job     File(s)                         Total Size
active  (null)  1       untitled                        2048 bytes
Printing my foot it is.

Hmm...
cat /etc/group|grep lpadmin
lpadmin:x:114:
OK, edit /etc/group and add myself to lpadmin.

I can open system-config-printer, but I can't 1) delete any printers (which would've been nice) or 2) start it with sudo.

I can use http://localhost:631, but as a user I'm somehow not allowed to remove printers, and I use sudo -- there's no 'root' password.

At this point I was getting frustrated and nuked all printers clear of my system.

sudo lpadmin -x HP-LaserJet-Professional-P1102w-2

sudo apt-get install system-config-printer-kde

Now I had both 'printing' (= vanilla CUPS system-config-printer) and 'Printer Configuration' in the KDE menu.

Still no dice.

OK, another step back.
mkdir hp
./hplip-3.12.6-plugin.run --target hp
cd hp/
sudo cp 86-hpmud-sysfs_hp_laserjet_professional_p1102w.rules /etc/udev/rules.d

Still no effing luck.

Tried one last desperate thing:
gksudo ./hplip-3.12.6-plugin.run
Clicked the agreement. Said done.
Hit 'print test page' and...it printed!

So...you need to be root...but the MIT magic cookie issue combined with the requirement to have a friggin' gui (why???) made that painful. Well, I guess that's why we're told to use gksu whend oing graphical stuff...

OK, only things remaining: network sharing. Should be simple. Opened up all ports on print-host box to accept traffic from my desktop (and desktop only). No luck.

gksu system-config-printer
Click on server, settings -> check Publish shared printers connected to this system.

On my desktop it was then just add a matter of adding the printer in GNOME (ipp://192.168.1.101:631/printers/HP-LaserJet-Professional-P1102w)

Sweet.

SOLVED.


16 August 2012

221. First steps with Moodle (the .deb version) in Debian

This is a very brief, very basic outline.

Looking online the general recommendation seems to be to install moodle yourself and avoid the debian package version. While not a stranger to rolling my own, I just want to play with moodle for learning purposes because that's what my uni uses.

Anyway, do
sudo apt-get install moodle

Once it's installed, look at
ls /etc/apache2/sites-enabled

If there's nothing moodly, then do
sudo cp /etc/moodle/apache2.conf /etc/apache2/sites-enabled/moodle.conf
sudo service apache2 restart

Navigate to http://localhost/moodle

The actual installation takes ages, so go get yourself a cup of tea/coffee to prevent your mouse finger from getting itchy. In other words, just wait until you get a list showing that all steps have completed and that you may continue.

You need to allow cookies.


Fill out the admin stuff - country, password, city etc etc.



At this point you can log in, create a class and start exploring. Have fun.


31 July 2012

217. Recently...

Recently I've been busy preparing lectures (phew!), which means I've been kinder to my computer than is normal. Still, I managed to get myself into a few situations. The need to 'get stuff done' overrode the importance of documentation, but here's the low-down in case someone finds themselves in a similar situation:


1. Upgrades keep on getting stuck when restarting nfs/nfsd (nfs-common, nfs-kernel-server).
Normally I don't have any problems with nfs -- it's a tried and tested technology -- but one of my cluster nodes was giving me grief.

The key was to comment out everything in /etc/exports and commenting out nfs mounted partitions in /etc/fstab, then adding nfs and nfsd to /etc/modprobe.d/blacklist.conf (not sure this actually did anything), rebooting, throwing in

sudo rmmod nfs nfsd 


to be on the safe side, then doing

sudo dpkg --configure -a

to get dpkg/apt back in working order. After that I could uncomment everything in /etc/exports and /etc/fstab, and whitelist my drivers again.

Problem solved.

2. Nvidia is still a headache.
Since I was given a rare opportunity to reboot my front node I did a bit of work on it. Mainly, I wanted to allow gdm to start again, and figured I'd return to my nvidia driver managment to dkms-y goodness.

So I fired up smxi, selected 'debian-nvidia' and...everything was messed up. Long story short: I got it working with gdm3 by picking 'current driver' in smxi (always blacklist nouveau if you want to use/install nvidia drivers), making sure that there was no 'vga' (e.g.  vga=0x0318 ) in GRUB_CMDLINE_LINUX in /etc/default/grub and rebooting liberally.

I later got the debian-nvidia (dkms) version working by 1) not using frambuffer and 2) manually removing all nvidia legacy drivers that smxi pulled in. Well, that's working as in no error messages and the desktop looking fine.

3. GNOME 3 not diplaying all letters
e.g. 'guake' was rendered as 'g ak '. This happened on a low-powered system. A 'fix' was to go to advanced settings (gnome-tweak-tool), select font and change scaling from 1.0 to 1.2 and above.

It's not much of a 'fix', so I ended up nuking GNOME from that system and replacing it with KDE to have a reason to get more familiar with it. In the interest of balance I nuked all other DEs from another box and put LXDE on it. To paraphrase the Dos Equis commercial: I don't always use a DE, but when I do, I want to learn something new.

I've used KDE and GNOME on and off over the past 12 years, but you get rusty -- and both KDE and GNOME have changed enough from v 3.x and 2.x, respectively, that they aren't the same environment anymore. I still get an initial feeling of joy when I sit down by an NMR console and discover a red hat system with a 3.x desktop. Which is quickly followed by being annoyed over not having root access, but whatever. As for the usual gnome 2 vs gnome 3 arguments -- I like gnome3 in general. I just hate the idea of settings being hidden or disabled, and functionality being reduced. Enough so that I'm still looking for a potential replacement.

So far :
KDE -- I like it. It's overdoing the desktop effects a bit (out of the box) but, since it's KDE, it's easy to turn things on and off. I'm still a GNOME man, and KDE doesn't have the warm fuzzy feeling of home yet, but I can see how I could get used to it. I just need to get over my outdated idea that KDE is for windows users (I've never used a Mac so I guess I'm a reformed windows -- actually DOS -- user more than anything else).

KDE on one of my other systems seems to be messing up GNOME 3 though -- e.g. the mouse cursor theme gets transferred to gnome, and the pop-up notifications are those of kwin and not gnome-shell.  Not sure whether it's KDE causing it or whether I've messed a bit too much with my system.

LXDE -- it's functional and has long been my choice for virtual installations of linux for windows users. It's minimalistic in the sense that yes, it does provide a desktop, but no, it doesn't try to do anything beyond providing a set of menus and a bit of themeing. And that's a good thing. If you're going to impress a mate -- use gnome or kde. If you just need to get something done and launch a piece of software, lxde's your mate.

4. One of my systems lacked /etc/init.d/vboxdrv
Not all my collaborators use linux, so I keep a virtual copy of XP around for when I'm absolutely forced to use MS Word (OpenOffice sometimes changes the layout and it quickly becomes messy on collaborative documents). When taking a quick break to edit a manuscript in virtualbox I got the usual no driver present, 'run /etc/init.d/vboxdrv setup' message. Well, there was no /etc/init.d/vboxdrv in spite of dkms and vboxdrv-dkms being installed in addition to all the kernel headers. Turns out that the quickest way, assuming that locate vboxdrv doesn't come up empty (i.e. it's somewhere in the kernel tree) is just to mod it.
modprobe vboxdrv


To avoid it in the future, stick
vboxdrv
somewhere in your /etc/modules


5. Mysteriously self-rotating gnuplot images in latex 
Came down to a stupid mistake. I was doing:

set term postscript enhanced colour
set output 'acid.eps'
set border 3
set xtics nomirror
set ytics nomirror

I forgot to add eps -- getting rusty I suppose.

set term postscript enhanced eps colour
set output 'acid.eps'
set border 3
set xtics nomirror
set ytics nomirror

Surprised it hasn't happened before during all these years of latex usage.

6. Setting default line printer
me@beryllium:$ lpq
lpq: Error - no default destination available.



me@beryllium:$ lpstat -a
AdobePDF accepting requests since Mon 06 Aug 2012 08:01:32 EST
AdobePDF7 accepting requests since Mon 06 Aug 2012 08:01:32 EST
AdobePDF8 accepting requests since Mon 06 Aug 2012 10:04:13 EST
AdobePDF8@johnbowmansimac.dbs.monash.edu.au accepting requests since Mon 06 Aug 2012 08:01:32 EST
AdobePDF9 accepting requests since Mon 06 Aug 2012 08:01:32 EST
AdobePDF9@130.194.162.66 accepting requests since Mon 06 Aug 2012 08:01:32 EST
biol08r159p1 accepting requests since Mon 06 Aug 2012 08:01:32 EST
Canon_iP4300 accepting requests since Mon 06 Aug 2012 08:01:32 EST
Canon_MP460 accepting requests since Mon 06 Aug 2012 10:09:36 EST
Colour_109a accepting requests since Mon 06 Aug 2012 08:01:32 EST
global-mfp accepting requests since Mon 28 May 2012 14:27:30 EST
GlobalMFP@s0001203.dbs.monash.edu.au accepting requests since Mon 06 Aug 2012 08:01:32 EST
HP_LaserJet_Professional_P1102w accepting requests since Sat 04 Aug 2012 23:08:16 ESTHPColourLaserCP3505 accepting requests since Mon 06 Aug 2012 08:01:32 EST
HPLaserJetP3005 accepting requests since Mon 06 Aug 2012 08:01:32 EST

 me@beryllium:$ lpoptions -d HP_LaserJet_Professional_P1102w
auth-info-required=none copies=1 device-uri=hp:/usb/HP_LaserJet_Professional_P1102w?serial=000000000Q91K4WVSI1c finishings=3 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=0 number-up=1 printer-commands=AutoConfigure,Clean,PrintSelfTestPage printer-info='HPIJS -- drv:///hpijs.drv/hp-laserjet_professional_p1102w-hpijs.ppd' printer-is-accepting-jobs=true printer-is-shared=true printer-location printer-make-and-model='HP LaserJet Professional p1102w, hpcups 3.12.4, requires proprietary plugin' printer-state=5 printer-state-change-time=1344085696 printer-state-reasons=paused printer-type=8425484 printer-uri-supported=ipp://localhost:631/printers/HP_LaserJet_Professional_P1102w


7. The next Debian is codenamed Jessie!
I'm only 6 days late...apparently that's the cowgirl.

13 July 2012

208. Weird things with desktops -- nvidia cockup?

Just in case someone else is having an equally entertaining Friday the 13th (of July 2012).

So, I had a little gnome 3 crash. You know the ones with the frowny screen and a message saying that "yeah, we probably could have let you save everything you're working one but screw you 'cos we're logging you out"? (hmm...don't remember seeing that with gnome 2/metacity -- have we in fact been turned into Metro/Win8 guinea pigs?!)

Well, anyway, I had one of those and rebooted.

I got to gdm3, logged in and...nothing. I mean, I saw the desktop background, but no menus, nothing. Nothing at all. Moving the mouse to the top left corner would give me the typical gnome-shell splash pattern and make the screen a bit darker. I didn't get anything else though (like a list over programs, icons or anything). Oh, and the conky stuff briefly flashed by each time (but in the top left area instead of flush to the right side of the screen)

Given that I played around with testing different desktops recently I figured I might have upset the update-alternatives balance, and played around with --config x-window-manager and --config x-session-manager. I mean, I was hoping that the lack of a menu of some sort was due to having the wrong window manager, in spite of all the signs pointing to me actually using gnome-shell.

That not working I spent another hour playing with installing and uninstalling nvidia. For some reason smxi pulled in the 173 driver, before replacing it with 302. Every time. Finally, I managed to get everything to the point where I could do startx with the nouveau drivers installed.

Not that things were perfect -- in fact my screen was scaled to 1024*768 (supposed to be 1920x1280), and the flicker whenever I moved my mouse was not funny, but at least it kind of worked.

So back to the terminal, sudo rmmod nouveau, sudo smxi, install the nvidia driver again -- but this time selecting nvidia current instead of debian-nvidia, and then startx

Huh. This time I kind of got the icon panel and the bottom panel, and the gnome-shell hot corner worked ok. It's almost like...no way...is it pretending I have two displays???

I then went to System settings/Displays and the bloody thing had set it up so there were two active display (I don't OWN two displays and certainly did not set this willingly).

Here it's been deactivated. But seriously, wtf???

So if you find yourself in a similar situation without panels and stuff: check your settings. Now how the hell did this come about? And who can I blame? Debian? Nvidia? Nvidia has been the cause of most of my more severe problems with debian...I just wish nouveau was a better alternative than it currently is for my setup.

PS I do realise that some of the language in the post above is more fitting for a valley girl, but screw this: I'm a busy person with a tight schedule (semester starts in two weeks and still hammering away on lectures, not to mention research) who lost three valuable Friday afternoon hours on a stupid thing. Not happy.

12 July 2012

207. apt-get, apt-cacher-ng and hash sum mismatch

Update: Another day and we're back to the same crap with Hash sum mismatches. It's getting old...however, I'm beginning to suspect it's not the mirror, but my apt-cacher-ng.

I was getting a bit peeved with getting intermittent messages about 'hash sum mismatch' etc. when trying to do sudo apt-get update

Ign http://dl.google.com stable/main Translation-en                                                                                                                                                                                         
Fetched 17.1 MB in 9s (1,736 kB/s)                                                                                                                                                                                                          
W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_main_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_contrib_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_non-free_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_contrib_i18n_Translation-en  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_main_i18n_Translation-en  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_non-free_i18n_Translation-en  Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.


So I took action:
sudo rm -rf /var/cache/apt-cacher-ng/*

But then
sudo apt-get update    
Get:1 http://192.168.1.1 testing InRelease [190 kB]
Err http://192.168.1.1 testing InRelease                                                                                                                        
Ign http://192.168.1.1 stable InRelease                                                                                                                         
Get:2 http://192.168.1.1 stable Release.gpg [1,672 B]                                                                                    
..
Fetched 7,004 kB in 7s (965 kB/s)                                                                                                                                                                                                           
Reading package lists... Done
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://192.168.1.1 testing InRelease: File /var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_InRelease doesn't start with a clearsigned message

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/InRelease  

so I

sudo apt-get install debian-keyring

which didn't solve anything

Solution:
Edit you /etc/apt/sources.list and replace all instances of testing with wheezy, e.g.

deb http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/ wheezy main contrib non-free
deb http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/ stable main contrib non-free

I don't know if this has to do with the transition towards freezing wheezy, but basically, if you're having problems like that, have a look at what's actually on the mirror you're using. In my case I had a look at ftp://ftp.iinet.net.au/debian/debian/dists/ and found no 'testing' directory.


It also took care of these related messages on a different node:

Fetched 7,493 kB in 8s (885 kB/s)
W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/contrib/binary-amd64/PackagesIndex  MD5Sum mismatch

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/contrib/i18n/Translation-enIndex  MD5Sum mismatch

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/non-free/binary-amd64/PackagesIndex  MD5Sum mismatch

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/non-free/i18n/Translation-enIndex  MD5Sum mismatch

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/main/i18n/Translation-enIndex  MD5Sum mismatch

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/main/binary-amd64/PackagesIndex  MD5Sum mismatch

11 June 2012

186. Installing gnome shell extensions in gnome 3.4 on debian wheezy-- frippery panel, menu etc.

Gnome 3.4 frippery extensions in Debian Wheezy: bottom panel, favourites etc.
Upgrading to gnome 3.4 disabled all my extensions. It also remove all my keyboard shortcuts.

Update: Interesting take on ther GNOME 3/KDE 4releases  http://www.datamation.com/open-source/the-gnome-exodus-and-kde-2.html I think the idea of a lack of trust is a valid one: I might be able to get GNOME to do what I want today, but whatabout tomorrow? How much longer can I manually patch my screenshot app?

So, we need to get:
* move clock
* favourites
* application menu
* bottom panel
* static workspaces

Btw, extensions.gnome.org doesn't do International English. Try searching for favourites. And that's just the beginning of the headaches. I had problems finding any extensions compatible with gnome 3.4.

Anyway, as usual frippery (http://intgat.tigress.co.uk/rmy/extensions/index.html) comes to the rescue of the users (and by extension to the rescue of Gnome -- I'd already be long gone if I couldn't revert some of the more insane behaviour of gnome-shell...)

In your ~ folder (in order that the files get untared to the correct location)
wget http://intgat.tigress.co.uk/rmy/extensions/gnome-shell-frippery-0.4.1.tgz
tar xvf gnome-shell-frippery-0.4.1.tgz 

Hit alt+f2 to bring up the launcher thingy, type 'r' and hit enter. You're done!


To make life worth living again, also do
sudo apt-get install gnome-tweak-tool
if you haven't already

That way you can get the Minimize/Maximize/Close buttons back on your window border.

Another noticeable change is that it's become very difficult to resize windows using the mouse -- expand horizontally or vertically is like before, but dragging a corner is tough -- it takes a lot of fiddling to be able to grab the corner in the first place.

Finally, ctrl+b is mapped to some bookmark function in epiphany/web which is annoying, since it's universally used to make things bold. The gnome developer instructions even say not to do this:
http://developer.gnome.org/hig-book/3.4/input-keyboard.html.en (see table 10.8)


Interesting side-effect:
my fancy gnome-screenshot.debugged isn't called anymore -- and the metacity/keybinding_commands list is depopulated in addition to the gnome system settings/keyboard/shortcuts/Custom. Gnome shell 3.4 seems to mark the point where gconf-editor is deprecated. See the gnome-screenshot compilation post for more info.


At any rate, the keyboard shortcuts related to Screenshots now contains five different combination commands. Seriously -- they 'simplify' gnome-screenshot, then they want users to learn four different key combinations in addition to vanilla prtscr? And none of them does what I really need -- i.e. a quick and simple way to save screenshot with the name I want in the location I want.


Links to this post:
https://www.linuxquestions.org/questions/debian-26/how-to-add-panel-in-gnome-debian-wheezy-4175463451/

25 May 2012

163. Long rant over LaTeX problems caused by my own stupidity: tex.pro


25 May 2012.
I'm having problems turning dvi into ps
latex test.tex
works fine.
dvips test.dvi
however gives
This is dvips(k) 5.991 Copyright 2011 Radical Eye Software (www.radicaleye.com) dvips: ! Couldn't find header file: tex.pro Process exited with error(s)
Solution:
Diagnosis: PEBKAC
I was being a bloody idiot.
cat ~/.bashrc|grep TEX
export TEXINPUTS=/usr/share/texmf/tex/latex/prosper/prosper.cls:$TEXINPUTS
export TEXMFMAIN=/usr/share/texmf/

Once I commented those lines out and did
export TEXINPUTS=""
export TEXMFMAIN=""

everything was fine.

I wasted 1h30 min of prime working time on THIS. Anyway, I'm putting it all up here in case someone is having a similar problem. The moral of the story is:
always begin by checking your ~/.bashrc, ~/.cshrc and ~/.profile.

The other reason for posting it online is because the troubleshooting steps may be useful to have in the future.

Troubleshooting
kpsewhich tex.pro
gave nothing

locate tex.pro
/usr/share/texlive/texmf/dvips/base/tex.pro /usr/share/texlive/texmf-dist/dvips/gastex/gastex.pro

neither
sudo texconfig
or
sudo mktexlsr
or
sudo texhash
helped (they pretty much do the same thing).

dpkg -S tex.pro
texlive-science: /usr/share/texlive/texmf-dist/dvips/gastex/gastex.pro texlive-base: /usr/share/texlive/texmf/dvips/base/tex.pro

show dpkg is aware of the files.
kpsewhich -path /usr/share/texlive/texmf/dvips/base tex.pro
/usr/share/texlive/texmf/dvips/base/tex.pro
obviously works.
dvips -d 2 draft_1.dvi
[..]
This is dvips(k) 5.991 Copyright 2011 Radical Eye Software (www.radicaleye.com) input file draft_1.dvi output file draft_1.ps swmem 180000 kdebug:Search path for PostScript header files (from texmf.cnf) kdebug: = .:/usr/share/texlive/texmf/dvips/base//dvips//:/usr/share/texlive/texmf/dvips/base//fonts/enc//:/usr/share/texlive/texmf/dvips/base//fonts/type1//:/usr/share/texlive/texmf/dvips/base//fonts/type42//:/usr/share/texlive/texmf/dvips/base//fonts/type3// kdebug: before expansion = .:$TEXMF/{dvips,fonts/{enc,type1,type42,type3}}// kdebug: application override path = (none) kdebug: application config file path = (none) kdebug: texmf.cnf path = .:$TEXMF/{dvips,fonts/{enc,type1,type42,type3}}// kdebug: compile-time path = /nonesuch kdebug: environment variables = TEXPSHEADERS PSHEADERS [..] dvips: ! Couldn't find header file: tex.pro
export TEXMF=/usr/share/texlive/texmf
solves the tex.pro problem, but gives this instead:
tex.dvips: Can't open font metric file cmr10.tfm dvips: I will use cmr10.tfm instead, so expect bad output. dvips: ! I can't find cmr10.tfm; please reinstall me with proper paths
locate cmr10.tfm
/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr10.tfm
export TEXMF=$TEXMF:/usr/share/texlive/texmf-dist/fonts/tfm/public/cm
and we're back to
dvips: ! Couldn't find header file: tex.pro
sudo dpkg-reconfigure texlive-base
didn't do anything for me.
Solution
aptitude search texlive|grep ^i|gawk '{print $2,$3}>texlive.list
I then edited texlive.list and remove all the initial A on the relevant rows.

Then
sudo apt-get purge texlive

followed by
cat texlive.list|xargs >list
I the took the list there
sudo apt-get install `cat list`
which did
sudo apt-get install feynmf latex-beamer latex-xcolor pgf prosper texlive texlive-base texlive-bibtex-extra texlive-binaries texlive-common texlive-doc-base texlive-extra-utils texlive-font-utils texlive-fonts-recommended texlive-fonts-recommended-doc texlive-generic-recommended texlive-latex-base texlive-latex-base-doc texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended texlive-latex-recommended-doc texlive-luatex texlive-metapost texlive-metapost-doc texlive-pictures texlive-pictures-doc texlive-pstricks texlive-pstricks-doc texlive-publishers texlive-publishers-doc texlive-science texlive-science-doc texpower tipa

It still doesn't [censored] work!

It's the same shit with

dvipdfm draft_1.dvi
** WARNING ** Could not open config file "dvipdfmx.cfg". draft_1.dvi -> draft_1.pdf [1] 22057 bytes written

locate dvipdfmx.cfg
/usr/share/texlive/texmf/dvipdfmx/dvipdfmx.cfg /usr/share/texlive/texmf-dist/tex/generic/pstricks/config/xdvipdfmx.cfg
sudo texhash and sudo texconfig do nothing.
cat /usr/share/texlive/texmf/ls-R|egrep "tex.pro|dvipdfmx.cfg"
dvipdfmx.cfg dvipdfmx.cfg.ucf-dist tex.pro
So what the bloody hell is the effing problem?
locate ls-R
/usr/share/texlive/texmf/ls-R /usr/share/texlive/texmf-dist/ls-R /usr/share/texmf/ls-R /var/lib/texmf/ls-R /var/lib/texmf/ls-R-TEXLIVE /var/lib/texmf/ls-R-TEXLIVEDIST /var/lib/texmf/ls-R-TEXLIVEMAIN /var/lib/texmf/ls-R-TEXMFMAIN
So which ones have tex.pro in them?
/usr/share/texlive/texmf/ls-R -- yes /usr/share/texlive/texmf-dist/ls-R -- no /usr/share/texmf/ls-R -- no /var/lib/texmf/ls-R -- no /var/lib/texmf/ls-R-TEXLIVE -- yes /var/lib/texmf/ls-R-TEXLIVEDIST -- no /var/lib/texmf/ls-R-TEXLIVEMAIN -- yes/var/lib/texmf/ls-R-TEXMFMAIN -- no

03 May 2012

130. Today's (3rd of May 2012) debian wheezy/testing updates -- Confused

You may want to be careful if you do dist-upgrade today.

Today
sudo apt-get dist-upgrade
gave

The following packages will be REMOVED:
  gnome gnome-desktop-environmentThe following NEW packages will be installed:
  gir1.2-gdesktopenums-3.0 iputils-tracepath
The following packages have been kept back:
  libboost-date-time-dev libboost-dev libboost-regex-dev libboost-signals-dev libgl1-nvidia-glx libmono-winforms2.0-cil nvidia-alternative nvidia-glx nvidia-kernel-dkms nvidia-vdpau-driver python-pyatspi2 xserver-xorg-video-nvidia
The following packages will be upgraded:
  gnome-core gnome-nettool gsettings-desktop-schemas gsettings-desktop-schemas-dev
No worries there, so I continued.

However, having seen the removal of gnome, gnome-core etc. cause issues before (http://verahill.blogspot.com.au/2012/04/fixed-no-internet-on-old-dell-after.html) I did
apt-get -s autoremove
afterwards.

The following packages will be REMOVED:
  abiword abiword-common abiword-plugin-grammar abiword-plugin-mathview aisleriot cheese ekiga file-roller gdebi gedit gedit-common gedit-plugins gir1.2-gdata-0.0 gir1.2-goa-1.0 gir1.2-gucharmap-2.90 gir1.2-javascriptcoregtk-3.0 gir1.2-rb-3.0 gir1.2-tracker-0.14 gir1.2-webkit-3.0 glchess glines gnect gnibbles gnobots2 gnome-cards-data gnome-documents gnome-games gnome-games-data gnome-games-extra-data gnome-nettool gnome-sudoku gnome-video-effects gnomine gnotravex gnotski gnuchess gnuchess-book gnumeric gnumeric-common grilo-plugins-0.1 gtali hamster-applet iagno iputils-tracepath libabiword-2.9 libatk-adaptor-schemas libboost-date-time1.49.0 libboost-serialization1.49.0 libboost-signals1.49.0 libcec1 libdmapsharing-3.0-2 libgdome2-0 libgdome2-cpp-smart0c2a libgexiv2-0 libgpod-common libgpod4 libgrilo-0.1-0 libgtkmathview0c2a libgupnp-av-1.0-2 libhal-storage1 liblink-grammar4 libmagick++4 libmagickcore4 libmagickcore4-extra libmagickwand4 libminiupnpc5 libnatpmp1 libnet1 libnfs1 libopal3.10.4 libots0 libpt2.10.4 librhythmbox-core5 libwv-1.2-4 liferea liferea-data link-grammar-dictionaries-en mahjongg media-player-info minissdpd python-evolution python-wnck quadrapassel rhythmbox rhythmbox-data rhythmbox-plugin-cdrecorder rhythmbox-plugins seahorse shotwell simple-scan sound-juicer tcptraceroute telepathy-idle transmission-common transmission-gtk unoconv xdg-user-dirs-gtk
  ... 97 to remove and 12 not upgraded.
Yeah, that doesn't sound good - I use seahorse, ekiga etc.

If the package version is given (libboost-date-time1.49.0) it's often ok to remove. But removing un-versioned packages is a better indication of something major being underway.

Anyway, taking a quick gander at gnome-desktop-enviroment which got removed:

Package: gnome-desktop-environment    
State: not installed
Version: 1:3.0+8
Priority: optional
Section: gnome
Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
Architecture: all
Uncompressed Size: 43.0 k
Depends: gnome (>= 1:3.0+8)
Description: The GNOME Desktop Environment - transitional package
 This is the GNOME Desktop environment, an intuitive and attractive desktop.

 This meta-package is obsolete and has been replaced by “gnome”.

Then checking gnome (which also got removed):

  Package: gnome                        
State: not installed
Version: 1:3.0+8
Priority: optional
Section: gnome

Seems like gnome got marked for removal although it shouldn't have been.

sudo apt-get install gnome
followed by
sudo apt-get -s autoremove
 The following packages will be REMOVED:
  dasher dasher-data gnome-accessibility-themes libboost-date-time1.49.0 libboost-serialization1.49.0 libboost-signals1.49.0 libcec1 libgail-gnome-module libhal-storage1 libmagick++4 libmagickcore4 libmagickcore4-extra libmagickwand4
  libnet1 libnfs1 tcptraceroute
0 upgraded, 0 newly installed, 16 to remove and 12 not upgraded.
Which makes a lot more sense.

Ergo, be careful when you use autoremove -- sometimes it will kill your desktop. Keep an eye at what dist-upgrade does.

02 May 2012

129. Thunderbird 12.01 on debian

First build thunderbird
wget ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/12.0.1/source/thunderbird-12.0.1.source.tar.bz2

Install dependencies
sudo apt-get install libdbus-glib-1-dev gir1.2-notify-0.7 libnotify-dev yasm checkinstall libzip-dev zip 

Remove the previous version and make sure that there's no existing comm-release directory
rm comm-release/ -rf
tar -xvf thunderbird-12.0.1.source.tar.bz2
cd comm-release/
./configure --disable-necko-wifi

The next step will take a little while (30-60 minutes on a slow computer)
make

And then install
sudo make install



Then install add-ons:
Lightning 1.4  (Sunbird is being discontinued)
Provider  for Google Calendar 0.9 (otherwise you won't be able to dismiss calendar reminders)
Engimail 1.4.1 (see http://verahill.blogspot.com.au/2012/05/encrypting-your-email-chat-and-phone-in.html)



28 April 2012

125. Fixed: No internet on old Dell after debian testing upgrade

The situation:
I remotely dist-upgraded someone's old Dell laptop (Inspiron 6000). They were running Wheezy, but had not done a full apt-get upgrade/dist-upgrade since January. After a reboot, the laptop would not connect to the internet via either the wired or wireless interfaces.

ip addr and ifconfig showed three ifs:
lo
eth0
eth1

NOTE: A simple reason why you don't have wireless is because you'll need firmware-iwlwifi -- make sure you've enabled non-free and contrib in your repos.

The solution:
Adding
auto eth0
iface eth0 inet dhcp

to /etc/network/interfaces and commenting out
allow-hotplug eth0

followed by executing
sudo service networking restart && sudo service network-manager restart

brought up the wired interface, allowing for installation of packages and remote help. These instructions are simple enough for most to follow and can get you back in the driver's seat.

Next, I installed the wicd packages (wicd-curses, wicd-cli etc.)
sudo apt-get install wicd-cli wicd-curses wicd-daemon python-wicd

 -- at this point about 70 other packages got pulled in. Suspicious. I had seen that apt wanted me to autoremove a lengthy list of programs:

The following packages were automatically installed and are no longer required:  python-crypto mono-2.0-gac python-tagpy libgnomekbd4 seahorse-daemon libboost-python1.46.1 python-pyasn1 libswscale0 libjs-jquery-ui python-twisted-core ekiga python-opengl rpm2cpio xsltproc pnm2ppa libavutil50 gnuchess-book  gnome-nettool gnome-games-extra-data gnome-desktop-data libgnomepanel2.24-cil aisleriot gtali libglade2.0-cil libsushi-1.0-0 python-mako glchess libbabl-0.0-0 gir1.2-javascriptcoregtk-3.0 libgegl-0.0-0 ttf-sil-gentium libicu44  libraw2 libx264-116 libx264-118 tcptraceroute gir1.2-sushi-1.0 gnome-video-effects libcamel-1.2-23 python-clientform gnome-games gnome-session-canberra gdebi anthy-common anthy quadrapassel python-twisted-web libedataserverui1.2-11  update-manager-core gnobots2 libgnome-media0 libqtmultimediakit1 gnome-cards-data liferea-data libgraphite3 libmagickcore4-extra libglew1.6 rhythmbox bsh-gcj python-gdata gedit libnm-util1 xdg-user-dirs-gtk libgexiv2-0  python-gtksourceview2 gnome-office update-manager-gnome libwebkit-1.0-2 python-gtkglext1 xulrunner-5.0 libart2.0-cil libboost-program-options1.46.1 libminiupnpc5 libcamel1.2-19 librpmio2 update-notifier-common libpostproc51 librpm2  seahorse rpm-common libgnome2-perl libaccess-bridge-java-jni xulrunner-8.0 xulrunner-9.0 libnotify1 libaccess-bridge-java update-notifier python-mechanize libwebp0 libgnome2.24-cil libndesk-dbus1.0-cil gnome-media-common libgpod4  gnibbles libavformat52 rhythmbox-data libmono-cairo2.0-cil gedit-plugins libgrilo-0.1-0 zeitgeist-core system-tools-backends libboost-thread1.46.1 libgweather1 libgnome-bluetooth7 dasher python-configobj guile-1.8-libs shotwell  libpolkit-gtk-1-0 libdmapsharing-3.0-2 python-serial gedit-common libboost-serialization1.46.1 libboost-date-time1.46.1 libgmime2.4-cil python-gnomedesktop software-center libopal3.6.8 python-pam python-openssl libhwloc3  libmono-i18n-west2.0-cil libgssdp-1.0-2 simple-scan gir1.2-webkit-3.0 libebook1.2-10 libqtlocation1 python-markupsafe libgck0 python-webkit libmono-posix2.0-cil bsh libedataserverui-3.0-0 rhythmbox-plugin-cdrecorder libgdata11  libhunspell-1.2-0 librhythmbox-core4 librhythmbox-core5 libgtksourceview2.0-common libmono-security2.0-cil libgtksourceview2.0-0 libgnome2-vfs-perl gnotski dasher-data libegroupwise1.2-13 libvpx0 libedata-cal-1.2-11 libnm-glib2  gnome-doc-utils libecal1.2-8 python-twisted-conch libgmime-2.4-2 python-louie libunique-1.0-0 libedataserver1.2-14 libpython2.6 libimobiledevice1 libedata-book-1.2-9 python-nevow gnome-games-data iagno glines media-player-info  python-pysqlite2 libcupsdriver1 python-gnomeapplet libclutter-gtk-0.10-0 gnome-sudoku libslab0a libmagickcore4 tcl gir1.2-gucharmap-2.90 libmono-sharpzip2.84-cil libmagick++4 libmono-corlib2.0-cil python-epsilon  libgnome-window-settings1 libgpod-common rhythmbox-plugins libv8-3.5.10.24 libv8-3.6.6.14 libcryptui0a ntfsprogs python-axiom libmozjs2d libquvi0 python-bugbuddy libmozjs5d gir1.2-rb-3.0 libtracker-client-0.10-0 liferea libpt2.6.7  libmozjs8d libmozjs9d python-coherence libmagickwand4 libchamplain-0.8-1 libgupnp-1.0-3 python-gdbm libchamplain-gtk-0.8-1 gnotravex gnome-netstatus-applet libnl1 libnl3 gnect libavcodec52 python-evolution libanthy0 libyajl1  liboobs-1-4 libgucharmap7 liboobs-1-5 mahjongg libndesk-dbus-glib1.0-cil libid3tag0 libraptor1 gnome-system-tools python-wnck libtracker-sparql-0.10-0 libgnome-desktop-2-17 libtracker-sparql-0.12-0 hamster-applet gnuchess libfreerdp0  libgnome-vfs2.0-cil min12xxw libwebkit-1.0-common minissdpd transmission-common libgtkglext1 libnatpmp1 libnet1 python-twisted-bin libmatroska4 libgupnp-igd-1.0-3 libmono-system2.0-cil libgnome2-canvas-perl file-roller  libxalan2-java-gcj transmission-gtk python-rdflib sound-juicer gnomine

 and suddenly it made sense:

aptitude search gnome-core

pB  gnome-core                                                                                                     - The GNOME Desktop Environment -- essential components


Basically, it seems that gnome got 'uninstalled' (technically just the meta package) -- most of the files related to it won't get removed until you do apt-get autoremove, but it's crippled enough to reduce functionality.
At least that was my thesis.

sudo service network-manager stop
sudo wicd-curses eth1

showed no wireless networks. Something not right.

Make sure the system is really up to date, then reboot, and have another go at it:
sudo apt-get update && sudo apt-get upgrade
which pulled in some glib-networking-* packages.
sudo apt-get install gnome gnome-core
sudo shutdown -r now

After boot
sudo service network-manager stop
sudo wicd-curses eth1

et voilá -- I do get a list over the local wireless networks. There's still a worrying list over stuff when you look at what would be autoremoved (e.g. apt-get -s autoremove)

Rebooted and the wireless interface seems to be handled ok by network-manager.
There is still a number of packages marked for autoremove, so...
sudo apt-get autoremove

System seems to work ok still.
sudo apt-get install update-manager-gnome update-notifier


And my job is done.

Here's the final /etc/network/interfaces:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth1
#NetworkManager#iface eth0 inet dhcp
#allow-hotplug eth1
auto eth1
#iface eth1 inet dhcp
auto eth0
iface eth0 inet dhcp


18 March 2012

110. Compiling, installing Gnuplot 4.6 on Debian

A new version of gnuplot doesn't happen very often, and this one has an interesting added feature in terms of support for using braces in algorithms.
http://www.gnuplot.info/announce.4.6.0

Building gnuplot 4.6 is similar to building 4.4.4 and is pretty straightforward:

sudo apt-get install libgd2-xpm-dev checkinstall

wget http://sourceforge.net/projects/gnuplot/files/latest/download?source=files
mv download\?source\=files gnuplot-4.6.tar.gz
tar -xvf gnuplot-4.6.tar.gz
cd gnuplot-4.6.0/

./configure --with-linux-vga
make
checkinstall -install=no
 sudo rm /usr/local/share/info/dir -rf
sudo dpkg -i gnuplot_4.6.0-1_amd64.deb

You may get an error if trying to install on a system with a home-compiled version of octave (see below).

The problem with handling small numbers is not present in this version (http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-bug-in-debian.html).


Error:
Selecting previously unselected package gnuplot.
(Reading database ... 258722 files and directories currently installed.)
Unpacking gnuplot (from gnuplot_4.6.0-1_amd64.deb) ...
dpkg: error processing gnuplot_4.6.0-1_amd64.deb (--install):
 trying to overwrite '/usr/local/share/info/dir', which is also in package octave 3.6.1-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 gnuplot_4.6.0-1_amd64.deb
Solution:

 sudo dpkg --force-overwrite -i gnuplot_4.6.0-1_amd64.deb

08 March 2012

97. Wine 1.4 out now -- very brief build instructions

UPDATE 16 May 2013: See here for Wine 1.5.30: http://verahill.blogspot.com.au/2013/05/416-wine-1530-in-chroot.html

UPDATE (10th Jan 2013): See here for Wine 1.5.21 using the multiarch approach in Debian Testing/Wheezy: http://verahill.blogspot.com.au/2013/01/308-compiling-wine-1521-on-debian.html

Updated list of dependencies for debian stable/squeeze: http://verahill.blogspot.com.au/2012/11/compiling-wine-155-from-source-using.html


The instructions are identical to those for wine1.4 rc4 and 5: http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-compiling-wine.html and wine 1.3.35: http://verahill.blogspot.com.au/2012/01/debian-testingwheezy-64-bit-installing.html

I've tested the build on 8 March 2012.

-- START HERE --
sudo apt-get install bison flex gcc libc6-dev libfontconfig-dev libfreetype6-dev libglu-dev libgsm1-dev libice-dev libjpeg-dev libldap-dev libmpg123-dev libncurses5-dev libopenal-dev libpng-dev libsm-dev libssl-dev libusb-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxml2-dev libxrandr-dev libxrender-dev libxslt-dev libxt-dev libxxf86vm-dev make libcapi20-dev liblcms-dev libsane-dev libhal-dev libdbus-1-dev valgrind prelink libcups2-dev opencl-dev lib32opencl1 oss4-dev gettext lib32v4l-dev lib32ncurses5-dev lib32asound2-dev lib32z-dev ia32-libs-dev
mkdir ~/tmp
cd tmp/
wget http://prdownloads.sourceforge.net/wine/wine-1.4.tar.bz2
tar -xvf wine-1.4.tar.bz2
./configure

configure: gstreamer-0.10 base plugins 32-bit development files not found, gstreamer support disabled
configure: libgsm 32-bit development files not found, gsm 06.10 codec won't be supported.
configure: libtiff 32-bit development files not found, TIFF won't be supported.
configure: WARNING: libjpeg 32-bit development files not found, JPEG won't be supported.
configure: Finished.  Do 'make' to compile Wine.
The warnings about lack of support can safely be ignored if you don't need it. The TIFF error seems a bit random since it appears on some of my systems, but not others. I haven't figured out the responsible package yet.

make
sudo checkinstall --install=no
to build 23Mb deb package without installing it
 OR 
sudo make install
to install without building a package.


Note:
JPEG support is supposedly available if you
1. remove symlinks
sudo rm /usr/lib32/libjpeg.so.62 /usr/lib32/libjpeg.so.62.0.0
2. Then, create new ones
sudo ln -s /usr/lib32/libjpeg.so.8 /usr/lib32/libjpeg.so.62
sudo ln -s /usr/lib32/libjpeg.so.8 /usr/lib32/libjpeg.so.62.0.0




Edit:
I didn't know it before, but there's a slightly different, wine-specific, way of building described here http://chrisjrob.com/2012/03/08/wine-1-4-on-debian-wheezy/

To see you wine version do
winecfg
This is from a newer build - 1.5.6



Links to this page:
http://chrisjrob.com/2012/03/08/wine-1-4-on-debian-wheezy
http://forums.linuxmint.com/viewtopic.php?p=535245
http://debian.linux.pl/threads/26515-Instalacja-wine-1-4-w-Debianie-Squeeze

05 March 2012

93. Building and installing samba from source

Here's how to compile and get started with SAMBA, which may come in handy if you need to set up a mixed environment.


Compiling

sudo apt-get install build-essential


wget http://ftp.samba.org/pub/samba/samba-latest.tar.gz
tar -xvf samba-latest.tar.gz 
cd samba-3.6.3/
cd source3
./configure
make
sudo checkinstall

You may want to look through the checkinstall settings:
*****************************************
**** Debian package creation selected ***
*****************************************
This package will be built according to these values:
0 -  Maintainer: [ root@barebone ]
1 -  Summary: [ samba 3.6.3 ]
2 -  Name:    [ samba ]
3 -  Version: [ 3.6.3 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ source3 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ source3 ]
12 - Conflicts: [  ]
13 - Replaces: [  ]
Enter a number to change any of them or press ENTER to continue:
Once the package is installed you need to put symlinks in your /usr/lib to the installed samba libs:
sudo ln -s /usr/local/samba/lib/libtalloc.so.2 /usr/lib/libtalloc.so.2
 sudo ln -s /usr/local/samba/lib/libtdb.so.1 /usr/lib/libtdb.so.1



Finally, create smb.conf in /etc/samba/ and make samba find it using a symlink
sudo mkdir /etc/samba
sudo touch /etc/samba/smb.conf
sudo ln -s /etc/samba/smb.conf /usr/local/samba/lib/smb.conf

Done. Sort of. You need to configure samba using smb.conf...a minimal configuration file can be found at the end of the post.



Errors:
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/verahill/tmp/samba-3.6.3/source3':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

Solution:
sudo apt-get install build-essential



error:
-bash: smbclient: command not found
solution:
 put /usr/local/samba/bin in PATH
export $PATH=PATH:/usr/local/samba/bin


error:
/usr/local/samba/bin/smbclient: error while loading shared libraries: libtalloc.so.2: cannot open shared object file: No such file or directory
solution:
sudo ln -s /usr/local/samba/lib/libtalloc.so.2 /usr/lib/libtalloc.so.2


error:
/usr/local/samba/bin/smbclient: error while loading shared libraries: libtdb.so.1: cannot open shared object file: No such file or directory
solution:
 sudo ln -s /usr/local/samba/lib/libtdb.so.1 /usr/lib/libtdb.so.1


Error:
/usr/local/samba/bin/smbclient: error while loading shared libraries: libwbclient.so.0: cannot open shared object file: No such file or directory
Solution:
 sudo ln -s /usr/local/samba/lib/libwbclient.so.0 /usr/lib/libwbclient.so.0


error:
/usr/local/samba/bin/smbclient: Can't load /usr/local/samba/lib/smb.conf - run testparm to debug it
solution:
because I know where debian normally puts the smb.conf --
sudo mkdir /etc/samba
sudo touch /etc/samba/smb.conf
sudo ln -s /etc/samba/smb.conf /usr/local/samba/lib/smb.conf



Configuration:
Following https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/install.html#id2551954

Minimal /etc/samba/smb.conf:
[global]
workgroup = WKG
netbios name = MYNAME
[share1]
path = /tmp
Also, open up the relevant ports in your firewall:
Iptables
sudo iptables -A INPUT -p udp -m udp --dport 137 -j ACCEPT
sudo iptables -A INPUT -p udp -m udp --dport 138 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 139 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 445 -j ACCEPT



01 March 2012

88. Building Apache 2.4.1 on Debian Testing

WARNING:
Don't remove your existing installation of apache2 without thinking. gnome-core depends on it.

Updated 1 March 2012. Added missing information which prevented building and now provide information about auto-start using an /etc/init.d/ script. Original post at 2012-02-23

Building
 A new version of apache is kind of a big deal. Here's how to build it.

sudo apt-get install libapr1-dev uuid-dev libaprutil1-dev libmysqlclient-dev libpq-dev libsqlite3-dev rcconf
wget http://apache.mirror.aussiehq.net.au//httpd/httpd-2.4.1.tar.gz
tar -xvf httpd-2.4.1.tar.gz
cd httpd-2.4.1/
./configure
make -j5

where 5 is the number of cores+1. Four-core i5 => 4+1=5.

To install run
sudo make install
or
sudo checkinstall
sudo dpkg -i *.deb


Done.


sudo checkinstall won't work unless you first
sudo mkdir -p /usr/local/apache2/modules
(see comment below by Y&S who pointed this out)

If you don't create the directory first, you get
/usr/share/apr-1.0/build/libtool --silent --mode=install install mod_allowmethods.la /usr/local/apache2/modules/
ranlib: could not create temporary file whilst writing archive: No more archived files
make[3]: *** [install-modules-yes] Error 1
make[3]: Leaving directory `/home/me/tmp/httpd-2.4.1/modules/aaa'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/me/tmp/httpd-2.4.1/modules/aaa'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/me/tmp/httpd-2.4.1/modules'
make: *** [install-recursive] Error 1
****  Installation failed. Aborting package creation.

Anyway, your compiled httpd is now in /usr/local/apache2/bin/httpd
In my case /usr/local/apache2/bin is not in my PATH -- whether you want to add it or not is a matter of choice.

In order for you to bind your own httpd to port 80 you need to stop apache2 if it is running
sudo service apache2 stop


Test your build:
me@tantalum:~$ /usr/local/apache2/bin/httpd -v
Server version: Apache/2.4.1 (Unix)
Server built:   Feb 23 2012 11:51:26
So far, very easy.

I've tried it on amd64 and i386 debian testing machines.

Replacing old version of apache2
Don't try to remove apache2.2-bin since gnome-core depends on it:
http://www.linuxformat.com/forums/viewtopic.php?p=101538

The easiest way to deal with this is to do
sudo rcconf 
and de-select apache2. This way it's still installed, but won't run as a rc service.

Making it boot -- init.d script
I had a look at this: http://www.cyberciti.biz/tips/linux-write-sys-v-init-script-to-start-stop-service.html

And here's my /etc/init.d/httpd script

#!/bin/bash
# description: apache2 httpd 2.4.1 server
# Start the service httpd
start() {
        /usr/local/apache2/bin/httpd &
        echo "Up and running"
}
# Restart the service httpd
stop() {
        killall httpd
        echo "Killing httpd"
}
### main logic ###
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  *)
        echo $"Usage: $0 {start|stop}"
        exit 1
esac
exit 0
Don't forget to chmod+x


Finally,
sudo rcconf
and select httpd (it'll be at the bottom of the list)

It's not the prettiest of scripts, and you can probably do better by editing /etc/init.d/apache2

28 February 2012

86. Building sinfo 0.0.45 on Debian Testing

I use sinfo to keep an eye on my cluster:
http://www.ant.uni-bremen.de/whomes/rinas/sinfo/#down

The debian repo version is 0.0.42-1
The latest version is sinfo 0.0.45

Here's the changelog since 0.0.42
sinfo 0.0.45- Tue, 13 Mar 2012 07:07:27 +0100corrected README compile hint for FreeBSDadded configure flag --disable-IPv6 to disable IPv6 supportsinfo 0.0.44 - Tue, 13 Dec 2011 18:32:33 +0100added reconnect for TCP connectionsadded LIBADD to make it --as-needed linkable tnx to T.Hardersinfo 0.0.43 - Thu, 01 Sep 2011 09:00:13 +0200fixed printing bug (integer underflow) when using sinfo -L or -W tnx to J.Erkkilae


There's little reason for compiling it yourself, but there's really no reason not to try either. I like debian and I like using apt-get to manage my system. Learning to be a bit more independent won't hurt though.
So here we go:

--START HERE --
wget http://www.ant.uni-bremen.de/whomes/rinas/sinfo/download/sinfo-0.0.45.tar.gz
tar -xvf sinfo-0.0.45.tar.gz 
cd sinfo-0.0.45/
sudo apt-get install libboost-dev libasio-dev libboost-signals-dev
./configure
(If your interface configuration has disabled IPv6 you must use ../configure --disable-IPv6 or sinfod will silently exit)
make 
sudo checkinstall


Done.

Start the sinfo daemon by
sudo sinfod --quiet --bcastaddress=192.168.1.255


Use
sinfo
to monitor

If you had sinfo installed before, autoremove it, then edit the left-behind /etc/init.d/sinfo script and change
/usr/sbin/sinfod
 to
 /usr/sbin/local/sinfod
Otherwise see http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-building_23.html for an example of writing your own init.d script.


To see all the cluster nodes running sinfo, just start
sinfo
If you don't see anything, then you've most likely not opened up your firewall -- you need to be able to listen to bcast.

Build errors:

Error:
In file included from message.cc:2:0:
message.h:5:34: fatal error: boost/shared_array.hpp: No such file or directory
compilation terminated.
make[2]: *** [message.lo] Error 1
make[2]: Leaving directory `/home/me/tmp/sinfo-0.0.45/libmessage'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/me/tmp/sinfo-0.0.45/libmessage'
make: *** [all-recursive] Error 1

Solution:
sudo apt-get install libboost-dev


Error:
In file included from udpmessagereceiver.cc:2:0:
udpmessagereceiver.h:4:20: fatal error: asio.hpp: No such file or directory
compilation terminated.
make[1]: *** [udpmessagereceiver.lo] Error 1
make[1]: Leaving directory `/home/me/tmp/sinfo-0.0.45/libmessageio'
make: *** [all-recursive] Error 1

Solution:
sudo apt-get install libasio-dev
which provides
/usr/include/asio.hpp
which is different from the asio.hpp included in libboost


Error:
/usr/bin/ld: cannot find -lboost_signals-mt
collect2: ld returned 1 exit status
make[2]: *** [sinfod] Error 1
make[2]: Leaving directory `/home/me/tmp/sinfo-0.0.45/sinfod'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/me/tmp/sinfo-0.0.45/sinfod'
make: *** [all-recursive] Error 1

Solution:
sudo apt-get install libboost-signals-dev

Links to this post:
http://ant.uni-bremen.de/whomes/rinas/sinfo/

85. Nvidia bug causes evolution to crash/segmentation fault. Temporary and permanent fixes on Debian Testing

The nvidia-tls bug is affecting evolution too...
(and it's not just GNOME - http://www.linuxmintusers.de/index.php?topic=6859.0)


UPDATE: I have two nvidia boxes running debian testing. Only the one with GT 430 is exhibiting problems. My GT 520 box is unaffected.


UPDATE: Here's how to downgrade your drivers:
http://verahill.blogspot.com.au/2012/03/debian-testing-downgrading-nvidia.html

If you don't want to read the entire post, here's the summary:
1. I think the only semi-permanent solution is to downgrade from 295.20 to nvidia driver version 290.10
2. you can run evolution with
strace -o evolution.log evolution
and IT WILL NOT CRASH
3. It doesn't matter whether you use the nvidia binary straight from nvidia, using sgfxi, or use the nvidia-kernel-dkms/glx debian way. Evolution still dies.

PS strace is normally used to track system calls for the purpose trouble shooting. That it prevents evolution from crashing is completely unintended. But it works as a quick-fix.

PPS  What it does:

"The nvidia-tls libraries (/usr/lib/libnvidia-tls.so.x.y.z and /usr/lib/tls/libnvidia-tls.so.x.y.z); these files provide thread local storage support for the NVIDIA OpenGL libraries (libGL, libGLcore, and libglx). Each nvidia-tls library provides support for a particular thread local storage model (such as ELF TLS), and the one appropriate for your system will be loaded at run time."




The symptoms:
Start  evolution, and it will crash with a segmentation fault within the first ten seconds or so

dmesg points to the nvidia bug:

[19690.606196] evolution[13032]: segfault at 10 ip 00007f5a0f53ac0f sp 00007f59ddde6508 error 6 in libnvidia-tls.so.295.20[7f5a0f53a000+3000]
[21476.236668] evolution[18197]: segfault at 10 ip 00007fd4389c2c0f sp 00007fd418d56508 error 6 in libnvidia-tls.so.295.20[7fd4389c2000+3000]
[21513.224145] evolution[18387]: segfault at 10 ip 00007f2cd3e85c0f sp 00007f2cb3a44508 error 6 in libnvidia-tls.so.295.20[7f2cd3e85000+3000]
[21954.867694] evolution[19803]: segfault at 10 ip 00007f1680aa9c0f sp 00007f165bffe508 error 6 in libnvidia-tls.so.295.20[7f1680aa9000+3000]
[22129.426444] evolution[20435]: segfault at 10 ip 00007f2a05bf8c0f sp 00007f29e5725508 error 6 in libnvidia-tls.so.295.20[7f2a05bf8000+3000]


Running
CAMEL_DEBUG=all evolution >& evolution.log
three times had it crash with

First time:

DB SQL operation [BEGIN] started
Camel SQL Exec:
BEGIN
Camel SQL Exec:
COMMIT
DB Operation ended. Time Taken : 0.000060
###########
received: * LSUB (\HasNoChildren) "/" "INBOX"
received: B00005 OK Success
sending : B00006 LIST "" "*"
--> Segmentation fault

Second time:

===========
DB SQL operation [ATTACH DATABASE ':memory:' AS mem] started
Camel SQL Exec:
ATTACH DATABASE ':memory:' AS mem
POP3_STREAM_LINE (25): '-ERR unrecognized command'
DB Operation ended. Time Taken : 0.011516
###########

Database succesfully opened  

===========
DB SQL operation [ATTACH DATABASE ':memory:' AS mem] started
Camel SQL Exec:
ATTACH DATABASE ':memory:' AS mem
DB Operation ended. Time Taken : 0.010961
###########
**
GLib-GIO:ERROR:/tmp/buildd/glib2.0-2.30.2/./gio/gdbusmessage.c:1986:append_value_to_blob: assertion failed: (g_utf8_validate (v, -1, &end) && (end == v + len))
--> Segmentation fault

Third time:

===========
DB SQL operation [BEGIN] started
Camel SQL Exec:
BEGIN
Camel SQL Exec:
COMMIT
DB Operation ended. Time Taken : 0.000070
###########
sending : A00004 SELECT INBOX
--> Segmentation fault

strace:
I can't crash evolution with either strace or valgrind running. Now why is that?


Solution:
Downgrading. Which turns out to be more difficult than one would imagine.

UPDATE: Here's how to downgrade your drivers:
http://verahill.blogspot.com.au/2012/03/debian-testing-downgrading-nvidia.html

If you don't want to downgrade the nvidia drivers:
A temporary solution is, odd as it may seem, to use
strace -o evolution.log evolution
because it just refuses to crash. I don't know why, but it works. 

83. Configuring route for multiple network interfaces on Debian Testing

In my previous post I got rid of network-manager.

On my main desktop, which serves as a gateway for two subnets and serves them with access to the internet and has three ifs (eth0 goes to outside world, eth1 serves 192.168.0-127 and provides inet passthrough, eth2 serves 192.168.128-255), I had issues getting the internet connection to work once network-manager was gone -- the issue was the routing table.

Here's what I did to diagnose and solve it:

When I got rid of network manager I set up my /etc/network/interfaces like this:
auto lo
iface lo inet loopback
auto eth0

iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.1

auto eth2
iface eth2 inet static
address 192.168.1.129
netmask 255.255.255.128
gateway 192.168.1.129
But it gives
sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.129   0.0.0.0         UG    0      0        0 eth2
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
0.0.0.0         XXX.XXX.XXX.254 0.0.0.0         UG    0      0        0 eth0
XXX.XXX.XXX.0   0.0.0.0         255.255.248.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.1.128   0.0.0.0         255.255.255.128 U     0      0        0 eth2
The problem is that I DON'T want all traffic via eth2 and eth1. I want the default gateway to be my eth0. Inverting the order of the ifs in /etc/network/interfaces doesn't fix it either.

A quick fix is to do
 sudo route add default dev eth0
 which adds this as the first line:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 eth0
It looks like we might want to manually configure route.

Turns out you can just add the route options to your /etc/network/interfaces file

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.1

auto eth2
iface eth2 inet static
address 192.168.1.129
netmask 255.255.255.128
gateway 192.168.1.129

auto wlan0
iface wlan0 inet static
address 192.168.2.1
netmask 255.255.255.0
gateway 192.168.2.1

post-up ip route flush all
post-up route add default dev eth0
post-up route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 1000
post-up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 eth1
post-up route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.129 eth2
post-up route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1 wlan0

The script gives us a nice, compact routing table on doing
sudo service networking restart

sudo route -n
Kernel IP routing table Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 eth0 169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0 192.168.1.0     192.168.1.1     255.255.255.0   UG    0      0        0 eth1 192.168.1.128   192.168.1.129   255.255.255.128 UG    0      0        0 eth2

Edit::
An earlier version of this post used a separate script (see below). This works fine on boot. However, sudo service networking restart
does not invoke it -- so you may end up with a faulty route table. Thus, it is preferable to use the method above in which the route options are added to the end of /etc/network/interfaces

The following (below) is kept for posterity only:

We put the commands below into /etc/routing_table.sh:
#!/bin/sh
sudo ip route flush all
sudo route add default dev eth0
sudo route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 1000
sudo route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 eth1
sudo route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.129 eth2
exit 0
We change the atttributes:
sudo chmod o-rwx /etc/routing_table.sh
sudo chmod g-rwx /etc/routing_table.sh
sudo chmod u+rwx /etc/routing_table.sh
Here user is root. This way only root can execute and edit the table. I guess the 'sudo' is a bit superfluous in our script.
To make it start on boot, add a line to your /etc/rc.local
My rc.local now looks like this:
#!/bin/sh -e echo "1" > /proc/sys/net/ipv4/ip_forward sh /etc/firewall-rules.sh sh /etc/routing_table.sh exit 0
The firewall-rules.sh script is described in another post on ip tables.

27 February 2012

82. Getting rid of network-manager (and trying wicd) on Debian Testing

Network-manager is a fine program, but it interferes with the 'linux' way of doing things by using text files for configuration.

While network-manager makes it easy to do easy things,  /etc/network/interfaces makes it easy to do everything since it makes every setting transparent.

The main problem with remove network-manager is that gnome-core depends on it. Remove network-manager, everything in gnome goes. No good, and completely unnecessary.

I'm still a bit hesitant about configuring WPA on the command line, so I want to have wicd as a backup once network manager is gone.

--START HERE --
So
sudo apt-get install wicd-cli wicd-curses wicd-gtk wpasupplicant

Turn off network-manager (temporarily) and restart your network
sudo service networking restart && sudo service network-manager stop

Start wicd-gtk and configure your wireless network (if that's what you need) to make sure that everything is in working order and you can live without network-manager.

sudo apt-get install rcconf

sudo rcconf

Uncheck network-manager and exit.
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: network-manager start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: network-manager stop runlevel arguments (0 1 2 3 4 5 6) do not match LSB Default-Stop values (0 1 6)
You can use sysv-rc-conf instead.  Don't worry about the warning about the LSB default -start values -- (2 3 4 5) just means that by default network-manager should be running at runlevels 2-5 (i.e. normal operation). 0 would be halt, 1 would effectively be rescue mode ('single-user mode') and 6 is system reboot. Anyway, here's sysv-rc-conf:


After your next reboot you can check whether network-manager has started:

sudo service network-manager status
[sudo] password for me:
NetworkManager is not running ... failed!

You can make wicd-gtk autostart on starting gnome:
start gnome-sessions-manager and add wicd-gtk if it isn't /already/ there.



The wicd network manager icon will show up in the notification area in gnome (lower right) instead of top right (see picture above). You can supposedly use this to move it: http://blog.norida.me/blog/2011/12/05/move-wicds-icon-to-gnome-shells-status-bar-top-bar/

Given that I use Faenza I also use this: http://gnome-look.org/content/show.php/Faenza+Wicd+Iconset?content=133821
(unzip it, go to the directory and do sh install )


Anyway, the real advantage of wicd is hat there are cli and curses versions available e.g. wicd-curses:


Links to this post:
http://eulez.blogspot.com.es/2013/07/de-ubuntu-debian.html