Skip to the posts
Buffalo's neighborhood journals since 2003 🍀 Patrick Spicy Devil Logan🌭 Sahlen🥨 Weber Spank🥟 Pierogi🐸 Scaj🍺 Labatt Utica Pink Cherio❄️ Snow Murder

tinypliny’s journal

🏷️ linux

99 posts

Learning about linux by dissecting packages

·

What makes a flawless efficient productive system? What goes into all those small things that make sticking to one OS easier than the other? What is behind those simple little tricks that you get used to in one OS that helps you work so much more faster than in another new system?

I want a system that will just stay out of my way and not make me think about it. But to not force people to think about anything requires careful thought into what works in the background silently and smoothly. There is of course the universal kernel and the efficiency of code of all bits and pieces of software. But an easier and more non-technical "everyone" way to dissect why one distro offers better productivity than the other is to look at the packages.

I am going to take a look at Crunchbang's packages and list them so that I can understand why that distro comes close to being one of the most perfect distros I have worked on. As usual, the easiest way is to just dissect the hard work already done by the experts. Omns (or Grant Galbraith) in his omns project blog puts together Debian systems all the time and writes post-install scripts for them. I am just going to extract commands from these scripts and put them down here. The difference will be I want to write my own descriptions for each package, why they are essential to the system and what they bring to the table in terms of making that distro a bit more "intuitive", all based on my limited understanding of linux systems.

I guess the goal is to learn not by building linux from scratch but by pulling apart a system that works well. And since I am working backwards, I am hoping to go from the superficial layers to the deep, first looking at the packages that form and work with the graphical interface and immediate enduser functions going down to what comprises the system itself. I probably won't be done in one day or even one year, but hopefully, this will be a useful exercise in understanding a bit more about linux systems that are better than others.

From part II: XFCE 4.8 on Debian Squeeze


  1. Set Repositories

wget
mv /etc/apt/sources.list /etc/apt/sources.list.bak
cp sources.list /etc/apt/sources.list



I usually do:
sudo gedit /etc/apt/sources.list

So what is his sources list...
(% means commented out since the # means something else on (e:strip))
-- DEBIAN SQUEEZE
deb squeeze main contrib non-free
% deb-src squeeze main contrib non-free

-- DEBIAN SQUEEZE UPDATES
deb squeeze-updates main contrib non-free
% deb-src squeeze-updates main contrib non-free

-- DEBIAN TESTING
deb testing main contrib non-free
% deb-src testing main contrib non-free

-- DEBIAN UNSTABLE
deb unstable main contrib non-free
% deb-src unstable main contrib non-free

-- DEBIAN EXPERIMENTAL
% deb experimental main contrib non-free
% deb-src experimental main contrib non-free

-- MOZILLA
% deb squeeze-backports iceweasel-4.0

-- DEBIAN SECURITY
deb squeeze/updates main non-free
% deb-src squeeze/updates main non-free

-- DEBIAN MULTIMEDIA
deb stable main non-free

-- DEBIAN BACKPORTS
deb squeeze-backports main contrib non-free

So I don't like firefox. Never have. I have always been an Opera or currently a Chrome fan. The Mozilla-ice-weasel needs to go in my set up.
  1. Setting up preferences

wget
mv /etc/apt/preferences /etc/apt/preferences.bak
cp preferences /etc/apt/preferences



This is something I don't know about. Something called apt-pinning. Omns has done a post about it that I need to read about. For now these are the preferences in the file we just copied:

Package: *
Pin: release n=squeeze-backports
Pin-Priority: 1001

Package: *
Pin: release n=squeeze-updates
Pin-Priority: 950

Package: *
Pin: release n=squeeze
Pin-Priority: 900

Package: *
Pin: release n=stable
Pin-Priority: 800

Package: *
Pin: release a=testing
Pin-Priority: 700

Package: *
Pin: release a=unstable
Pin-Priority: 600

Package: *
Pin: release a=experimental
Pin-Priority: 200

  1. Add Keyrings
This is to prevent the system from whining about "uncertified" and "untrustworthy" sources.

wget
dpkg -i debian-multimedia-keyring_2010.12.26_all.deb



  1. Update Repositories and Upgrade packages

sudo apt-get update
sudo apt-get dist-upgrade



I have noticed that an upgrade always breaks stuff in Crunchbang Statler. Probably an indication that that exact package collection only works with some older Debian components and not with the newer updates. I still haven't learnt how to pinpoint the source of the break.

  1. Base packages and applications.
sudo apt-get install
xorg --> the graphical interface.
gksu --> launches programs in graphical interface
gdebi --> enables double-click *.deb and install ability
file-roller --> an unzip/unrar/untar utility (does not play well with evince)
% why do I need all the compression programs under the sun?
lha --> lzh archiver
lzop --> fast compression program
rzip --> compression program for large files
unalz --> De-archiver for .alz files
zoo --> zoo archive extractor
xz-utils --> XZ-format compression utilities
p7zip-full --> extract 7zip archives
alsa-base --> sound server. Maybe replace with pulseaudio
vlc --> video lan player
audacity --> audio player. vlc is fine really.
libdvdcss2 --> ?
lame --> mp3 codec
gimp --> high end graphics program similar to Photoshop
ttf-freefont --> better fonts rendering. Absolutely essential!
ttf-mscorefonts-installer --> M$shit fonts that are not so shit.
gcolor2 --> ?
agave --> ?
gedit --> The "linux notepad" I like so much!
fortunes --> ?
fortune-mod --> ? (I have read this is important as a notification machine but I am not really sure.)
gedit-plugins --> ? Not sure which plugins these are, the ons that bring along different code highlighting and syntax highlighting maybe. I just need some eye-popping bright ones that may not necessarily belong to R but make error-spotting easier.
evince --> pdf reader. ver 3.0 has annotation support but still ages behind wine + pdf xchange viewer.
gcalctool --> ? calculator?
iceweasel --> weasel I hate (firefox).
gftp -->?
xchat --> irc client. useful for naggy questions in realtime.
transmission-gtk --> torrent client.
wicd --> I think network manager is better in terms of offering a bigger variety of connections. 3G, VPN etc
cups --> something to do with the printer?
cups-pdf --> pdf printing?
system-config-printer --> ?
hpijs --> ?
hplip --> ?
dmz-cursor-theme --> ?
gtk2-engines-murrine -- ?
tango-icon-theme -- ? do I need this eye candy?
gnome-colors --> ?
bash-completion -- ?
screen -- ?
cowsay -- ?
figlet -- ?
scrot -- ?
whois -- ?
rpl -- ?
conky-all --> system monitor. Don´t need this as I only use the clock, that xfce can provide.
zenity -- ?
gparted --> partition disks. Do I really need this?
xfsprogs --> ?
reiserfsprogs --> ?
reiser4progs --> ?
jfsutils --> ?
synaptic --> package installer. Useful sometimes when you don't want to mess around with command line.
ttf-bitstream-vera --> font
ttf-dejavu --> font
ntfs-3g --> ?
pcmciautils --> ?
parcellite --> clipboard manager. I this messes up gnumeric.
fontconfig-config --> ?
libcairo2 --> ?
firmware-linux --> drivers but not sure which ones
firmware-iwlwifi --> I need to compile and install my dear realtek here, this won't help. Atleast not in the current kernel where my wireless has not been integrated.
libreoffice --> current openoffice avatar. I don't need all of it. Maybe only writer, impress and math
libreoffice-gtk --> ?libreoffice related

  1. Clean up downloaded packages

sudo apt-get clean


  1. Install Xfce 4.8

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get -t testing install
xfce4
xfdesktop4
xfce4-power-manager
xfce4-screenshooter
xfce4-notifyd
thunar
thunar-archive-plugin
thunar-media-tags-plugin
thunar-thumbnailers
gvfs-backends
gvfs-bin
gvfs-fuse
xfce4-mixer
xfburn
terminator


  1. Clean up downloaded packages

sudo apt-get clean
reboot



Hmm.. quite a few question marks I need to fill out there.

Netinstall debian with XFCE

·

With my continuing troubles and hiccups with Gnome 3 on Fedora 15, I am sorely tempted to migrate to this:
image
(From omnsproject blog: )

Clean and minimalist netinstall Debian with XFCE 4.8 featuring transparencies that work, highly non-technical customizable menus that can be shifted easily to the right side and most importantly, no unexplained freeze-ups and cursor changes right in the middle of a coding session which force me to reboot either RStudio or the system altogether. *sigh*

How do I get rid of the titlebar in Gnome 3?

·

When the title of the program is on the never-disappearing top panel and the title bar just has an [X] on it (that I seldom use), why do I even need a title bar? I have keyboard shortcuts for everything, there is no point in having a title bar anymore.
image

So the question is how do I get rid of all titlebars in Gnome 3? I want everything to be like Chrome - lean, minimal, without a title bar and only displaying content.

Top five gnome 3 annoyances

·

that I haven't figured out how to fix. (Solved whines are marked and in blue.)
  1. Hot corner and dock are on the left: I am RIGHT HANDED dammit. So are a majority of people in the world. Stop pandering to left-handers or give us a way to switch the damn things. I HATE it when menus are on the left.
  2. Gnome extensions are inconsistent and crash the shell often. I installed some gnome extensions to shift the dock and hot corner to the right but they are inconsistent in the sense that they may or may not work. Additionally, they crash the gnome shell one too many times for comfort. The better sounding extensions have to be installed manually from something called "git". I tried to follow these steps: Extensions But I am stuck on the compilation step because of not one but several errors that I can't make head or tail of...

    ./autogen.sh –prefix=$HOME/.local – enable-extensions=”dock”

  1. Brightness settings are NEVER remembered! I hate this too. I get it that ATI cards are not the general linux favorite but atleast debian and ubuntoid versions can remember basic settings every time you login even though the proprietary ridiculously screwed up driver is not installed.
  2. Chrome launches S.L.O.W. In debian and ubuntoid distros I used e4rat to prefetch applications I use the most so that they would start instantly. But here I can't install e4rat... or atleast I haven't figured out how to block fedora-readahead and install e4rat (because there is no rpm for it).
  3. Terminal and windows cannot be made transparent. This seriously makes me want to switch to xfce4 with debian where things just work AND look good. :/

On the surface, all of the gloss seems nifty and the ability to connect remotely to work is great but these annoyances persist. Worse is I don't know how to get around them so they keep getting under my skin.

Other low grade irritants include:
  • Nautilus. Yuckety yuck! Doesn't have a native way to launch in root view. Totally lacks the elegance and flexibility of Thunar. I miss Thunar a LOT whenever I am in file-browser view.
  • That top panel: I want it to autohide, dammit! Why should I need an extension to do this simple thing?
  • That top panel: I don't want all those icons on the right, I want them on the left or not at all. For example, I don't want the accessibility icon or the battery icon when its not charging. I have no way to remove those because right-clicking doesn't give me any customization options.
  • Clock: I don't want it bang in the middle. It's not helpful. I want it extreme right.
  • That top panel: I want to maximize windows over it without going into a full-screen F11 mode. That top panel is seriously a waste of screen estate.
  • And yes, why can't themes work properly in Gnome 3? I know it's new and all but I hate the clunkiness in general.
  • Fonts were miserable but I installed a different font-rendering engine and I am stuck in Verdana now, the only font that looks partway decent. Liberation Sans and Droid Sans still look like crap and give me a headache.



[SOLVED] Turns out the super/windows/meta key is reserved for bringing up the activities menu in Gnome 3. So you need to press it twice and hold it down before pressing any other alphabet keys (that make up the keyboard shortcut). This workaround will make a custom keyboard shortcut (involving the macro/super/windows key) work. (or don't use the macro/super/windows key for any custom shortcuts. Use the ctrl key instead). Source:
  • Keyboard shortcuts for applications: Don't work if set under system settings > keyboard > custom shortcuts. You can make as many shortcuts as you want but they won't work. What's the point?! I know you can hit the windows key and start typing but I really like shortcuts. I set the same shortcuts across all my workstations and OSes. Its so annoying that I have to type more and remember what applications are called to get to things in gnome 3. For eg. browsers are always win-z everywhere for me. Now, I need to type win-chro before the icon for chrome comes up and then click on it to launch it. Not cool.

Flash for Fedora 15 (64bit) in Chrome

·

Hey @paul, did you install the beta version of the flash player from the Adobe labs website here:

It's a tarball...

Update: The new beta from Adobe labs does work thanks to @paul's suggestions. Just untar the thing, navigate to the folder and run these commands:

sudo mkdir -p /opt/google/chrome/plugins
sudo cp libflashplayer.so /opt/google/chrome/plugins/

Reboot.



Compiling RTL8191SEvB Drivers on Fedora15

·

DID IT!

Many thanks go out to @paul and Andy Grimm from the Fedora Project who messaged me a few days back to say that RTL8191SEvB does work with Fedora15 and offered to help.

For those of you who are stuck with this odd-man-out driver from Realtek: RTL8191SEvB and are ruing the loss of your wireless networks on Fedora15, here's the step by step guide.

1. Download the RTL8191SE driver from Get both RTL8192SE and RTL8191SE-VA2 if you are doubtful of what to get.

2. Extract it to its own directory. Navigate to that directory using the terminal.


cd /directory_you_extracted_the_RTL8191SEvB_driver



3. Try running the make command once you are in the directory:

make



4. You will see this message:

make -C /lib/modules/2.6.38.6-26.rc1.fc15.x86_64/build M=~/Downloads/rtl_92ce_92se_92de_linux_mac80211_0003.0620.2011 modules
make: *** /lib/modules/2.6.38.6-26.rc1.fc15.x86_64/build: No such file or directory. Stop.
make: *** [all] Error 2



5. Note the number in bold: 2.6.38.6-26.rc1.fc15.x86_64. Append it behind the words "kernel-devel-" and key in this command in the terminal:

sudo yum install kernel-devel-2.6.38.6-26.rc1.fc15.x86_64

This will install the tools you need to compile the kernel.

6. Now in the terminal again, key in:

make


This will be followed by a ton of output and jargon mumbo-jumbo from the terminal. Once the cacophony quiets down type:

sudo make install



7. Reboot! Rejoice! Your wireless should be back.

I have finally realized that in the linux world, THIS all you need - a possibility of someone helping you out from the doldrums. If I wanted to go the roses-are-red/sky-is-blue-ad-nauseum rehash-famous-quotes route, I would say:

Making linux work = 78% dare-devilry + 22% possibility of help.

In praise of Fedora and Gnome 3.

·

I have switched!

Thanks to some super-human effort by @paul, I am finally on planet Fedora and being awed by Gnome 3.

How superawesome is it that you can just start keying in ANYTHING that comes to your mind and if its an application it comes up directly and if not, you can just hit the wiki or google button. It finally re-defines having internet at your fingertips. Now if the browser could simply BE my desktop, that would be the next step to having the net RIGHT there.

LOVING it completely! It is like I have stepped into the next century!

Now, if only I could make this blasted wireless card work and the skype camera brightness light up more and get this flash installed...

Greppetty Grep

·

Another set of commands I need to burn into my brain:

Find all files in the current directory that contain blah in their file names
  • ls |grep blah

Wildcards in grep: all files that start with a b and end in a g with ONLY one character in between
  • grep b.g file

The asterisk * in a grep command stands for repetition. .* means "repeat any character any number of times"
  • grep "b.*g" file

Escaping characters. Preceding backslashes either remove an implied special meaning from a character or add special meaning to a "non-special" character
  • grep 'hello\.gif' file

An expression consisting of a character followed by an escaped question mark matches one or zero instances of that character.
  • bugg\?y matches bugy , buggy but not bugggy

An expression surrounded by "escaped parentheses" is treated as a single character.
  • Fred\(eric\)\? Smith matches Fred Smith or Frederic Smith

Match a selection of characters, use []
  • [Hh]ello matches lines containing hello or Hello
  • [A-Ca-k] is the same as [ABCabcdefghijk]
  • [[:alpha:]] is the same as [a-zA-Z]
  • [[:upper:]] is the same as [A-Z]
  • [[:lower:]] is the same as [a-z]
  • [[:digit:]] is the same as [0-9]
  • [[:alnum:]] is the same as [0-9a-zA-Z]
  • [[:space:]] matches any white space including tabs

The [] may be used to search for non-matches. This is done by putting a carat ^ as the first character inside the square brackets.
  • grep "([^()]*)a"

matches (hello)a, (aksjdhaksj d ka)a But not
x=(y+2(x+1))a (I don't get this part, does it match (y+2(x+1))a?)

This matches phone numbers, possibly containing a dash or whitespace in the middle.
  • grep "[[:digit:]]\{3\}[ -]\?[[:digit:]]\{4\}" file

The $ character matches the end of the line. The ^ character matches the beginning of the line.
  • grep "^From.*mscharmi" /var/spool/mail/elflord
  • grep "^[[:space:]]*hello[[:space:]]*$" file

The expression consisting of two expressions seperated by the or operator \| matches lines containing either of those two expressions.
  • grep "I am a \(cat\|dog\)" matches lines containing the string "I am a cat" or the string "I am a dog"

The expression \n where n is a number, matches the contents of the n'th set of parentheses in the expression
"Mr \(dog\|cat\) came home to Mrs \1 and they went to visit Mr \(dog\|cat\) and Mrs \2 to discuss the meaning of life matches the respective dog/cat pairs

The following characters are considered special and need to be "escaped":
? \ . [ ] ^ $

A $ sign loses its meaning if characters follow it and the carat ^ loses its meaning if other characters precede it.

Square brackets behave a little differently. The rules for square brackets go as follows:
  1. A closing square bracket loses its special meaning if placed first in a list. for example []12] matches ] , 1, or 2.
  2. A dash - loses it's usual meaning inside lists if it is placed last.
  3. A carat ^ loses it's special meaning if it is not placed first
  4. Most special characters lose their meaning inside square brackets
  • grep "$HOME" file searches file for the name of your home directory, while
  • grep '$HOME' file searches for the string $HOME


Find with specific strings on filenames
  • find . -name "*.jpg"
  • find . -iname "*.jpg" #case insenstive version

Look for specific filetypes
  • find . -type d #directories
  • find . -type f #files
  • find . -type l #links (wth?)
  • find . -type s #sockets (wth?)

Find by size:
  • find ~/Movies/ -size +1024M

Find by last modified time (last 1 day)
  • find /etc/ -user root -mtime 1
Arguments
-atime: when the file was last accessed
-ctime: when the file's permissions were last changed
-mtime: when the file's data was last modified
-amin: when (in minutes) the file was last accessed
-cmin: when (in minutes) the file's permissions were last changed
-mmin: when (in minutes) the file's data was last modified

!
exclude everything that comes after this...

Collect files that are not owned by valid users and delete them
  • find / -nouser -print0 | xargs -0 rm

Clean the images off of your *nix desktop
  • find ~/Desktop -name "*.jpg" -o -name "*.gif" -o -name "*.png" -print0 | xargs -0 mv --target-directory ~/Pictures
  • The -print0 option terminates results with a null character instead of the default newline, making it cleaner and less likely to balk in many cases

Correct the permissions on your web directory
  • find /your/webdir/ -type d -print0 | xargs -0 chmod 755
  • find /your/webdir -type f | xargs chmod 644

Show a list of files in /etc that have been modified since last month
  • find /etc -mtime -30


Refs (~completely taken with gratitude from)

The TermKit Philosophy

·

I read with interest this nifty commentary by Steven Wittens on his extreme redesign of the concept of the bland linux terminal.

One of the Unix principles is nobly called "Least Surprise", but in practice, from having observed new Unix users, I think it often becomes "Maximum Confusion".


From:

And I can't help laughing. How true.

I would love this on my system. I think it's still in development (on not). It's SO confusing to find out what's good to install and what isn't on linux sometimes...


I also want the CLICompanion: But again, is there a Debian port? or isn't there? Who knows... See the confusion here? Basic questions like "Alright, can I install this application now?" grow into gargantuan complex flowcharts on linux. For eg. the simple question above can only be answered after ALL the following have been sorted.
  • What distro are you on?
  • What kernel are you on?
  • What architecture are you on?
  • What are the dependencies of the program you want?
  • What are the versions of these dependencies specific to the program you want to install?
  • Do you have the source repository of the versions of the dependencies that is best suited to the program in your sources.list?
  • Do you have an updated sources.list?

Fine then, you can install the program but... I can only give you the source code because I am SO open source. Here you go, my precious tarball lovingly gift-wrapped in some cryptic archival format for you: Sourcecodeblablaobscureversion000.tar.bz

Which leads to:
  • Can you compile this source code on your system?
  • What are the developer tools you need to compile the code?
  • What are the dependencies of the developer tools you need?
  • Are these dependencies in the repositories on your sources.list?
  • Do you have the requisite linux kernel headers (what the hell does that even mean?)
And finally, you compile the source into an executable binary and you are met with more challenges because some of the other dependencies can STILL be missing and you have go hunt all round the internet and repeat the above algorithm for each dependency.

God forbid, you find an easy way to do things on Linux. Because you see, the great Linus Torvalds didn't plan on the system being used and abused by novices and nobodies like you.