Post thumbnail of Handle command line arguments with getopt in Python
29 December 2009
Continue reading Handle command line arguments with getopt in Python

Handle command line arguments with getopt in Python

Here’s a way to use getopt to handle arguments when creating command line applications. It works quite well with the standard help (–help or -h) by showing usage when bad arguments are passed.

Post thumbnail of Get a reversed list of command line arguments from sys.argv
12 October 2009
Continue reading Get a reversed list of command line arguments from sys.argv

Get a reversed list of command line arguments from sys.argv

This is useful if you need to look at the last arguments before deciding what to do, possibly for interoperability with some older code where the order of command line arguments is already set in stone.

Post thumbnail of Find your partitions and kernel from the GRUB command line
15 April 2009
Continue reading Find your partitions and kernel from the GRUB command line

Find your partitions and kernel from the GRUB command line

You may find that grub is pretty useless when your menu.lst is missing or misconfigured. It’s not easy to figure out how to make grub tell you where the files are that you need. Here’s how to find what you need in order to boot, just using the grub bootloader.

Share this:
  • Digg
  • Facebook
  • Reddit
  • LinkedIn
  • Google Bookmarks
Post thumbnail of AdFind - Command line Active Directory query tool for regular users
17 March 2009
Continue reading AdFind - Command line Active Directory query tool for regular users

AdFind - Command line Active Directory query tool for regular users

I really like this tool, redirect the output to a file and it should dump the whole tree in seconds. All I was really interested in was the dn, cn, mail, and displayName, but I found I was able to see much more.

Share this:
  • Digg
  • Facebook
  • Reddit
  • LinkedIn
  • Google Bookmarks
Post thumbnail of Finding things in Active Directory using the command line
17 March 2009
Continue reading Finding things in Active Directory using the command line

Finding things in Active Directory using the command line

Find computers and their description from the AD, Use LDP to search for tombstoned objects in AD, Show all replicated attributes in the AD Schema, Show an AD schema attribute, Find a list of CNs in the directory and return their homeDirectory, Identify the DN of an Active Directory group, Query a user from AD using WMI, etc.

Share this:
  • Digg
  • Facebook
  • Reddit
  • LinkedIn
  • Google Bookmarks
Post thumbnail of Command line shortcut #977 - shell auto-completion
18 February 2009
Continue reading Command line shortcut #977 - shell auto-completion

Command line shortcut #977 - shell auto-completion

Instead of typing the export string out each time and the emerge line too, I just recalled them from the history knowing that the last set of commands that started with those characters were the commands I wanted. If you didn’t know about these handy shortcuts, now you know, and knowing is have the battle. So when is that movie coming out anyway!!?

Share this:
  • Digg
  • Facebook
  • Reddit
  • LinkedIn
  • Google Bookmarks
Powered by Wordpress   |   Lunated designed by ZenVerse