Mnemovore

Musca/dzen2 tips and tricks – Part 1

leave a comment »

So you decided to give musca a go. Here are some stuff i use in my setup. I hope someone out there finds these useful.

One thing that musca lacks is a toolbar, but as the author suggests, dzen2 is a nice alternative. And guess what, he’s right.
dzen2 is so customizable that you ‘re to able to do nice magic with it. For example:

Why open a terminal to find your disk space or waste useful resources to have it displayed on conky?
Add sth like that in your .musca_start and you ll be able to call a new command named dfh to watch your disk space status.

alias dfh exec (echo Disk Usage; df -h ; sleep 4) | dzen2 -l 17 -fg white -bg grey10 -w 400 -fn '-*-dina-medium-r-normal-*-*-*-*-*-*-*-*-*' -e 'onstart=uncollapse' 

Weather conditions are vital for astro-sessions so having some extra info is practical too
e.g. for Greece using the weatherget application i have sth like this:

alias weatherget exec (echo Weather Report; weatherget -s GRXX0004 --metric ; sleep 4) | dzen2 -l 17 -fg white -bg grey10 -w 400 -fn '-*-dina-medium-r-normal-*-*-*-*-*-*-*-*-*' -e 'onstart=uncollapse'

At the time setting rules is not ready in musca. But guess what! Musca is so groovy that you can actually “emulate” such configuration. Example.. I want to have gimp start in stacked mode or in a preconfigured tiled layout.

alias g1mp exec gimp
hook on ^g1mp stack on

or
if gimpfoo is a layout that suits your tastes for gimp window placement

hook on ^g1mp load gimpfoo

So when pressing Mod+m and typing g1mp you’ll have gimp in stacked mode 😀

to be continued! 😀

Written by aperturefever

June 8, 2009 at 7:23 pm

Back to ol’ Xplanet

leave a comment »

One of my favorite eye candy programs from the past is xplanet (the other one is electricsheep :D). It works perfectly with almost all window managers and the final product is not only beautiful but also very informative. The documentation is pretty straight forward and easy to understand but i haven’t seen any configurations lying around in the web. Anyway i provide here my own along with a small (wannabe) guide for it. As of the images or scripts that were used for this, i’ll just provide the necessary links.

Lets assume that we got xplanet sources and have them installed and working. As the README suggests, i took the default configuration provided and xplanet and built upon it. The base configuration provides sth like this:

2009-05-08-162930_1280x800_scrot

Very nice huh? The default image provided is very nice but if you want to move a step forward or want sth with a bit more resolution you can get one of the monthly versions of Nasa’s Visible Earth.

The first 3 things that are missing from the image are, the moon, clouds, and finally background stars.

Well by default, all celestial objects of our solar system are loaded so you ll probably see it if you have xplanet refreshing every (eg 10 minutes) the problem is that moon is small and you ll likely see it rarely. So to watch the moon more ofter i added to my conf

[earth]
magnify 40
[moon]
magnify 10

A little bit more magnification to moon and it will look like a twin planet 😛

Next step is the clouds, which are explained pretty much in the main page. There are 2 scripts that are used to fetch the cloud image. Both will do the job, i just altered them a bit to get the 4096 version of the clouds and save them to my .xplanet dir to keep things tidy. The cloud images are updated every 3 hours so i just added the script to a cronjob with

0 */03 * * * /path/to/script/

If you’ve created a .xplanet dir to store your configuration just throw the image in and add

cloud_map=clouds_4096.jpg

to your xplanet.conf. If you prefer to store it in another folder eg. images in .xplanet just add

cloud_map=images/clouds_4096.jpg

Finally you need a nice background to complete the picture. According to documentation all you must do is to start xplanet with xplanet -config xplanet.conf -starmap /usr/share/xplanet/stars/BSC. I even used the commands that are suggested by the FAQ but it wasnt very nice. I found out that the provided solution is very nice if you set the -fov(field of view) option to eg 50. If you prefer this solution its a good idea to use the constellations marker file and start it by adding

marker_file=constellations
marker_file=brightStars

You can find it in /usr/share/xplanet/arcs/constellations.
This will draw all the constellations around and with brightStars you’ll get the names.
Personally i dont use the above method. I just got a nice star field from an image search, played a bit with its contrast and brightness and used it as a background with the -background option. I also changed the default earth and specular images with the ones found here and the result looks like this:

2009-05-08-175325_1280x800_scrot

Take a closer look at the marker_file option. With default supplied marker files you can add borders, coastlines, hamradio stations, capital names etc. You can also add information about volcanoes, storms, satellites and quakes using the Totalmarker binary. For example in my setup i have set a cron job that connects every hour to Norad and gets the appropriate tle files to mark the position and path of the requested satellites on the xplanet image.

0 */01 * * *  /path/.xplanet/Totalmarker -Norad

2009-05-08-201510_1280x800_scrot

Well all that info about earthquake and volcanoes and such its really nice but it gets pretty crowded so i prefer to keep track only of the satellites (ISS, HUBBLE, etc)

All the above is for earth alone. Its possible to view all planets of the solar system with the -body option and of course gather info for their artificial satellites and moons. In my setup i use the images provided by this site, which are very very nice and detailed. You can get my conf from the downloads page. To launch it and update it every 10minutes you can use the below command:
nice -n 19 xplanet -config ~/.xplanet/xplanet.conf -transparency -utclabel -background ~/.xplanet/starfield-1.jpg -wait 300 -hibernate 600

Another nice option here is -random 😉

2009-05-08-202751_1280x800_scrot

2009-05-08-202816_1280x800_scrot

Written by aperturefever

May 8, 2009 at 5:59 pm

Thou hast to backup ye data!

with one comment

Bored and tired of using plain cp/rsync to backup my data so i started looking around for a backup system that would do the job right. I played a bit with rsnapshot and dar but i found out that for a simple backup task of 2-3 computer systems its an overkill. Rsnapshot by the way is really really nice and very practical, and i think i ll use it again some time. Anyway i decided to make a little snippet that will arrange my files in date folders using rsync

folder=`date +%Y_%m_%d`
mkdir -p /backup/destination/$folder
rsync -avH  /folder/to/backup /backup/destination/$folder 
#rsync -avhe ssh /folder/to/backup user@remote:dir/
tar cfj /backup/destination/$folder.tar.bz2  /backup/destination/$folder

in conjunction with a daily cron job of 22:30 every day:
crontab -e

30 22  *  *  * /bin/rsync-bak.sh

Its a good idea to bzip the product of the above operation.. saves a lot of space. I like it.. works better than a simple cp -r or rsync -ahv

Written by aperturefever

April 14, 2009 at 11:51 am

Posted in Linux

Tagged with , , , , ,

ad hoc-ing around

leave a comment »

The past days i got a wireless adapter and setup an ad hoc network to be able to use some wireless devices. There’s still the matter of WEP vs WAP(2) thing but nevertheless with a good password you’re good to go in both cases. Also there’s the option to increase/decrease the signal strength so security is just a matter of usage.

Anyway, i made a small console script for WEP and a bit of configuration for WAP(wpa_supplicant) and :

#!/bin/bash
#
# TODO: Option to set signal strength
#
 
echo "Create Ad-Hoc Network"
echo "_____________________"
echo

INTERFACE="wlan0"

echo -n "Type prefered ESSID (e.g. My Network, Conan's home, etc): "
read ESSID
echo -n "Insert prefered Mode (e.g. ad-hoc, master, managed etc): "
read MODE
echo -n "Channel (e.g.auto, 3, etc)  : "
read CHANNEL
echo -n "Desired pass key : "
read KEY
echo -n "IP Address : "
read IP_ADDRESS
echo -n "Netmask : "
read NETMASK
echo

ifconfig $INTERFACE up
ifconfig $INTERFACE $IP_ADDRESS netmask $NETMASK
iwconfig $INTERFACE mode $MODE
iwconfig $INTERFACE essid $ESSID
iwconfig $INTERFACE channel $CHANNEL


echo "Setting up key passphrase.."
iwconfig $INTERFACE key $KEY

echo -n "Seems that all is good.."
echo -n "Press any key to continue..."
read

Yeah i know its very simple but it works for me 😛 If one of the steps fails you ll see an indication.

As for WPA i changed a bit my wpa_supplicant.conf to look like this:

ctrl_interface=/var/run/wpa_supplicant

# By default, only root (group 0) may use wpa_cli

ctrl_interface_group=0
eapol_version=1
ap_scan=2
fast_reauth=1

# WPA protected network, supply your own ESSID and WPAPSK here:
network={
#  scan_ssid=0
  ssid="CONAN-DUDE"
  mode=1
  proto=WPA2
  key_mgmt=WPA-PSK
  pairwise=CCMP TKIP
  group=CCMP TKIP #WEP104 WEP40
  psk="*****************************"
}

# Plaintext connection (no WPA, no IEEE 802.1X),
# nice for hotel/airport types of WiFi network.
network={
  key_mgmt=NONE
  priority=0
}

and just issued the below (in a script)

killall wpa_supplicant
ifconfig wlan0 down
ifconfig wlan0 up
iwconfig wlan0 essid "CONAN-DUDE" channel auto
iwconfig wlan0 mode ad-hoc
wpa_supplicant -D wext -iwlan0 -dd -Bw -c /etc/wpa_supplicant.conf
dhclient wlan0

I have the intel 3945 wireless adapter so wext is the option for it.
For testing i run
iwlist wlan0 scan

I still have a masochistic preference for wired networks though ;p

Written by aperturefever

April 14, 2009 at 10:29 am

Musca – A new tiling window manager

with 6 comments

Searching for something in freshmeat a couple of days ago, i stumbled upon a small tiling window manager named Musca. You’ll say “What? Another one? For what reason?”. Hey! Why not? Well we all know that the 3 kings are ratpoison, dwm and ion. All features that were first introduced by them made tiling window management what it is today. Now take all the features that you actually liked in all of them and implement them in something new. The result is Musca. Musca is a tiling window manager that is written from scratch in C and has many features including:

  • Extremely small (binary is 97Kb and zipped package 37Kb), light and elegant
  • Simple configuration via config.h (Yes it needs recompiling)
  • Manual window tiling, that means no restrictions on layout setups
  • Group management support, that means no pesky tagging but actual groups
  • Simple mouse tasking, following click to focus philosophy
  • Frame management is followed by color indication so you actually know in what mode your frames are.(ie the catch-all mode that forces all windows opened in a specific frame is green)
  • Musca has multiscreen support out of the box and can manage groups to screens automatically
  • Uses dmenu as requirement for windows,groups and wm management
  • No obstructive status bars, panels, and such but you can use one if you like (e.g. trayer,dzen2 etc)
  • It is named after a star constellation…Yes that’s a plus. 😀
  • A nice feature called unmanaged_windows ( remember remember 😀 ). That let’s you make musca ignore windows and not assign them in frames. 😉

I really like Musca. Its light, small and configurable. Its still in devel state but its very usable and i have put aside stumpwm for now.  I had all my key bindings configured in seconds and Musca’s engine/group management philosophy was like second nature since, i use ratpoison and stumpwm. 🙂

Musca is actively developed and created by Sean Pringle. His website can be found here where he hosts his projects and other fun stuff.

UPDATE: New version of Musca, as of 9th March, is out with a *TON* of features that simplifies a lot of stuff including

  • floating support (via stack Musca command)
  • Added new commands!
  • Layout saving..thats means ENDLESS CAPABILITIES!!
  • Musca now has an external command interface for client management
  • Now you can undo layouts 😀 No more accidental layout windows
  • External startup configuration file to configure your window manager
  • Its getting better and better each day!! 😀

UPDATE:  The post is a bit old of course. Musca is more mature now and has even more features 😀

A pic of musca running on my Slackware 12.2 Laptop

2009-03-09-190658_1280x800_scrot1

Written by aperturefever

March 7, 2009 at 11:53 am

Diy newtonian collimation tool

with 3 comments

This is a post about making a simple collimator for your newtonian/dobsonian telescope. I will not go through the process of telescope collimation which can be found in an excellent article, here. Its easy and it costs nothing. It might not be as cool as a laser collimator but it needs no battery and after some time and with experience you may be able to collimate your telescope perfectly. It’s a method that it already has been described in some forums and books but it harms none to be repeated.

All you need is a film can (tube length is not an issue) and a small knife or scissors. Open a small hole (3-4mm) to the center of cap’s can. It usually is marked already so you’ll not have to make any geometrical calculations for that. You also need to cut the bottom part of the cap. So why a film can? Because it has the diameter of an eyepiece (1 1/4in-3cm) so it fits nice on your focuser.

(Optional) If you want, theres an option to make your handmade collimator, cross haired. You ll be able to “target” the center of your mirror that way and you ll minimize the effort of collimation. Thats easy too! You just have to calculate the points of the circle where you ll place the threads. I have made a small drawing to show you the way. All you need to do is to draw circles of the same radius, centered in the perimeter of your main circle(film can). See the 4 x’s ? All you need to do, is to find the middle point of the distance between them(in pairs). There’s another way, like drawing more circles around until you have something like a starry cross in your circle(that’s easy too-if you want it just drop me a comment) but i was in a hurry and i made it as in the photo (took me some seconds to draw that). When you have found the magic spots just make 4 small cuts and place in them, 2 small pieces of thread.

Thats all! Just saved yourself 20-50 USD or euro. Soon, i ll upload full plans of a Cheshire collimation tool.

p2210363<

Written by aperturefever

February 21, 2009 at 3:33 pm

DIY Tripod balancer – Cheap, fast, practical and productive

leave a comment »

Today in the morning i went shopping down town. Being there i located an astronomy shop that i used to visit its website more of out of habit and to see how astronomy equipment is faring here.. I always thought that they try to keep up with all astronomy shops world wide and that they try to expand the astronomy idea to all ppl. Of course not. Most of its working stuff are very experienced sellers that were forced to study telescope mechanics (some), following the “aggressive selling” philosophy (which i hate), plus its prices are ridiculous. Being there, the salesman told me of a mechanism that kept the tripod sturdy and with no vibrations. Well, i asked for the price, and when i was told, i fled running and laughing. He was trying to sell me plastic tripod leg enhancements for 60 euro..(77 USD). To tell the truth i don’t know if that’s a cheap or expensive component, or if it does reduce THAT much, vibrations, but i would never buy something like that at a price i would normally buy a relatively cheap eyepiece.


What i do to my tripod?(I am a dobsonian lover but i still use my old trustful newtonian). Its plain physics and its lots of fun.
I took a half filled (with water..you can use it to water your plants later 😉 ) plastic bottle and made a small hole in the center of the cap. Then pass a piece of rope from the center of the cap and tie it under your tripod base holder and in between the tripod legs. Water will absorb vibrations through the rope and you will have a much stabler experience even in mild wind conditions. More $$ saved ^_^ .. must find that clave eyepieces now…

Written by aperturefever

February 21, 2009 at 1:53 pm