Bash Script Beautifier

2010-12-23 1 min read Bash Learning Linux
Bash (Unix shell)
  <dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">
    Image via <a href="http://en.wikipedia.org/wiki/File:Bash-org.png">Wikipedia</a>
  </dd>
</dl>

Today I was working on a bash script written by someone else. And the script was maintained since long and had actually become quite big and there was no indentation followed. So, you can understand how difficult it was to understand the script. So, I set my foot forth to first find a beautifier for the bash script before I fixed it and my search ended here.

Continue reading

6 Good Web-Based FTP Clients For When You Are On The Road

2010-12-21 6 min read Linux
Image representing MakeUseOf as depicted in Cr...
  <dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">
    Image via <a href="http://www.crunchbase.com">CrunchBase</a>
  </dd>
</dl>

6 Good Web-Based FTP Clients For When You Are On The Road ftp clientsMost of the time, when you need to transfer files to your web hosting account or any other remote server, you might be at home on your laptop where you’ve got your favorite desktop FTP client installed. However, when you’re on the road or using a friend’s computer, a desktop FTP client may not be available.

Continue reading

Take a screenshot of the window the user clicks on and name the file the same as the window title

2010-12-19 2 min read Bash Learning Photo

Take a screenshot of the window the user clicks on and name the file the same as the window title

  <td>
    <div class="text codecolorer">
      &nbsp;sleep 4; xwd >foo.xwd; mv foo.xwd "$(dd skip=100 if=foo.xwd bs=1 count=256 2>/dev/null | egrep -ao '^[[:print:]]+' | tr / :).xwd"
    </div>
  </td>
</tr>
1

In general, this is actually not better than the “scrot -d4” command I’m listing it as an alternative to, so please don’t vote it down for that. I’m adding this command because xwd (X window dumper) comes with X11, so it is already installed on your machine, whereas scrot probably is not. I’ve found xwd handy on boxen that I don’t want to (or am not allowed to) install packages on.

Continue reading

Repeat a portrait eight times so it can be cut out from a 6″x4″ photo and used for visa or passport photos

2010-12-17 2 min read Learning Photo

Repeat a portrait eight times so it can be cut out from a 6″x4″ photo and used for visa or passport photos

  <td>
    <div class="text codecolorer">
      montage 2007-08-25-3685.jpg +clone -clone 0-1 -clone 0-3 -geometry 500 -frame 5 output.jpg
    </div>
  </td>
</tr>
1

Yes, You could do it in the GIMP or even use Inkscape to auto-align the clones, but the command line is so much easier.

Continue reading

Building a Finite State Machine Using DFA::Simple

2010-12-15 11 min read Perl

http://www.perl.com/pub/2004/09/23/fsms.html

Building a Finite State Machine Using DFA::Simple By Bill Ruppert on September 23, 2004 12:00 AM I am converting some articles from MS Word to HTML by hand. I often use bulleted outlines so I face a lot of work creating lists with nested sub-lists. It didn’t take opening and closing many

and

  • tags to realize I wanted to automate the task. It’s very easy to use filters with my text editor and I’ve written several in Perl to speed up my HTML formatting. I decided to create a filter to handle this annoying chore. After a little thought I decided the logic involved was just tricky enough to use a finite state machine (FSM) to keep things straight.

    Continue reading

Install a fully functional terminal server capable of accepting connections from RDP(Windows).

2010-12-12 1 min read Fedora
Seats rebooting Linux
  <dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">
    Image by <a href="http://www.flickr.com/photos/82365211@N00/2473197800">kalleboo</a> via Flickr
  </dd>
</dl>

Inoformation on xrdp:

The goal of this project is to provide a fully functional Linux terminal server, capable of accepting connections from rdesktop and Microsoft’s own terminal server / remote desktop clients.

  <td>
    <div class="text codecolorer">
      &nbsp;sudo yum install xrdp
    </div>
  </td>
</tr>
1

There is not much configuration needed for this so I will not go into details. If you are stuck with something though, you can ask in the comments for the post.

Continue reading

List all installed rpm packages and it’s size

2010-12-09 1 min read Fedora Linux

If you are looking for a command to see the disk usage by each of the rpm‘s then you can use this command:

  <td>
    <div class="text codecolorer">
      &nbsp;rpm -q --queryformat "%10{SIZE}\t%{NAME}\n"
    </div>
  </td>
</tr>
1

And if you use this command very regularly then you can create an alias like

  <td>
    <div class="text codecolorer">
      &nbsp;alias rpm_size='rpm -q --queryformat "%10{SIZE}\t%{NAME}\n" '
    </div>
  </td>
</tr>
1

and use it like

Continue reading
Older posts Newer posts