Showing entries 41 to 50 of 57
« 10 Newer Entries | 7 Older Entries »
Displaying posts with tag: bash (reset)
How to get colored output from ‘ls’ on Solaris10

For all of those linux users out there that have moved over to, or tried out, Solaris10 or OpenSolaris because they heard the tales of how MySQL is faster on Solaris… or perhaps you wanted to learn how to use Sol10 for the great features of Zones or the ZFS filesystem? Regardless of why you’re on it you are probably wondering why Linux has colored output of filenames and directories but Solaris does not. The question of ‘why?’ isn’t important, but how to enable colors is. It’s very simple, and here’s how I fixed it. This is a result of digging through multiple semi-related links on Google.

  1. Download all packages from SunFreeware.com
    • dependency: libintl-3.4.0-sol10-x86-local
    • dependency: libiconv-1.13.1-sol10-x86-local
    • dependency: gmp-4.2.1-sol10-x86-local
    • dependency: gcc-3.4.6-sol10-x86-local or libgcc-3.4.6-sol10-x86-local depending on your …
[Read more]
Kontrollkit – new version is available for download!

Just a quick notice to let everyone know that there is a new version of Kontrollkit available. There are two new scripts included as well as some good updates to the my.cnf files. You can download the new version here: http://kontrollsoft.com/software-downloads kt-mysql-systemcheck – generates a report for point-in-time system status that is useful for troubleshooting MySQL [...]

Automating MySQL access with expect and bash scripting

If you have multiple database servers with strange names, or if you have to hop over multiple machines to connect to any mysql database server, then you know what a pain it can be to administer such a setup. Thanks to some scripting, you can automate such tasks as follows:

Create an expect script:
/path/to/sshmysql.exp

#!/usr/bin/expect -f
#script by darren cassar
#mysqlpreacher.com

set machine [lindex $argv 0]

set timeout -1

spawn ssh username@$machine
match_max 100000
expect -exact “assword: “
send — “password\r”
send — “sudo -k; sudo su – mysql\r”
expect -exact “sudo -k; sudo su – mysql”
expect -exact “assword:”
send — “password\r”
interact

# you should change the word password in ‘send — “password\r”‘ to your login password
# if you have the same password for each …

[Read more]
Bisection testing using Quilt

Having produced a nice little series of 124 patches (yes, really), I recently had to find out what patch introduced a problem for distcheck to pass. Since distcheck takes quite some time to execute, I want to make as few runs as possible.

In Git, there is the bisect command that can be used to perform bisection testing of a series of patches, but quilt does not have anything like that, so to simplify my job, I needed to implement that for quilt.

I started by defining a shell function that did the actual test, and returned the result.

do_test () {
    echo -n "running distcheck..."
    make -j6 distcheck >/dev/null 2>&1
}

After that, I added code to add values for some variables used and to process options to the script. The script supports two options: --lower and …

[Read more]
Hidden Features Of Perl, PHP, Javascript, C, C++, C#, Java, Ruby, Python, And Others [Collection Of Incredibly Useful Lists]

Introduction

StackOverflow is an amazing site for coding questions. It was created by Joel Spolsky of joelonsoftware.com, Jeff Atwood of codinghorror.com, and some other incredibly smart guys who truly care about user experience. I have been a total fan of SO since it went mainstream and it's now a borderline addiction (you can see my StackOverflow badge on the right sidebar).

The Story

Update 6/21/09: This server is currently under very heavy load (10-200), even with caching plugins enabled. Please bear with me as I try to resolve the situation.

Feel free to …

[Read more]
Replicating from MySQL to *

Recently I needed to replicate between MySQL and another database technology. You might say, why on earth would you want to do something like that, but believe me there are reasons and definitely not (to go away from MySQL to some other DB technology like Oracle or SQL server). Unsurprisingly there are quite a few different tools to do it from any platform towards MySQL but very few which do it the other way round, just to name a couple: Golden Gate and DSCallards.

Gentlemen, Slap your Engines!

Once again, I was unable to attend all of the sessions I wanted to at this year's User Converence, but I was happy to make it to Bob Burgess' talk on bash scripting with mysql. The slides and examples aren't up yet, but when they are (which may be as you read this, check the last link), they would probably also be a great tutorial.


So, I got bore^D^D^D^D inspired later that day to put some of the practices into use, and worked up a script to run mysqlslap in various ways against a server, and then added a couple funcitons to try it out on each storage engine. The script is below in its entirety - bash scripters, please be kind in your comments. No, I didn't write all this just for the pun in the …

[Read more]
Gentlemen, Slap your Engines!

Once again, I was unable to attend all of the sessions I wanted to at this year's User Converence, but I was happy to make it to Bob Burgess' talk on bash scripting with mysql. The slides and examples aren't up yet, but when they are (which may be as you read this, check the last link), they would probably also be a great tutorial.


So, I got bore\^D\^D\^D\^D inspired later that day to put some of the practices into use, and worked up a script to run mysqlslap in various ways against a server, and then added a couple funcitons to try it out on each storage engine. The script is below in its entirety - bash scripters, please be kind in your comments. No, I didn't write all this just for the pun in the …

[Read more]
Gentlemen, Slap your Engines!

Once again, I was unable to attend all of the sessions I wanted to at this year's User Converence, but I was happy to make it to Bob Burgess' talk on bash scripting with mysql. The slides and examples aren't up yet, but when they are (which may be as you read this, check the last link), they would probably also be a great tutorial.


So, I got bore\^D\^D\^D\^D inspired later that day to put some of the practices into use, and worked up a script to run mysqlslap in various ways against a server, and then added a couple funcitons to try it out on each storage engine. The script is below in its entirety - bash scripters, please be kind in your comments. No, I didn't write all this just for the pun in the …

[Read more]
RESET SLAVE, bash edition

Nearly every job advertisement for MySQL DBA positions asks for ’shell scripting’, so I decided to investigate what it is. I remembered some performance training, where I was told how forking is bad, and one should attempt to use shell features as much as possible (like, avoid paths to something, what can be used by builtin (e.g. don’t use /usr/bin/[, just pure [ instead )

I tried to automate one MySQL DBA task (reinitializing slave after relay log corruption or after copying in cloned dataset from other server) using just bash - and it kind of worked. From now on I can put 'Shell scripting' proudly on my resume :-)

Next step - learn JCL (some people think this is funny :)

What was your most complicated task solved with shell scripts? :)

#!/bin/bash

HOST=$1
RPASS=$(<passwordfile)

IFS="
" …
[Read more]
Showing entries 41 to 50 of 57
« 10 Newer Entries | 7 Older Entries »