LinuxPlanet Blogs

By Linux Geeks, For Linux Geeks.

Archive for the ‘comand line’ Category

sc – command line spreadsheet

without comments

No surprise to folks who read my blog, I really dig on command line apps.  Well, after another visit to my favorite web based list for cli apps (thanks Jared Lee) and started to play with sc (available even in Lucid 10.04 repos).  This app is for command line spreadsheets.

Command line spreadsheets, well, yes.  I actually have a few use cases where a sqlite database would be way over the top but there is some math I would prefer not to do by hand.  That's what spreadsheets are good for.  sc comes to the rescue.

While I'll confess there is no easy import/export via csv or some other stuff, it is very versatile and does offer a text export which calculates the formulas and shows the layout as if you were using the app.  Let me show you a few quick shots.

First, using the app:


















Second,  the format of the file while being used by sc, bear in mind this is also clear text:

















Lastly, this is what the text export of the same document looks like:













I hope this might give you some ideas on how to use this quick, simple and easy to use program in your personal workflow.

--
CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Written by CafeNinja

June 29th, 2010 at 5:25 pm

Discovered Nugget – nmon

without comments

 I have to confess that I picked up on this little command line gem as a result of my subscription to a paper magazine.   Linux Magazine had a feature written by Charly Kühnast describing the application "nmon".

This app was a simple "sudo apt-get install nmon" away and was in my Ubuntu 10.04 repos with no further setting changes required.  The application does need to be run in a terminal.  It does not require root permissions and has a great many monitors that are available for viewing in both a real-time and a collection mode depending on how geek your statistic and performance needs are.

I have a screen shot here of the application running in a tall 1/2 wide screen with just a few (not all) of the monitors activated.



I was quite impressed with the monitors/sensors available and if I read correctly there is even a "plugin" system by which monitoring scripts might be plugged in to display monitors that are not predefined.

In my set up I have activated all except memory and processes and run the "htop" command in the a terminal adjacent which then shows almost all possible performance real-time data available in one manageable and comprehensible screen.

Enjoy this app and add it to your list of favorites to use while embracing the command line.

--
CafeNinja


Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Written by CafeNinja

June 1st, 2010 at 5:17 pm

Dnsmasq for your personal domain and access list needs

without comments

With the addition of the dnsmasq server to my LAN (preferably wired) based server, I am able to manage dhcp myself.  To what benefit you may ask, I'm glad you asked.  First is that I can actually set the IP of computers connecting to my network, and group as needed/preferred.  I can also use MAC address to authenticate, so hardware address filtering is not limited by small cheap routing equipment (I discovered a limit of 30 known hardware addresses to put in my wifi router).

So the most minor feature is that when I connect via ssh to my server from the internet back to home, I can use proper hostnames which I know will always resolve to those computers.  No more ssh'ing to one IP after another, just use the name of the computer and if connected will always work.

Simple "sudo apt-get install dnsmasq" and edit the dnsmasq.conf and hosts files.  It is heavy with comments in language which is moderately clear.  There are many guides on the open internet to follow if you have questions.  Turn it on for the safe host name resolution of your internal network.

--
CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Written by CafeNinja

May 3rd, 2010 at 12:25 pm

Posted in Linux,comand line

Mutt – the cool kid’s RC file

without comments

 I've gotten quite a few recent requests in regards to my muttrc file.  I blame notKlaatu for that.  For those who don't know, it's the file that sets all the preferences in the most awesome text based email reader, mutt.

So I'll keep the post short since the file speaks for itself.  It has comments in it.  As a disclaimer this one is being used with mutt 1.5.20 (2009-06-14) patched with the sidebar patch (see previous posts).

Get a zip of my Gmail prepared muttrc file here.

Enjoy everyone.  Tell your friends to come by and have a peek.

--
CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.


Written by CafeNinja

March 9th, 2010 at 6:34 am

Backup! Backup! Restore!

without comments

I'm sure many of my fans probably think that I only use the command line.  While true that I do use command line considerably.  I also use gui tools.  As I just set up yet another virtual machine in Virtual Box, I thougth I might explain how I add the world of text to gui.

So, I've written about my gpg encrypted password file.  I leave it in my dropbox account as well as a the gnupg.vim plugin.  Of course, dropbox is primarily a gui application, which has a command line element that can be used after the gui has been launched.  So the first thing I do is set that up my password file.  Then also from dropbox I have bashrc and bash_aliases.  I soft link those to the home directory as well as the bin/ folder where I dabble in scripting.

After my last install, I started making my list of apps that I install on my Ubuntu systems knowing they are in the repos.  Basically I just cat that file and paste and wait. 

While that's going, I get the firefox up and running where I add my xmarks extension and run it.   This brings by browser up to speed more or less.  Once my chromium is installed, I just have it import the settings from firefox (google chrome the same).  Again, that's a matter of a gui application that I do rely on and use on many different systems, even cross platform.

This puts me in very familiar teritory and within a short time after a fresh install, I have my bash shell restored with my comfort zone of aliases, my browser set up with bookmarks and the odds and ends that I keep in my Dropbox.   The single behaviour modification that I keep on is making sure that anything I "might need later" I put in my dropbox or my Ubuntu One (gui).  Included in that would be the most recent .deb for skype, google chrome beta, and anything else where just having it arrive in the dropbox/Ubuntu One sync keeps me from having to hunt it down online.

This kind of file syncing actually has made system restore or first set up quite easy.  I have done this a few times and now it feels quite "normal" and I have no worries at all if any one (or truth all) of my systems were to die, I could still recover in short order.  Working directly out of my backup system/service keeps me always on the spot should anything go wrong.

--
CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Written by CafeNinja

February 28th, 2010 at 4:16 pm

Jared Bernard – CLI user

without comments

 I heard on HPR episode a short talk given by Jared Bernard at the Utah Open source conference on his use of the command line.  I had absolutely no disagreement with what he said and was amazingly impressed with his list of command line application alternatives.

Really, this blog post is to promote Jared's site.  I think it's a great resource and found it educational if for nothing other than the list of CLI Applications.

If you would like to hear what he had to see please listen to HPR Eps 0518 "Live without a GUI" and visit his site.

Honestly, with the long list of applications he has listed there, I might be busy for quite a while reviewing the applications he has on the list.  Thanks Jared, and keep up the great work.

--
CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Written by CafeNinja

February 21st, 2010 at 10:31 am

Posted in Linux,comand line

Steganography – Some new fun

without comments

After reading an article in Linux Magazine, I've been playing with the steghide program available on most linux distros and popular repos.  I am quite impressed with this programs ability to insert quite a bit of information into an image or wav file.

The word steganography is of Greek origin and means "concealed writing" (citation wikipedia).  Really, as a word it is just describing covert messaging.  It offers no context in which it must occur or any kind of standard.  This technique is designed to put the message in a quite public place, kind of like the symbology clues you might have heard about in "The DaVinci Code".  The concept of security through obscurity is primary here.

The program recodes color codes in a jpg file to replace a shade of color with another and then uses the digit difference to insert the message.  The steghide program actually takes the image and the message and shuffles them together on the level of the data.  The receiver would NEED to know to look for the message since there is no visible indicator of a hidden message.

The application steghide is a command line tool.  There is a gui tool called steg-gui, but I didn't feel like compiling it, and since not in my repos I didn't use it yet.  So I won't offer any opinion of it here, maybe in the future if it can manage to be included in the repos.

As another example.  The image of Bettsy above, is also a steganograph.  Feel free to have a go and treat the image like a captcha.  After steghide is installed the following will produce the message that is this blog post, give it a try.

wget http://4.bp.blogspot.com/_G7rEKBT_L3s/S24IB-RIzFI/AAAAAAAAAUA/aIZAVsJLfeE/s320/steg-post.jpg && steghide --extract -sf steg-post.jpg



Enjoy,
--

CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Written by CafeNinja

February 6th, 2010 at 6:31 pm

Inx 1.1 review

without comments



After listening to TiT Radio Episode #15, I found the link that was suggested by Azimuth.  This is really, really cool if you want to get some serious command line goodness.

The distro is called inx 1.1  and it is based on ubuntu 8.04 LTS.  It is also only a live distro, currently there are no simple install methods.  There is a Virtualbox image that you can download and just run without any burning/rebooting/hacking involved.  I am going to request that any and all geeks who would like to see this project continue to send feedback to the project.  I think it's fantastic and think it would be a great idea for a meta-package to make sure all the cli/ncurses apps that are used in his menu scripts are there, and then have this as an option from gdm to boot into (saving even more resources).

I am VERY taken with this.  There are just enough tools to do 98% of what people do with their computers and brings it down to the lowest common denominator.  I'm going to be trying to send as much feedback as possible to try and help those guys prepare for a new release using 10.4 when it comes out since there have been some dramatic improvements in the package selection since 8.04 (like screen-profiles a.k.a byobu).  Here is an example of some of the cli goodness you get with this tiny and non-resouce intensive distro:



I will be following this distro closely as it will help me also to have multiple VM machines which actually have some applications in them and do more than reply to ping when testing network apps on my host and home network.  If you look close at that screenshot the RAM footprint was almost 50mb!  Again, that is loaded with apps that are useful if you only take some time to make yourself familiar with them.

Enjoy CLI Geeks, and even if you don't use the whole distro, dig in there and check you the apps that come with the distro to see what you can add your command line arsenal.

--
CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Written by CafeNinja

January 2nd, 2010 at 9:03 pm

Dropbox on a Headless Server

without comments


I know there are a few guides for Dropbox on a headless server.  I noticed that my experience wasn't 100% as advertised, so I wanted to post here on what my process was (repeated on 3 servers for accuracy)

First the requisites for this activity.  You must have a ssh account and my advice is to make sure you have the same disk space free on the server that you are using in your Dropbox account.  For the free version, that means 2Gb of disk space.

Next I need to install the application, this is done on the server account.  I had in all 3 cases to launch the "nautilus" application one time.  So I connect with the "ssh -X" for allowing X11 export over the connection.  Once connected the next thing was to get the dbcli.py script from the Dropbox Wiki.  On the server I used:
   wget http://dl.getdropbox.com/u/43645/dbcli.py
   chmod 755 dbcli.py
This gives the application in the home dir with executable permissions.  Now run the script with:
   python dbcli.py install     <--- mine was x86 the other is x86_64
This step will download the tarball and start to set things up.  Mine hung after it downloaded everything and put it in the right place.  I then escaped with ctrl+c.  I then launched nautilus with:
   nautilus
This brought up the view of the home folder and then the splash screen for setting up the Dropbox account.  I entered my account details and let the folder sync the first time.  Once done, I closed nautilus and disconnected from the server to forcefully break the 2nd Dropbox icon it put in my computer's systray.  I then reconnected WITHOUT x11 forwarding and launched the daemon in the background with:
  ./.dropbox-dist/dropboxd &
This should fire up the daemon to run in the background.   After that you can check the status of the daemon with the dbcli.py script with:
  python dbcli.py status
That should report "up to date" as long as it is running and healty.

You might need to restart the daemon if the server machine reboots.  But for my headless servers that doesn't happen very often.  I have seen this work perfectly with the syncing that Dropbox does and works just as expected and seen with any other desktop machine.  I really enjoy this idea since there is a disk space use limit built into the account.  Also, this provides a truely off-site backup storage to ensure against any disaster recovery issues.  So with my last post about using gpg to encrypt files and edit them, it means that even if the server security is compromised, they won't get any data from my files unless they have a supercomputer and 20 years :)

--
CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Written by CafeNinja

November 2nd, 2009 at 1:00 pm

vim + gpg + dropbox = secure passwords

without comments


Finally accomplished a multi-system synchronized encrypted password file.  Let me tell the short and then the long version.

The short version is
1.) gpg encrypt a text file
2.) store it in a shared dropbox folder
3.) add vim gnugpg plugin.

The long version of the story is that Dropbox has added a functionality to share a folder with other Dropbox users.  I have a Dropbox account for each operating system that I use (3).  So I can modify on one machine and it will get pushed to all the other machines.  I also found the dbcli.py script which lets me run dropbox on a headless machine.

I already have 2048 bit pgp keys created.  I used that key to encrypt a text file to myself.  The file I had was a text file that I was using to record my passwords.  With the command "gpg --encrypt filename"  will produce an encrypted copy with the *.gpg extension.  This new file I placed in the shared dropbox folder and created a symbolic link to it in my home directory.

Then after creating the folder ~/.vim/plugin and moving the gnupg.vim into that folder I was able to open and edit the gpg encrypted file after typing my passphase for the key.  This extension turns off the auto-backup feature of vim to prevent a clear text copy from being anywhere but ram.  Once writes to the file are made, it will re-synchronize with the other computers automatically.

With this new process I am able to view, search and edit my password file even on a mac (with vim and gpg installed).  Of note, I also have a Truecrypt volume in this same shared folder and once a month I do a plain text export into the hidden volume of a Trucrypt drive.  This allows me additional access even if I do not have the permissions to install all the needed components.

Now I can use strong secure and unique passwords for every online service I have.  I even took the opportunity to generate a few passwords and keep them in the password file directly in the case I needed to update a login without command line access to pwgen.

--
CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Written by CafeNinja

November 1st, 2009 at 7:16 am