Posts

Showing posts from May, 2012

Simple Bash Script to Reverse Your Name and Output it

Just a quick script to reverse some input, using Bash and the FOSS "rev" program. It's amazing how easy it is to manipulate things with Bash. I love it!


Bash script version:
#!/bin/bash
#Simple script to reverse an input name

echo "Enter your name";read 'myname'


echo "Your name spelled backwards is: $( echo $myname | rev )"

exit 0

One-liner version:
echo -n "what is your name?";read name;echo "$name" |rev

Or how about this more ridiculous example (one that doesn't use the "rev" program):
#!/bin/bash
#Simple script to reverse an input name


  echo -n "Enter your name:"
  read myname

  numChars=$(echo -n "$myname" |wc -c)
  revname=
  while [ $numChars -gt 0 ]
  do
      revname=$revname$(echo -n "$myname"|cut -b$numChars)
      numChars=$(expr $numChars - 1)

 done

echo "Your name spelled backwards is: $revname"

exit 0

Ridiculous one-liner version (one …

Simple Bash Script to Remove Clearcase Views (experimental)

Image
So I just wanted to take a minute to say how awesome GNU Bash is, and that you can do a great many things with it. One of those things you can do is run commands from the cross-platform-compatible(mostly) IBM Rational Clearcase cleartool.


Since I was working on cleaning up some old user views, I thought I'd just make a quick writeup on a script for helping with this task. I did it because I like writing scripts in Bash and I'm working (very often) to get better at it. Please note, the script is experimental, and just meant for tinkering purposes. That said, I can't be held responsible for any damage you do to your systems as a result of using this script.

The script takes a parameter of the username. The script will search for views that are owned by the username, and will de-register, de-tag them. As for deleting the actual files at the view path, that part is NOT done by this script. Instead, the script will record the server name and view path into a file named "V…

How to install FreeNX on Ubuntu 12.04 Precise Pangolin

Image
Ask anyone who knows me and they will tell you that I am a vocal (and perhaps tireless) advocate of FOSS/GNU/Linux. I loves me some FOSS and GNU/Linux and I really like to help others with it as well!

So after writing my post: How to install NX Free Edition on Ubuntu 12.04 Precise Pangolin, I will follow it up with a story about FOSS. In this post, I will guide you through some easy instructions for installing the GPL,FOSS NX server variant called FreeNX, and the FOSS "qtnx" client that is used to connect to the FreeNX server.

The main difference is that, unlike NX Free Edition, which is licensed as proprietary ( 2 connections limit), FreeNX and qtnx are completely Free Open Source Software (FOSS, GPL)! Sounds good right? It's music to my ears. Afterall, this FOSS/GNU/Linux stuff makes the Technical world go around for everyone.

Update 01/02/13: Want to try something easier? Simply install xrdp:1.) sudo apt-get install xrdp
2.) Add this to the ~ of the user you plan on…