Debian notes

From raju

Tips

cut csv file by field names

Use csvcut to cut a csv file by column names. The order of the columns in the output is as specified in the command.

    % cat foo.csv 
    num,letter,word,color
    1,a,apple,red
    2,m,mango,yellow
    3,g,grapes,green
    4,p,pomegranate,red
    
    % csvcut -c word,letter foo.csv
    word,letter
    apple,a
    mango,m
    grapes,g
    pomegranate,p
    

Use -C to exclude some columns

    % csvcut -C letter foo.csv     
    num,word,color
    1,apple,red
    2,mango,yellow
    3,grapes,green
    4,pomegranate,red
    
    % csvcut -C letter,color foo.csv
    num,word
    1,apple
    2,mango
    3,grapes
    4,pomegranate
    

csvcut is part of the python3-csvkit package.

tags | cut by column names, cut by fields

List files in a package

To list files in a package

% apt-file list zsh-dev

This works irrespective of whether the package is installed or not. If a package is already installed, you can use

% dpkg -L zsh-doc

but this will not work for non-installed packages

how can I help Debian


2014-09-19

To check for packages that are installed locally but are not part of the upcoming Jessie release

  1. apt-get install how-can-i-help
  2. how-can-i-help --old
  3. Look at packages listed under Packages removed from Debian 'testing' and Packages going to be removed from Debian 'testing'

Ref: http://www.lucas-nussbaum.net/blog/?p=837



Bugs suitable for newcomers - https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=newcomer

% how-can-i-help --old --show newcomer


status of installed applications

Objective: Find whether an application that matches a keyword and is currently installed is uptodate or upgradeable.

Solution: Use "apt-show-versions -r keyword". For example,

% apt-show-versions -r mouse
kmousetool:amd64/jessie 4:4.12.2-1 uptodate
mousetweaks:amd64/jessie 3.12.0-1 uptodate
xserver-xorg-input-mouse:amd64/jessie 1:1.9.0-1+b3 upgradeable to 1:1.9.1-1
xserver-xorg-input-vmmouse:amd64/jessie 1:13.0.0-1+b3 uptodate

recursively list package dependencies

Remove packages that match a regular expression

Taking a screenshot

Here are some ways

Take a snapshot of area selected by mouse after waiting for 2 seconds. If the output file already exists, it will be overwritten.

% sleep 2; import myimage.jpg

Take a snapshot of the entire monitor after waiting for 2 seconds. If the output file already exists, it will be overwritten.

% sleep 2; import -w root myimage.jpg

Press Print Screen button on the keyboard. For KDE users, this will bring up the ksnapshot program which is very good.

For gnome users http://tips.webdesign10.com/how-to-take-a-screenshot-with-ubuntu-linux lists many options.

uncategorized

random notes

 su-to-root -X -c [appname]

For example

 su-to-root -X -c synaptic

Usually, a screen with a brightness of 200 Lumen is sufficient to work comfortably. You can use a photometer to measure the brightness of the screen.

Change Nits to change the brightness of the monitor. For laptop's with Intel GPU's this can be done as follows.

// Change Nits. Number may change according to hardware
$echo 36 > /sys/class/backlight/intel_back/brightness

Ref:- http://meetings-archive.debian.net/pub/debian-meetings/2014/debconf14/webm/Power_Tuning_Linux_A_Case_Study.webm


Popularity

General information

In order to get the popularity of a single package, go to http://popcon.debian.org/ and enter the package name. For example entering fimport, I get https://qa.debian.org/popcon.php?package=fimport which shows the number of installations of r-cran-fimport package over time. Note that you need to know the source package name ahead of time in order to do this.

To compare popularity of two packages, go to https://qa.debian.org/popcon-graph.php . In the "Packages" field, enter the list of packages separated by ',' and hit go. So for example https://qa.debian.org/popcon-graph.php?packages=r-cran-fimport%2Cr-cran-fmultivar&show_installed=on&want_legend=on&want_ticks=on&from_date=&to_date=&hlght_date=&date_fmt=%25Y-%25m&beenhere=1 compares the installations of r-cran-fimport and r-cran-fmultivar packages.

Q. How can I find out if my machine is participating in popcon?

A. Check if there are logfiles

root@hogwarts:/var/log# ls -al popularity-contest*
-rw-r--r-- 1 root root 151459 Nov 10 07:41 popularity-contest
-rw-r--r-- 1 root root 151007 Nov  3 08:02 popularity-contest.0
-rw-r--r-- 1 root root  32666 Oct 27 08:00 popularity-contest.1.gz
-rw-r--r-- 1 root root  32629 Oct 20 11:19 popularity-contest.2.gz
-rw-r--r-- 1 root root  32955 Oct 13 08:02 popularity-contest.3.gz
-rw-r--r-- 1 root root  32926 Oct 13 00:20 popularity-contest.4.gz
-rw-r--r-- 1 root root  32854 Oct  6 07:48 popularity-contest.5.gz
-rw-r--r-- 1 root root  32799 Sep 29 08:06 popularity-contest.6.gz
-rw-r--r-- 1 root root  45921 Nov 10 07:41 popularity-contest.gpg

Q. Which patching system is popular to make debian packages?

A. 3.0 Quilt Ref:- http://www.lucas-nussbaum.net/blog/?p=891

packages and bugs

packages from old stable release

To search for installed packages that are part of the old stable release

First include the oldstable release in /etc/apt/sources.list and run apt-get update.

aptitude search '?narrow(?installed,?archive(oldstable), !?archive(stable) )'

You can also just do

aptitude search '?narrow(?installed,?archive(oldstable))'

in which case the results will include packages that have the same version number in both stable and oldstable. If the package is part of the current stable release may be it is worth keeping around. That is why it is better to make sure that they are not part of the current stable release.

Ref: https://lists.debian.org/debian-user/2014/11/msg00045.html

Browse packages and files

To browse the package list http://ftp.debian.org/debian/pool/main/z/zsh/

To browse the file list https://packages.debian.org/jessie/all/zsh-common/filelist

To download and examine the files

% wget http://ftp.debian.org/debian/pool/main/z/zsh/zsh_5.0.8-4.debian.tar.xz
% tar xJvf zsh_5.0.8-4.debian.tar.xz
% cd debian
% vim newuser.zshrc.recommended

Available security updates

To get a list of available security updates

aptitude -> Security Updates

Todo:- Have to find out how to do this via command line




Q. Which GPU am I using?
A. use "lspci | grep VGA". For example, this is what I have

rajulocal@hogwarts:~$ lspci | grep VGA
02:00.0 VGA compatible controller: NVIDIA Corporation G98 [Quadro NVS 295] (rev a1)


some printing protocols: AirPrint, Google cloud print, IPP, PCL



apt-mark showmanual | grep texlive



calibre - ebook manager, create ebooks, edit ebooks



which terminal emulator am I using? $ update-alternatives --display x-terminal-emulator



Selectively download upgrades to all the installed packages

Download upgrades to all the installed packages whose name contains perl

$ dpkg -l \*perl\* | grep ^ii | awk '{print $2}' | tr '\n' ' ' | xargs sudo apt-get install -y --download-only

Building from source

Instructions to build iceweasel from source - http://glandium.org/blog/?p=2977

Dummy

External links

Packages I have to experiment with

  1. finance - beancounter, smtm
  2. fslint - clean up filesystem lint. Includes a GUI.

Packaging

Articles to be read later

Useful articles