Post thumbnail of Autostart a KVM virtual machine from the console with virsh
12 January 2012
Continue reading Autostart a KVM virtual machine from the console with virsh

Autostart a KVM virtual machine from the console with virsh

virsh won’t let me query information, but I do know the vm names I wish to start and I have a simple ssh shell on the host machine. So lets give it a shot.

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 Tips and tricks using sudo with vim and redirection
29 September 2010
Continue reading Tips and tricks using sudo with vim and redirection

Tips and tricks using sudo with vim and redirection

Ever opened a file vim but didn’t notice it was read-only until you try to save? Don’t exit and run sudo in front of the same command again. Try this instead.

Post thumbnail of Bash integer counter just like in C
6 August 2010
Continue reading Bash integer counter just like in C

Bash integer counter just like in C

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.

Post thumbnail of Use multiple processors in bash by running commands in parallel
15 January 2010
Continue reading Use multiple processors in bash by running commands in parallel

Use multiple processors in bash by running commands in parallel

Here’s a short bash script to parallelize your jobs. There are utilities already written for just this type of thing, but forget xargs. Check out xjobs instead.

Post thumbnail of subprocess.popen and static define in Python
13 January 2010
Continue reading subprocess.popen and static define in Python

subprocess.popen and static define in Python

I like os’s subprocess.Popen() to run shell commands from within my Python code. I also like to define TRUE and FALSE to use as return values. Now I know what you’re thinking: there’s no such thing as ‘C’s #define in python because there’s no compiler to swap out of all your substitutions at compile time. However, it’s just as easy to achieve the same results.

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 Looping over a range in bash
7 April 2009
Continue reading Looping over a range in bash

Looping over a range in bash

I don’t know why I always forget how to do ranges, but I do. I guess it has something to do with the fact that I don’t expect it to be like C at all, and I don’t need to use it often enough to remember.

Post thumbnail of Control VMware virtual machines from the command line
27 March 2009
Continue reading Control VMware virtual machines from the command line

Control VMware virtual machines from the command line

The vmrun command makes administering VMware virtual machines fast and easy when you’re stuck dealing with VMware Server 2.0. I really hate the web interface. It’s not responsive and in my opinion, a huge step backwards from the old 1.x consoles.

Post thumbnail of See console messages in remote shells
14 March 2009
Continue reading See console messages in remote shells

See console messages in remote shells

In Ubuntu, Fedora and other systems I’ve seen rsyslog running on, to see the console messages you have to have physical access to the server usually through a KVM or IP-KVM setup. Kernel messages are sent to /dev/console while mail, crit, debug, and others get sent to files. Any of these message can be monitored remotely…

 Page 1 of 2  1  2 »
Powered by Wordpress   |   Lunated designed by ZenVerse