24 July 2017

Debian Fluxbox Setup (2017)

autologin w/ systemd:

ExecStart=-/sbin/agetty --autologin $USERNAME %I

02:00.0 Network controller: Broadcom Limited BCM43142 802.11b/g/n (rev 01)

$sudo apt-get install linux-image-$(uname -r|sed 's,[^-]*-[^-]*-,,') linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms

$ip addr show
1: lo ...
2: enp1s0: ...
    link/ether d4:be:d9:79:fd:01 ...
3: wlp2s0: ...
    link/ether 64:27:37:f8:d4:43...

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#allow-hotplug enp1s0
iface enp1s0 inet dhcp
# wifi
#allow-hotplug wlp2s0
iface wlp2s0 inet dhcp

wicd preferences:
Wireless interface: wlp2s0
Wired interface: enp1s0

ensure pulseaudio is removed and alsa-tools/alsa-utils are installed.
apt-get remove pulseadio
apt-get install alsa-tools alsa-utils

#Screen Brightness.  Will lower or raise brightness by 5%.
# had to install xbacklight and add the following to /etc/X11/xorg.conf:
Section "Device"
        Identifier  "Card0"
        Driver      "intel"
        Option      "Backlight"  "/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/"

apt-get install thunar thunar-volman
remove "Set as wallpaper" context menu item:
"The Thunar wallpaper plugin is compiled into the Debian standard Thunar (EDIT: libthunarx-2-0 in fact), and we don't want to have to compile our own version, just for a little thing like this. There is a fix though. Rename /usr/lib/{i386-linux-gnu,x86_64-linux-gnu}/thunarx-2/thunar-wallpaper-plugin.so and restart Thunar."

Mod1 Tab :NextWindow (workspace=[current]) !! FBCV13 !!
Mod1 Shift Tab :PrevWindow (workspace=[current]) !! FBCV13 !!
#Volume.  Will lower or raise volume by 5%.  The third key binding will toggle mute.
XF86AudioLowerVolume : Exec amixer sset Master,0 5%-
XF86AudioRaiseVolume : Exec amixer sset Master,0 5%+
XF86AudioMute : Exec amixer sset Master,0 toggle
XF86MonBrightnessUp : exec /usr/bin/xbacklight -inc 5
XF86MonBrightnessDown : exec /usr/bin/xbacklight -dec 5
Mod1 F4 :Close
Mod1 z :RootMenu
Mod1 Shift z :HideMenus
Mod1 x :exec /usr/bin/xterm
Control Shift n : exec /usr/bin/google-chrome --incognito

other software installed:
eye of mate (eom)

01 March 2015


IMG 2 SVG: Converting raster images to scalable vector graphics using the GNU Image Manipulation Program (GIMP) and Inkscape

Note: This tutorial assumes the user has a basic knowledge of computers. Including but not limited to image processing software (Photoshop, GIMP, etc.), the internet, downloading and handling files, installing software, and using a mouse. It is also assumed that GIMP, Inkscape and a web browser are already installed. A functional internet connection will be useful. Versions used include GIMP 2.8.14 and Inkscape 0.48.5 r10040 both from the Debian Linux testing repository, pulled on 01 March 2015. Ubuntu, Fedora, Centos, OpenSUSE, Redhat, OSX, and Windows all have packages/installers for GIMP and Inkscape. Your mileage may vary.
In this example I used a PNG from the wikipedia article on the Futurama character Bender, http://en.wikipedia.org/wiki/Bender_(Futurama)

Launch GIMP:
  1. File > Open [Figure 1]
  2. Colors > Desaturate (I typically use lightness, but use what works best for you)
    Note: GIMP only operates on the selected area. Using a selection area may be useful for getting different thresholds in various places in the image
  3. Colors > Threshold (you’ll have to play around to find the best values but auto does a good job of getting close most of the time) [Figure 2, Figure3]
  4. Image > Mode > Indexed (select “Black and White 1-bit palette” ) and “Remove unused colors” (default) [Figure 4]
  5. Remove any signature and unwanted artifacts (speckles, etc.). SVG conversion is difficult with such things or speckles in the image. You will see I have left some under Bender's cigar because they are intentional. [Figure 5, Figure 6]
  6. Ensure you have permission or legal right to remove signatures/watermarks or ensure they get placed in the final image after conversion. You may wish to cut and paste the signature into a new image for use later.
  7. Image > Zealous Crop ( I forgot this when making the walkthrough so my canvas sizes are a bit bigger, with more white space)
  8. Save in gimp xcf format (for easy changes later) and export to png format (File > Export As). I change the name so as not to overwrite the original “bender.png” becomes bender.xcf and “bender_clean.png”. When exporting there is no need to save background color, creation time, or transparent pixel color values. [Figure 7]
Launch InkScape:
  1. Open your file (File > Open > “Bender_clean.png”)
  2. Using the arrow tool select your object
  3. Path > Trace Bitmap
  4. On the Options tab [Figure 8]
    1. Disable suppress speckles
    2. Enable smooth corners @ 1.00
    3. Enable optimize paths @ 5.00
  5. On the Mode Tab [Figure 9]
    1. Select the colors radio button
    2. Set scans to 2
    3. Disable Smooth
    4. Enable Stack Scans
    5. Disable remove background
    6. Press Update on the Mode Tab
  6. Press OK. You now have a Vector Object on top of a Raster Object.
  7. Move the Vector Object aside (use the select tool if needed) [Figure 10] 
  8. Delete the Raster Object [Figure 11]
  9. Select the Vector Object
  10. Move the Vector Object to the home position using the X,Y coordinates in the toolbar [Figure 12]
  11. Save as an SVG (I typically save as a “Plane SVG (.SVG)” rather than an InkScape SVG if I’m going to be using this image anywhere other than in Inkscape (e.g. webpages, Adobe Illustrator, etc.)
  12. You can cut and paste the signature raster object from gimp directly into Inkscape if you need to. I copied the signature after desaturating but before converting from RGB to Black and White. [Figure 13]
  13. Don’t forget to save again if needed.
  14. ADVANCED TOPIC: ::INCOMPLETE:: If your going to color the image after word, The Inkscape fill bucket works similar to that of raster image programs but may leave a white ring between your outline and colors. The easiest (read maybe not the best) way to fix this is to break apart the vector paths.
    1. Select the Edit Node Tool
    2. Click on the outline vector object
    3. Path > Break Apart
    4. Select fill bucket tool
    5. Select fill color
    6. Click on empty area to fill

Figure 2 Figure 1 Figure 3 Figure 4 Figure 5 Figure 7 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13

04 September 2012

New CFI resources page

If you had my old CFI(I) resources page then you need to update your links. The old page is gone and the new page is located at cfi.burnclouds.net

Enjoy and safe flights.

18 July 2012

Debian Fluxbox Setup


The major install:

After running the installer (from cd/iso), login as root for the remainder of the install (unless instruced otherwise)
nano /etc/apt/sources

replace "main" at the end of each us.debian.org line with "main contrib non-free"
ie replace:
deb http://ftp.us.debian.org/debian testing main
deb-src http://ftp.us.debian.org/debian testing main

deb http://ftp.us.debian.org/debian testing main contrib non-free
deb-src http://ftp.us.debian.org/debian testing main contrib non-free

a basic apt sources file:
deb http://ftp.us.debian.org/debian wheezy main contrib non-free
deb-src http://ftp.us.debian.org/debian wheezy main contrib non-free

# testing-backports doesn't exist. Comment these line out if using "testing"
deb http://backports.debian.org/debian-backports wheezy-backports main contrib non-free
deb-src http://backports.debian.org/debian-backports wheezy-backports main contrib non-free

# testing-updates doesn't exist. Comment these line out if using "testing"
deb http://ftp.us.debian.org/debian wheezy-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian wheezy-updates main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free


APT will update for all translations available. Skipping unnecessary translations will make apt faster.[14]
This can be controlled using apt.conf[15].

Append the following to the bottom of /etc/apt/apt.conf.d/70debconf

Acquire::Languages { "environment"; "en"; "ta"; };

If apt-get update still gets translations for other languages, you may have to clear /var/lib/apt/lists as mentioned in [15] after which apt-get update will only pull the translations as configured in APT conf.
For more information check man apt.conf

Now run:
apt-get update -y
apt-get dist-upgrade -y
# Essentials
aptitude install bash-completion bzip2 gzip unzip zip xinit wget xutils fluxbox sudo vim xterm libreoffice chrony
# Images, Videos, Web Browsers
aptitude install feh gimp imagemagick vlc ffmpeg iceweasel
# Audio support
aptitude install alsa-utils alsa-tools alsa-tools-gui
# Printing services
aptitude install cups
# GUI Extras, fonts, spellchecker and more
aptitude install rox-filer default-jre myspell-en-us numlockx gnuplot gv
# exFat drivers for writing and reading exFat partitions (see KB955704 for windows XP) aptitude install exfat-fuse exfat-utils

# Fonts
aptitude install xfonts-utils ttf-mscorefonts-installer xfonts-terminus xfonts-scalable xfonts-encodings xfonts-base xfonts-mathml xfonts-nexus gsfont-x11 xfonts-100dpi-transcoded
# Extra codecs
aptitude install libavcodec-extra-53 libavdevice-extra-53 libavfilter-extra-2 libavformat-extra-53 libavutil-extra-51 libpostproc-extra-52 libswscale-extra-2
# Build essentials include this if you're going to be compiling and installing propitiatory drivers or custom software 

# aptitude install build-essentials linux-headers-`uname -r` 
# Laptop extras
setup your user account so you can use sudo
adduser YOUR-USER-NAME sudo

sudo ls

this should ask for your password then list the files in the current directory (this verifies sudo is working)

Install Apt-fast:

[1] Run:
apt-get install axel
mkdir ~/aptfast
cd ~/aptfast
wget https://raw.github.com/ilikenwf/apt-fast/master/README
wget https://raw.github.com/ilikenwf/apt-fast/master/apt-fast
wget https://raw.github.com/ilikenwf/apt-fast/master/apt-fast.comp
wget https://raw.github.com/ilikenwf/apt-fast/master/apt-fast.conf
nano ./apt-fast.conf # find the line corresponding to the axel download manager and uncomment it (remove the pound symbol)
cp ./apt-fast /usr/sbin/
chmod +x /usr/sbin/apt-fast
cp ./apt-fast.conf /etc
chown root /etc/apt-fast.conf
chown root /usr/sbin/apt-fast
cp ./apt-fast.comp /etc/bash_completion.d/apt-fast
chown root /etc/bash_completion.d/apt-fast
. /etc/bash_completion

Install vmware-tools (if a virtual machine):

[2] Start by doing:
aptitude install linux-headers-`uname -r` libx11-6 libx11-dev xorg libxtst6 psmisc build-essential ia32-libs ia32-libs-gtk

The Debian wiki mentions x-window-system and x-window-system-core but those packages are now provided by xorg. Now install the open-vm-tools packages:
aptitude install open-vm-tools open-vm-dkms open-vm-tools-dev open-vm-toolbox

We have to load the kernel modules via dkms (Dynamic kernel module support). To install required kernel modules.
The last number (20xx.xx.xx) is the module version, you can get this number by using:
aptitude show open-vm-tools #Look for version string (after the + sign) ignore anything after the date (20xx.xx.xx-12324.a32)
dkms add open-vm-tools/20xx.xx.xx
dkms build open-vm-tools/20xx.xx.xx
dkms install open-vm-tools/20xx.xx.xx

Run modinfo and verify that we have the required modules.
After the installation, try querying the vmware tools modules.
modinfo vmxnet
modinfo vmhgfs

Shut down the VM.

Map shares using VMware player settings. Start the VM. Now we should have VMware tools loaded.
ls /mnt/hgfs/ # returns a list of shared directories

Now we install vmware tools proper. vmware player should offer to download and mount the tools iso image.
mount /dev/sr0
cp /media/cdrom/VMwareT*tar.gz ~
cd ~
tar zxvf VMwareT*tar.gz
cd VMwareTools*

shutdown the VM and retart it.

try resizeing the VM window

if window re-sizing doesn't work[3][4]:
apt-get remove xserver-xorg-video-vmware
apt-get install xserver-xorg-video-vmware

Then log out and log back in again.

Install Chromium browser:

Choosing Chrome vs Chromium: see technical details at [16], and human-friendly details at [17].

aptitude install chromium-browser

You may wish to include[18][19]: flashplayer-nonfree, xpdf

Install Chrome:

Choosing Chrome vs Chromium: see technical details at [16], and human-friendly details at [17].
Start by adding this line to the file /etc/apt/sources:
deb http://dl.google.com/linux/chrome/deb/ stable main
Add the google chrome repository, install the google key and finally install Chrome.
nano /etc/apt/sources # addthis line: deb http://dl.google.com/linux/chrome/deb/ stable main
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
aptitude install google-chrome-stable
#use the beta channel if you want. skip the line above use the one below (comment/uncomment as necessary)
#aptitude install google-chrome-beta

Use your system:

start the x windows system and fluxbox

right click on the desktop go "terminal enulators" and select "xterm"
an new terminal window should appear.
do stuff.

Customize Fluxbox:

[6] This referece is great for learning how to customize your fluxbox
I prefer to manually edit these files. In the past the Fluxconf [7] utility has proved more trouble than it is worth.
try "nano ~/.fluxbox/menu" this is the file that defines the fluxbox menu you can add new programs here.
~/.fluxbox/startup defines programs that run when fluxbox starts
~/.fluxbox/init defines fluxbox initial parameters (background image command can be found here)
~/.fluxbox/fbkeys defines keybindings in fluxbox (alt-f4 to close, alt-x for a new terminal etc..)


[8]Add a line to sudoers so that members of the sudo group can halt the system (and do so from the fluxbox menu)
visudo #find the line that reads "%sudo ALL=(ALL) ALL" and add this just below
%sudo ALL= NOPASSWD: /bin/halt

Manually install fonts:

[9]Copy a TTF, OTF, or TTC font file to the directory /usr/local/share/fonts (for all users) or ~/.fonts (for a specific user).
A good place to start when loking for new fonts is [10]

fc-list - lists fonts
fc-cache -fv - rebuilds cached list of fonts

To view list of monospaced clint-side fonts (available from Xft, so it is possible to apply font hinting and antialiasing):

$ fc-list :spacing=mono

To view list of server-side (available directly from X server, so font hinting and antialiasing are not available) monospaced fonts:

$ xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-m*'
$ xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-c*'

You may find the following useful to change default font rendering:

$ dpkg-reconfigure fontconfig-config
$ dpkg-reconfigure fontconfig

APT Preferences and Pinning

[13] Add testing and/or unstable repositories to sources.list


nano /etc/apt/sources.list
# I start by duplicating all existing repos, but the following line should get you started

#### testing #########
deb http://ftp.us.debian.org/debian testing main contrib non-free

#### unstable #########
deb http://ftp.us.debian.org/debian unstable main contrib non-free

In this example, we're pulling from testing and unstable. You could, of course, modify this to pull from stable (or wheezy) as well.


nano /etc/apt/preferences
Package: *
Pin: release a=stable
Pin-Priority: 300

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

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

Package defaults to any, as specified by the asterisk. Pin specifies the release (testing and unstable). Pin-Priority specifies the priority level. 'apt-get' defaults to something along the lines of "highest package version wins". The above restructures this priority so that packages in testing are given a higher priority.
I use testing so i want stable to be low priority. If you are using stable or an named version (wheezy) then adjust the release and priorities to suit your needs.
be sure to run apt-get update after making modifications to APT config files.

Installing from unstable

there are two basic options. I usually go with the second one. apt-get install package-name/unstable apt-get -t unstable install package-name
The first will not attempt to upgrade any packages on your system, so if specific dependencies are not met, the install will fail. The second method will attempt to install/upgrade any dependencies. Of course, given the above example, 'apt-get' will ask you before proceeding.

E: Dynamic MMap ran out of room

You may find that you receive an error like the following:
E: Dynamic MMap ran out of room
E: Error occured while processing sqlite3 (NewPackage)
E: Problem with MergeList /var/lib/apt/lists/ftp.us.debian.org_debian_dists_wheezy_contrib_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.

This is caused because apt's cache is too small to handle all of the packages that are included with stable, testing, and unstable. This is also very easy to fix. Add the following line to /etc/apt/apt.conf
APT::Cache-Limit "8388608";

For Laptops

apt-get install wmbattery wmnd volumeicon xbacklight
Add to .fluxbox/startup:
wmbattery &
wmnd &
volumeicon &

In volume icon preferences (right click on the icon) set the hot keys XF86AudioMute, XF86AudioVolumeUp, XF86AudioVolumeDown. I also set Left Mouse to "Show Slider" There are lots of ways to control screen brightness. I had to google my specifics and use what I found online. Good Luck.

To make you screen brightness keys work use Xev to find the key codes for you backlight and add them to ~/.fluxbox/keys with a command like:
xbacklight -inc 10
This will increase your screen brightness by 10% each time its called. xbacklight -dec 10
Like wise this will decrease your screen brightness by 10% each time.
I now use "cbatticon" to replace wmbattery and xtrlock for locking my computer when i close the lid. The original source code didn't work for me. I ended stripping out a bunch of elements I didn't need. Unfortunatly I lost the source code changes I made and haven't had the time to re-create them.


 [1] https://github.com/ilikenwf/apt-fast
 [2] http://rjha94.blogspot.com/2012/05/vmware-tools-on-debian-wheezy-inside.html
 [3] http://communities.vmware.com/message/2045689#2045689
 [4] http://communities.vmware.com/message/1651366#1651366
 [5] removed
 [6] http://fluxbox.sourceforge.net/docs/en/newdoc.menuedit.php
 [7] http://maketecheasier.com/beginners-guide-to-fluxbox-configuration/2010/01/19
 [8] http://www.ducea.com/2006/06/18/linux-tips-password-usage-in-sudo-passwd-nopasswd/
 [9] http://wiki.debian.org/Fonts/
 [10] http://fonts.debian.net/
 [11] http://spf13.com/post/perfect-vimrc-vim-config-file
 [12] http://backports-master.debian.org/Instructions/
 [13] http://wiki.debian.org/AptPreferences
 [14] http://sathyz.wordpress.com/2011/12/22/apt-get-update-only-required-translations/
 [15] http://lists.debian.org/debian-user/2011/09/msg00059.html
 [16] http://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome
 [17] http://news.softpedia.com/news/Google-Chrome-vs-Chromium-Understanding-Stable-Beta-Dev-Releases-and-Version-No-140060.shtml
 [18] http://wiki.debian.org/PDF
 [19] http://wiki.debian.org/FlashPlayer
 [20] https://github.com/valr/cbatticon