September 29, 2012

Nvidia on Linux mint 13

I own a Lenovo thinkpad W520 (well work owns it but I'm using it) it runs Linux mint 13 - mate with the latest generic-pae kernel. At writing (3.2.0-31). At work when my machine is docked I need support for multiple monitors, and for this I need the Nvidia drivers. Here's the recipe that worked for me.

reboot your machine hold the blue ThinkVantage key and go into the bios menu.

  1. Choose the nvidia graphis card. It's called discrete graphics in the display bios display menu item.
  2. Then disable the optimus os detection setting.
  3. save & exit

Once you're booted into the mate desktop and logged in, enable the xorg edgers ppa
There's a recipe in the link. Then, do a

# sudo aptitude install nvidia-current nvidia-setting

I rebooted, and had nvidia graphics for dual monitors, but there's no intel graphics saving when I'm undocked!

I tried a buncha stuff from various blogs and forums, but nothing worked for me except disabling the optimus setting in the bios. The nvidia module was inserted but not activated. There's a number of ways to look at your gfx loading to help you locate the error.

Checking if glx is running:
# glxinfo

Looking at info from the Xserver startup:
# egrep '\((EE|WW|NI)\)' /var/log/Xorg.0.log

Checking that the glx module is loaded:
# egrep -i 'glx|nvidia' /var/log/Xorg.0.log


Check the references for details: Nvidia-304.51 X-swat Changing driver dual gfx cards Xorg-wiki

September 20, 2012

VPN connection from Linuxmint 13

The default Mint 13 installation doesn't include the Cisco AnyConnection compatible client. This means that you'll need to install the network-manager-openconnect plug-in in your network manager.

#sudo aptitude install network-manager-openconnect

Once its done, restart the networkmanager with:

#sudo service network-manager restart

You'll now be able to select open connect from the networkm-anagers vnp menu. If the networkmanager is not shown in the panel you can run it with

#nm-applet &

Then click the network connection icon oon your panel, and select VPN connections > configure VPN

In the network connections window select the +add button, and select Cisco AnyConnect Compatible VPN option.

Fill in your credentials and server name/ip in the edit VPN connection window, and name your connection to what ever you'd like. When you're done save it.

To use your new VPC connection, click the network icon on your panel, and select vpn connections and select your freshly baked connection.

In the connect window, click the hostname/ip address and then click the connection button. Wait .... and fill in your user/passwd when you're asked to.

You'll see a small lock on-top of your network icon once your connection is established.


Rolling debs

Rolling a Debian package from a single control file: equivs
Setting up a local test repository
Hardcore packaging

September 19, 2012

Mozilla using mem as cache

There's two options: browser mem cache vs Ramdisk

Citrix & openmotif on mint13

I need the citrix reciever to look at some work related stuff but the citrix client doesn't work out of the box if you don't have the openmotif library installed, since  Citrix depend on this lib.

sudo aptitude install libopenmotif4

That's all you need. You can get the Citric client here or through aptitude 

Updating ant tools.jar not found

Turns out, the openjdk-6 that comes installed on Linuxmint contains an error that causes ant to bitch bout a missing tools.jar file! Luckily this file is shipped with openjdk-7 ;)


Basically you'll need to installs openjdk-7 and then update the alternatives

sudo aptitude install openjdk-7
sudo update-alternatives --config java

select openjk-7 option and then remove the old java stuff

sudo aptitude remove openjdk-6


Refs:
https://help.ubuntu.com/community/Java
http://ubuntuforums.org/showthread.php?t=1977619

September 12, 2012

Send tab url

Did you ever try to browse for work related stuff on your on machine? I did and often did I copy each tab into my gmail account to send em to work.

But now I installed the send tab url add on to firefox and voila .... One click and all my tabs got work ;)

There's a bunca stuff to help your productivity with firefox on mint! like: Installing firefox, Ridding the mint search & 10 extentions.



August 30, 2012

Using UML for documentation? Here's a small and great quick guide

April 03, 2012

Instruments

http://www.earslap.com/projectslab/otomata

March 30, 2012

Creating a live distribution from your installation

There where my 3 references, they are there because I needed to create a new kernel for the Asus machine, It uses the inttel GMA500 chipset and therefore it must have build in KMS to get the correct framebuffer set.

I still build my kernels using the oldschool method!

Custom distro from your installation. Remember to remove all th eimages and crap you don't want to distribute.

Once you have your live distribution, you can use this strategy to update it.

March 02, 2012

Using Adobe Air on new linux distributions?

Whoa, if you really wanna feel the suck, this is where you need to go. There's no longer support for Air on Linux (or android) from adobe :(

So, if you're stuck with a bunca flashaholics, blinded by the virtual machine. A boss that insists this is the technology (Since it's blameable), be sure to wget the contents before the documentation disappear as well.

On Debian based systems: sudo aptitude install adobeair does the installation trick! At least for now. If not, here's an adobeair 2.6 package for your needs.


Rreferences:
help.adobe
air.administrators.guide

February 29, 2012

asciidoc

Today, I finally realized it's so much better to write documentation using asciidoc

asciidoc cheat sheet
Adding filters

We're using the program to traverse a build and collect readme files that then serves as different sections of a document. This has the documentation as close to source code as possible. That is a clear advantage. Also we can run scripts from inside the documents that ensure the latest version of the documentation is used.

Asciidoc ROCKs!!!! In a way Metallica can't even imagine!!!

February 17, 2012

Linux mint 12 configuration

There's a bloat of new stuff in Mint 12, mostly related to gnome 3 update ;) This helped me getting through the update.

Tips and tricks


Loads of stuff:


Only thing I didn't respolve yet is my iPhone :(

November 23, 2011

placing your local source under svn

http://maverick.inria.fr/~Xavier.Decoret/resources/svn/index.html

October 16, 2011

ftpfs to your website!?!

I always hated updating my website ;( Don't like the Hosting's website tool as it only works on the platform I don't use. And ftp'ing is just not 2100 century. Then I stumbeled on curlftpfs, it's old but good news.


#sudo apt-get install curlftpfs
#sudo nano /etc/fuse.conf

uncomment user_allow_other

#mkdir mountpoint
#curlftpfs -o allow_other ftp://user:pass@ftp.somewhere.org mountpoint/

Now you can do normal file commands in the mountpoint, Like editing in emacs and storing the files directly.

July 06, 2011

find command revisited

Finding empty directories and deleting them:
# find /path -depth -type d -empty -exec rm -r {} \;

Finding all gcc coverage files and removing them
find . -name '*gcno' -o -name '*.gcda' -exec rm -f {} \;

Great find command page.

Configuring Ubuntu 11.04 to run with the highest VGA resolution on i915

After the i915 configuration my screens did not use the 1920x1080 resolution that my monitor is capable of. Neither did it select VGA1 as input :(

# xrandr
reports LVDS1 at 1280x1024 as default display, editing my xorg.conf didn't seem ti fix the issue? Guess I edited it wrong!

There's two tweaks that need to be created, firstly I disabled LVDS1 and forced VGA1 as the default video device at boot Append:
video=LVDS-1:d video=VGA-1:e
to your kernel boot parameters in /etc/default/grub


Mine looks like this now:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=LVDS-1:d video=VGA-1:e acpi=force elevator=noop i8042.noloop=1 usbhid.quirks=0xeef:0x1:0x40"

Next, force gdm to use the resolution at login, by adding:

xrandr --output VGA1 --mode1920x1080 --rate 60

to  /etc/gdm/Init/Default

The xrandr command does ofcource depend on your monitor and graphics device. You cn alwasy type xrandr to see it's capabilities. See man xrandr for details.

July 04, 2011

Configuring Ubuntu 11.04 with kernel 2.6.38 for intel 945 & egalax Touch screen

Got a small customized PC at work that needs to have both the eGalax touch screen and the intel i915 (i945GM) driver enabled. From out of the box the screen is booting with the vesa driver, quirkint it to use the intle driver just gave a plain blank screen. The eGalax touchpad didn't send any signals so that was a pretty sucky start.

There's a lot of discussion about what's wrong etc, how to configure both the kernel and the system. I googled the web for answers and there was a lot of noise, in all this noice i found the following posts quite helpfull. They're good backgound information if your're interested.

Bug report - Kernel Mode Setting - debian - Kernel Mode Setting - ubuntu - Xorg-edgers - Intel drivers - i915 Kernel configuration database

This is how I configured the box to work with both.

Fetching the Xorg-Edgers PPA:
You need to get the Xorg-edgers added to your ubuntu package list, the link has instrunctions on how to set up this ppa.

Then you'll have to update your system

#sudo apt-get update
#sudo apt-get upgrade

Should do the trick, you can add the xserver-xorg packages needed by hand if there'ssomething missing.

Configuring the kernel:

The eGalax touch screen is build into the kernel this is se by selecting: CONFIG_HID_EGALAX=y

The i915 driver is a bit more tricky, as there are some things that, apparently, depend on acpi. There are some things like kms, which for never kernels (2.6.36 i believe??) automatically enable kms for the intle, radeon and ati gfx cards.

I tried a number of different approaches, using the trial and error method, before i found a reasnoable configuration. As for the graphics configuration you'll have to add the following flags:

CONFIG_ACPI_VIDEO=y
CONFIG_VIDEO_CAPTURE_DRIVERS=y
CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
CONFIG_VIDEO_SAA7134_RC=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
CONFIG_VIDEO_CX231XX_RC=y
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
CONFIG_VGASTATE=y
CONFIG_VIDEO_OUTPUT_CONTROL=y
CONFIG_FB=y
CONFIG_FB_BOOT_VESA_SUPPORT=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y
CONFIG_VGA_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_DRM=y


For some reason, i don't know why, the i915 is not selected but the menuconfig or makeoldconfig option will generate new configuration for the experimental intel drivers that over look the i915 stuff.  So you'll have to append the .config file with these three options to get the correct intel driver build into the kernel.

CONFIG_DRM_KMS_HELPER=y
CONFIG_DRM_I915=y
CONFIG_DRM_I915_KMS=y


I removed CONFIG_FB_VESA and CONFIG_FB_VGA16 to avoid issues with conflicting framebuffers in Xorg. See  Kernel Mode Setting - debian for details. You can check all the dependency flags from CONFIG_DRM_I915 in the kernel configuration database if you're interested.

Building the kernel & installing the kernel:
kernel building help


#sudo fakeroot make-kpkg --append-to-version= kernel_image
#sudo dpkd -i ../linux-image..deb

Configurating the boot options:

Once kernel is ready you'll have to setup the system, to use it correctly. You'll have to add the i915 kms selection option to /etc/modprobe.d simply add a file called i915-kms.conf containing:

options i915 modeset=1

Then edit the grub configuration to get both eGalax and i915 to work, if you have other options to the GRUB_CMDLINE_LINUX_DEFAULT flag append these:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force elevator=noop i8042.noloop=1 usbhid.quirks=0xeef:0x1:0x40"

i915 kms depend on acpi, that why it is forced. The elavator=noop and i8042.noloop=1 and usnhid.quirks=0xeef:0x1:0x40 are all options for the eGalax touch screen. The quiet and splash are options to get a linux splash logo at boot and quiet boot.

dont forget to update grup with these new settings

#sudo update-grub

Adding policy file for the eGalax touch screen:

I added an evtouch.fdi file to the hal layer, this file contains thesetup for the touch screen. It is placed in:
/etc/hal/fdi/policy/evtouch.fdi

And it's contents are: evtouch.fdi
<?xml version="1.0" encoding="UTF-8" ?>
<deviceinfo version="0.2">
<device>
<match key="info.product" contains="eGalax Inc. USB TouchController">
<merge key="input.x11_driver" type="string">evtouch</merge>
<merge key="input.x11_options.ReportingMode" type="string">Raw</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">false</merge>
<merge key="input.x11_options.Emulate3Timeout" type="string">1</merge>
<merge key="input.x11_options.SendCoreEvents" type="string">On</merge>
<merge key="input.x11_options.MinX" type="string">0</merge>
<merge key="input.x11_options.MinY" type="string">2</merge>
<merge key="input.x11_options.MaxX" type="string">4096</merge>
<merge key="input.x11_options.MaxY" type="string">4096</merge>
</match>
</device>


Configuring Xorg:
Finally you'll need to modify the Xorg.conf file. As ubuntu doesent have one pr default you'll have to generate it.Go to a non graphical login and use Xorg to generate the config file.

#sudo service gdm stop
#sudo Xorg -configure

will create a xorg.conf.new file in your current directory. it may be a good idea to wait with the file generation until you have booted your system with the new kernel. There may be a risk that the generation will fail because Xorg cant load the i915 driver.

Once you have the configuration ready you'll need to copy it to the /etc/X11/ directory and name it xorg.conf

#sudo cp xorg.conf.new /etc/X11/xorg.conf
#sudo service gdm start

Calibrating the touch screen:
Then you should calibrate the eGalax touch pad, you can install the touchscreen calibration application with apt-get. There's a lot of very good information here.

#sudo apt-get install xinput_calibrator

You'll get a menu item in System | Administration | calibrate touch screen
Simply run it and follow the instructions.

I copied my calibration to a file called: 99-calibration.conf it contains:

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "eGalax Inc. USB TouchController"
        Option  "Calibration"   "192 3874 476 3636"
        Option  "SwapAxes"      "1"
EndSection

You may not need the SwapAxes flag, but mine where defenately swapped. I still cant the get the compiz_check script to run on my machine but Unity and the compiz window manager are both running with a resolution of 1280x1024.

My configuration files are available here: xorg.conf 99-calibration.conf i915-kms.conf grub evtouch.fdi

December 16, 2010

Running iTunes on LinuxMint

Check your wine setup:

#dpkg -l | grep wine | awk '{ print $2, " ",$3}'
 
wine   1.0.1-0ubuntu8
wine1.2   1.1.31-0ubuntu3
wine1.2-gecko   1.0.0-0ubuntu3

Install wine 1.2 and the iTunes version 10 (i took the latest from the iTunes.com) website. This worked out of the box. I still have to test iPhone connection.

The iPhone connection can be setup doing this. Using http://www.libimobiledevice.org/

October 20, 2010

Linux command line stuff

Finding number of files in a folder:
find . -type f | wc -l

Finding number of subfolders in a folder:
find . -type d | wc -l


All taken from here

Creating 1 pdf from multiple images:

cd FOLDER_WITH_IMAGES
FILES=$(ls *jpg)
mkdir temp && cd temp
for file in $FILES; do BASE=$(echo $file | sed 's/.jpg//g'); convert ../$BASE.jpg $BASE.pdf; done &&
pdftk *pdf cat output ../FINAL_NAME.pdf &&
cd ..
rm -rf temp

All taken from here