Difference between revisions of "Howto Ubuntu"

From DiLab
Jump to: navigation, search
(List all installed packages)
Line 167: Line 167:
dpkg --get-selections
dpkg --get-selections
More info at [http://ubuntuforums.org/showthread.php?t=261366 this link].
More info at [http://ubuntuforums.org/showthread.php?t=261366 this link].


==== Virtual CD from iso ====
mkdir cdiso
sudo mount cd.iso cdiso -o loop

Now cdiso is your virtual cd with the cd.iso image in it.

Revision as of 16:42, 3 June 2011

Notes about installing and setup of various apps and features in Ubuntu

  • Wine - run windows apps within linux

Other nice external links and howto-s

Edit Ubuntu Places menu bookmarks

Edit or remove old Places-bookmarks like this:

gedit ~/.gtk-bookmarks

Also, the volume icons on the desktop are removeable. Run gconf-editor and uncheck /apps/nautilus/desktop volumes_visible as needed.


Mount a remote volume over ssh (using sshfs)

sudo apt-get install sshfs
sudo adduser your-username fuse              (logout and login after this)

sudo mkdir /media/dir-name
sudo chown your-username /media/dir-name
sshfs example.com:/stuff /media/dir-name


Make an iso image from a CD

cat /dev/scd0 > mycd.iso

Mass search and replace in files (with sed)

for i in $(find . -type f); do sed 's/oldstring/newstring/g' $i > $i-tmp; mv $i $i-backup; mv $i-tmp $i; done

Mass file rename

Replace spaces with underscores in all file names of the directory. then rename *.JPG to *.jpg

rename 's/ /_/g' *
rename 's/.JPG/.jpg/g' *

DV/Firewire for Ubuntu

https://help.ubuntu.com/community/Firewire



Acroread on Ubuntu

The link.

Check the ports and apps listening on them

netstat -lnptu


Listing members of a group

I.e., the opposite to the command 'groups myuser'

sudo apt-get install members     [if needed]
members groupname


Custom autocomplete in Ubuntu

It is nice to use TAB key to autocomlete path for example, for a ls command in bash. It turns out, you can also autocomplete certain command arguments, e.g. apt-get inst<TAB> expands to apt-get install. Even better, you can define your own completion rules for other commands and applications.

Read more on "howto" here: part 1 and part 2


Create your own apt-get repositories

The link.

A short example:

Get the tools

sudo aptitude install dpkg-dev

Create the repository structure. You can use any other location accessible from the web.

cd ~/public_html
mkdir my-repository
cd my-repository
mkdir binary
mkdir source

Copy your deb packages to your repository

cp src/bzr_0.11-1.1_all.deb public_html/my-repository/binary/

Create a repository index

cd my-repository
dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz

Using the repository. Add these two lines into the /etc/apt/sources.list

deb http://example.com/~myuser/my-repository binary/
deb-src http://example.com/~myuser/my-repository source/

Optionally, add the security key. Read about it elsewhere...

Kill-ing a process for sure

The link.

In short, ways to kill in the order of fierceness:

ps aux | grep gaim
kill 1234
pkill gaim
sudo kill 1234
kill -1 1234
kill -2 1234
kill -9 1234
killall gaim
killall -9 gaim


How to merge PDF documents

Nice writeup was found here. You need to install pdftk, unless you have it already. Then use it like this to merge files 1,2 and 3 to a file merged.pdf.

sudo apt-get install pdftk
pdftk 1.pdf 2.pdf 3.pdf cat output merged.pdf


Howto make deb packages


How to restore Ubuntu Gnome panel

Say your kid deleted the menu panel. This restores default:

gconftool-2 --shutdown
rm -rf ~/.gconf/apps/panel
pkill gnome-panel


List all installed packages

dpkg --get-selections

More info at this link.


Virtual CD from iso

mkdir cdiso
sudo mount cd.iso cdiso -o loop

Now cdiso is your virtual cd with the cd.iso image in it.