Post thumbnail of Printing variables in python with placeholders
6 May 2011
Continue reading Printing variables in python with placeholders

Printing variables in python with placeholders

Even if you’ve only dabbled with python for a minute or two, you’ve probably already figured out that you can print variables using placeholders. You might have tried concatenation too. However, did you know you can print using %s but with the variable names directly?

Post thumbnail of Use Bash to do Math
7 January 2011
Continue reading Use Bash to do Math

Use Bash to do Math

You don’t need calculators or other languages and compilers to do math. You can do a lot in bash (GNU Bourne-Again SHell), and it’s really easy!

Post thumbnail of Make RPM query commands include architecture by default
15 October 2010
Continue reading Make RPM query commands include architecture by default

Make RPM query commands include architecture by default

You can change the default behavior of queries using the RPM command by putting a single line in your .rpmmacros. You can also do this manually each time by including the query format in your rpm command.

Post thumbnail of Variable persistence between pre and post sections in kickstart
6 August 2010
Continue reading Variable persistence between pre and post sections in kickstart

Variable persistence between pre and post sections in kickstart

The pre-install is not inside a chroot environment, so whatever variables you set or export are only available for use outside of a chroot. And that’s the problem with the post install section, by default anyway.

Post thumbnail of Useful YUM Variables
17 June 2010
Continue reading Useful YUM Variables

Useful YUM Variables

The following is a list of variables you can use for both yum commands and yum configuration files.

Post thumbnail of Custom udev rules and external program debugging
27 May 2010
Continue reading Custom udev rules and external program debugging

Custom udev rules and external program debugging

In udev rules, the %k, %b, %n variables are nice and all, but you can also use the variables you’re comparing and setting such as ID_FS_TYPE, KERNEL, SUBSYSTEM, PHYSDEVPATH, etc. When you run a command in a udev rule, there’s nothing stopping you from calling a shell and executing a few commands without actually calling a standalone script to do the dirty work. If you write out the array of environment variables from inside an external program, you can get a better understanding of just which part of the device discovery is matching your rule and getting processed.

Post thumbnail of Running bash shell scripts in debug mode to trace execution
26 August 2009
Continue reading Running bash shell scripts in debug mode to trace execution

Running bash shell scripts in debug mode to trace execution

This is so handy, I can’t believe i’ve never used or even heard of this until today! You can easily run your bash shell scripts in debug mode to watch what they’re doing behind the scenes in real time. You get to see the levels of nesting when you’re inside loops and variables get replaced with their actual contents at the time of execution.
This might come in handy if you have multiple levels of nesting in ‘for’ and ‘while’ loops or a few if/then/else statements and you want to see just what is getting passed in the comparisons.

Post thumbnail of Simple php function to check if post variables are set without triggering warnings
13 August 2009
Continue reading Simple php function to check if post variables are set without triggering warnings

Simple php function to check if post variables are set without triggering warnings

If you check the contents of a post variable that never got passed, you get warnings. If you like keeping your verbosity set that high and want to avoid this warning, or you just want to avoid checking against a non-existent variable, try this

Powered by Wordpress   |   Lunated designed by ZenVerse