Everything you ever wanted to know about the stream editor sed. Pattern matching, delimiters, deletion, ranges, grouping, all explained.
In almost all high level languages you can do something similar to x++ to increment an integer counter. Bash doesn’t have an incrementer, but you can still make your own integer counter using back-ticks and expr.
Start the spec file with %define statements at the top. Continue the spec file as you would normally, using the variables you just defined in place of the real name, version, build. Create an rpmbuild script that replaces the template variables with current information. Make an rpm target in your Makefile that calls the rpmbuild script.
Change lowercase to uppercase or vice versa using sed the brute force easy way and the smart way. One use of this would be finding the hardware address of an interface and converting it to all uppercase.
This one should be pretty bulletproof. Use a single sed command to dump the list of all ip addresses from interfaces showing in ifconfig.
99% of the time you can just use the local address to talk to yourself. This is just an example to show you how wrangle the ip address using awk. Rewrite the hosts file so the host itself can use it’s external address by name. Write out the basic stuff in hosts that doesn’t change then write out the current IP address.
This faq is the most useful pygtk resource you will find. The full documentation is great for looking up which methods to use or what’s available in one class or another, but it’s the little nooks and crannies that are always left out by most pygtk resource sites that I …
Although the PyGTK Reference Manual is extremely helpful in figuring out how to use gtk objects, there’s not a whole lot of information about setting properties on gtk.Label objects readily available. Some hard-to-find yet simple tasks are setting the font size of a label and rotating the text. Pango is your friend, so don’t forget to include him.
Why can’t I find a code generator that works? Tepache is a code sketcher for python that uses pygtk and glade, but it is broken and it looks like it hasn’t been updated since July 2005 anyway. Gladex was broken out of the box. Autocode does not like my glade and the documentation is limited.
So easy, and it works with lists too. Won’t work with dictionaries but it should work with any hash-able type.