Arkiv

Arkiv för ‘Ubuntu’ Kategori

Prepare Linux for source compile

augusti 11th, 2012 Inga kommentarer

1. Install packages to build the kernel modules

sudo apt-get install autoconf automake binutils make cpp gcc linux-headers-$(uname -r)

2. Find out where the kernel headers are (you may need this later)

ls -d /usr/src/linux-headers-$(uname -r)*/include

i.e. /usr/src/linux-headers-2.6.31-14-generic-pae/include

i.e. /lib/modules/2.6.31-14-generic-pae/build/include

3. Get the kernel source

sudo apt-get build-dep linux-image-$(uname -r)

sudo apt-get source linux-image-$(uname -r)

Categories: Bash, Linux, Programmering, Ubuntu Taggar:

A faster and safer Firefox experience

augusti 11th, 2012 Inga kommentarer

Here are a few tips to make your Mozilla Firefox experience faster, safer and more private. Most ”average” users might not bother with these, but the more discerning types will find them helpful.

1. Install the following Firefox extensions – NoScript, Ghostery, Adblock Plus, OptimizeGoogle.

2. Type ”about:config” (no quotes) in the address bar.

Toggle network.http.pipelining to ”true”.

Toggle network.http.proxy.pipelining to ”true”.

Then set integer value for network.http.pipelining.maxrequests to 40.

Right-click anywhere that’s blank on the page and then create a new item called ”nglayout.initialpaint.delay” and set its integer value to 0 (zero)

The Ghostery extension will allow you to selectively block hidden data-gathering activities such as traffic-ranking, click-throughs and such stuff like that, which can monitor what you do on the net. Some of that stuff is probably harmless but slows down your browsing experience during its data-gathering phase. The other extension recommendations are well-known as to what they do.

Categories: Ubuntu, Windows Taggar:

Installera Java 7 i Ubuntu x64

augusti 9th, 2012 Inga kommentarer

Install Java JRE in Ubuntu x64:

http://askubuntu.com/questions/56104/how-can-i-install-oracle-java-jre-7

Firefox Java plugin installation in Kubuntu x64:

1. Download Java from Oracle/Sun, unpack.

2. cd /usr/lib/mozilla/plugins

3. sudo ln -s /home/user/Downloads/jre1.6.0_29/lib/amd64/libnpjp2.so

Categories: Linux, Ubuntu Taggar:

Download gscan2pdf source and run

maj 9th, 2012 Inga kommentarer

THIS IS ONLY A DRAFT!!!

http://gscan2pdf.sourceforge.net/

Ladda ner koden:

cd ~/code
git clone git://gscan2pdf.git.sourceforge.net/gitroot/gscan2pdf/gscan2pdf

Skapa en länk så Perl hittar filerna:

sudo mkdir /usr/local/lib/perl
cd /usr/local/lib/perl
sudo ln -s /home/holm/code/gscan2pdf/lib 5.12.4

Starta programmet:

/home/holm/code/gscan2pdf/bin/gscan2pdf

// Tobias 2012-01-01

_____________________________________________________________

Install gscan2pdf from Ubuntu repositories to get most of the dependencies:

$ sudo apt-get install gscan2pdf git libsane-dev libcanberra-gtk-module

You might get the following packages when installing gscan2pdf:

Följande NYA paket kommer att installeras:
cuneiform cuneiform-common gocr gscan2pdf libconfig-general-perl libcuneiform0 libextutils-depends-perl libextutils-pkgconfig-perl libfont-ttf-perl libgoo-canvas-perl libgtk2-ex-podviewer-perl libgtk2-ex-simple-list-perl libgtk2-imageview-perl libgtkimageview0 libio-stringy-perl libjpeg-progs libjpeg-turbo-progs libleptonica liblog-log4perl-perl libpdf-api2-perl libproc-processtable-perl libreadonly-perl libset-intspan-perl libtesseract3 libtiff-tools libwebp2 perlmagick tesseract-ocr tesseract-ocr-eng tesseract-ocr-equ tesseract-ocr-osd

Download the source via git:

$ git clone git://gscan2pdf.git.sourceforge.net/gitroot/gscan2pdf/gscan2pdf

Enter the directory. If you try to run it you can get this error:

$ bin/gscan2pdf
 Can't locate Gscan2pdf/Document.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.12.4 /usr/local/share/perl/5.12.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.12 /usr/share/perl/5.12 /usr/local/lib/site_perl .) at bin/gscan2pdf line 121.                                      
 BEGIN failed--compilation aborted at bin/gscan2pdf line 121.

This is because the Perl script can’t find some libraries. To solve it, add the following at the top of bin/gscan2pdf:

# ADDED BY TOBIAS HOLM 2012-05-12 (TO FIND LIBS)
use lib "/home/holm/code/gscan2pdf/lib/";

This is another problem you can bump into:

$ bin/gscan2pdf
 Sane version 0.05 required--this is only version 0.03 at /etc/perl/Gscan2pdf/Scanner/Options.pm line 7.
 BEGIN failed--compilation aborted at /etc/perl/Gscan2pdf/Scanner/Options.pm line 7.
 Compilation failed in require at /etc/perl/Gscan2pdf/Document.pm line 7.
 BEGIN failed--compilation aborted at /etc/perl/Gscan2pdf/Document.pm line 7.
 Compilation failed in require at bin/gscan2pdf line 121.
 BEGIN failed--compilation aborted at bin/gscan2pdf line 121.

To fix it, download Sane version 0.05: https://metacpan.org/module/Sane

Enter the folder where you downloaded the files and try to install Sane:

$ perl Makefile.PL
 Perhaps you should add the directory containing `sane-backends.pc'
 to the PKG_CONFIG_PATH environment variable
 No package 'sane-backends' found at Makefile.PL line 21
 Writing Makefile for Sane
 Writing MYMETA.yml

Ops! Install sane-backends components:

$ sudo apt-get install libsane-dev

Now compile Sane:

$ perl Makefile.PL
$ make
$ make test
$ sudo make install

Enter gscan2pdf folder and run the program:

$ cd ../gscan2pdf
$ bin/gscan2pdf

This is another error:

$ bin/gscan2pdf 
Bareword "Gscan2pdf::_cancel_process" not allowed while "strict subs" in use at /etc/perl/Gscan2pdf/Document.pm line 595.
Compilation failed in require at bin/gscan2pdf line 54.
BEGIN failed--compilation aborted at bin/gscan2pdf line 54.

Fix it by manually cleaning up a previous installation of Gscan2pdf.

sudo apt-get remove gscan2pdf
sudo rm -rf /etc/perl/Gscan2pdf
Categories: Bash, Linux, Ubuntu Taggar:

Standard Client Ubuntu 10.10/11.04/11.10

maj 6th, 2011 Inga kommentarer

This is the steps I use to configure a new Ubuntu client:

  • Install Ubuntu from USB/CD/PXE

Then add the following programs in the Program Central:

  • Chromium
  • GIMP
  • gscan2pdf
  • PDF Editor
  • Thunderbird
  • Filezilla
  • KVpnc
  • Pidgin
  • Remmina
  • Wireshark
  • XChat IRC
  • Zenmap
  • tn5250
  • Audacity
  • Desktop recorder
  • GNOME MPlayer
  • ISO Master
  • VLC
  • MuseScore
  • OpenShot Video Editor
  • UNetbootin
  • Filelight
  • TrueCrypt
  • Wine + Spotify
  • apt-get packages to source compile ffmpeg

Install the following programs from different sources (Google 😉 )

sudo add-apt-repository ppa:dockbar-main/ppa
sudo apt-get update && sudo apt-get install dockbarx
sudo apt-get install dockbarx-themes-extra

  • Synergy (http://synergy-foss.org/download)
  • BankID (in 64-bit Linux: sudo apt-get install nspluginwrapper && sudo nspluginwrapper -i /usr/local/lib/personal/libplugins.so)

After this it’s time to restore my home folder from a backup.

Files to manually restore:

  • /etc/X11/xorg.conf
sudo nvidia-xconfig --post-tree --twinview

Ref: http://manpages.ubuntu.com/manpages/lucid/man1/alt-nvidia-current-xconfig.1.html

Configs to manually restore:

  • Compiz config, effects
  • X key bindings (Super+Up=Maximize vertically, Super=ScrClip)
  • Startup programs (Synergy)
  • add NAS to fstab
  • crontab (Backup once every hour to NAS + SD-card)
  • crontab for root (apt-get autoclean = free space in /var/cache/apt/archives)
  • Ubuntu One
  • Network printers (DeskJet 970, CLJ2600)

Add link support in Firefox for Second Life:

  • Type about:config in Firefox address field
  • Right-click any item in the list and select New > Boolean
  • Type: network.protocol-handler.external.secondlife
  • Set the value to true. This tells Firefox to use an external program to handle the secondlife:// protocol
  • Right-click any item in the list and select New > String
  • Type: network.protocol-handler.app.secondlife
  • Type the path to the program you want to use for that protocol (e.g. /home/holm/dump/SecondLife-i686-2.6.3.227447/secondlife )

Add the Q700 (TS-219P) printer: smb://nas/naspr2

To enable OpenShot x264 you must install unrestricted codecs:

Install support for CSS encrypted DVD movies:

  • sudo apt-get install libdvdread4
  • sudo /usr/share/doc/libdvdread4/install-css.sh
    Rebooting may be necessary.

Install Java plugin in Firefox (Kubuntu x64):

  • Download Java from Oracle/Sun, unpack bin-file (first set x-flag)
  • cd /usr/lib/mozilla/plugins
  • sudo ln -s /home/user/Downloads/jre1.6.0_29/lib/amd64/libnpjp2.so

If you have a folder with scripts you can add it to the path:

  • Edit the file ”~/.profile” and add the path.

Disable Overlay Scrollbars in Ubuntu Natty:

  • echo ”export LIBOVERLAY_SCROLLBAR=0” | sudo tee /etc/X11/Xsession.d/80overlayscrollbars> /dev/null
  • Or remove the whole package: sudo apt-get remove overlay-scrollbar

Restore debconf backup

According to section 6.4.9 (http://www.debian.org/doc/manuals/reference/ch-package.en.html#s-record) of the Debian Reference Manual (http://www.debian.org/doc/manuals/reference/), the following will save both the list of packages installed and their debconf configuration:

# dpkg –get-selections ”*” >myselections # or use \*
# debconf-get-selections > debconfsel.txt

and the following will reinstall and reconfigure them:

# dselect update
# debconf-set-selections < debconfsel.txt
# dpkg –set-selections <myselections
# apt-get -u dselect-upgrade # or dselect install

Categories: Linux, Ubuntu Taggar:

Synergy to control keyboard and mouse

april 14th, 2011 Inga kommentarer

Synergy is a very good program for sharing mouse and keyboard. It’s free and open source too! There are compiled versions for Windows / Linux and Mac.

Set up one computer as server and then control the mouse and keyboard on several others through the network.
To autostart the client on an Ubuntu after login, add a startup program and run the following script:
sh -c 'ps -A|grep -w synergyc; if [ $? -eq 0 ]; then echo KILLING; \
/usr/bin/killall -9 synergyc; fi; /usr/bin/synergyc YOURSERVERIP
You have to log in to the Ubuntu desktop first before you can control it from another computer. You can start the Synergy client before logon, but it’s a bit harder. In Ubuntu 10.10 with Gnome you can edit the following files to start the Synergy client before logon:
sudo gedit /etc/gdm/Init/Default
sudo gedit /etc/gdm/PostLogin/Default
Put the Synergy start script above in the first file (without the sh -c and quotation marks) and put just the kill code in the second file. See the Synergy home page for more info.

Ref: http://synergy-foss.org/

Categories: Bash, Linux, Ubuntu, Windows Taggar:

Tweak Ubuntu desktop

april 7th, 2011 Inga kommentarer

Some tips for tweaking the Ubuntu 10.10 desktop:

Install dockbarx

sudo add-apt-repository ppa:dockbar-main/ppa && sudo apt-get update && \
sudo apt-get install dockbarx && sudo killall gnome-panel

Then right click a Gnome panel, select ”Add to panel” and add DockBarX.

Compiz desktop

Enable the screenshot feature. Click ”Super”+Left mousebutton to get a screenshot.

Categories: Linux, Ubuntu Taggar:

Create folder thumbnails in Ubuntu

april 5th, 2011 Inga kommentarer

Cover thumbnailer is a small Python script which displays music album covers in nautilus, preview of pictures which are in a folder and more.

The script fits in nautilus like any other thumbnailer of the GNOME thumbnail factory; so you don’t have to run it manually to generate thumbnails.

Cover thumbnailer is free software under GNU GPL v3+ license, you are free to modify and redistribute it under the terms of the license.

Ref: http://software.flogisoft.com/cover-thumbnailer/en/

Categories: Linux, Ubuntu Taggar:

Convert a DMG image to IMG

mars 9th, 2011 Inga kommentarer

First, install ”dmg2img” through the Ubuntu programs. Next run the util:

user@computer$ dmg2img mac-image.dmg new-image.img


dmg2img v1.6.2 is derived from dmg2iso by vu1tur (to@vu1tur.eu.org)


mac-image.dmg --> new-image.img


reading property list, 1632063 bytes from address 6107371782 ...


decompressing:
opening partition 0 ...             100.00%  ok


Archive successfully decompressed as new-image.img


You should be able to mount the image [as root] by:


modprobe hfsplus
mount -t hfsplus -o loop new-image.img /mnt
Categories: Bash, Linux, Mac, Ubuntu Taggar:

Kom igång med SSH

januari 18th, 2011 Inga kommentarer

Lathund för att konfigurera SSH på en Ubuntuserver/klient: http://www.lathund.nu/2010/01/19/kom-igang-med-ssh/

Om du inte bryr dig om extra säkerhet kan du installera med följande kommando:

sudo apt-get install openssh-server
Categories: Ubuntu Taggar: