Splitter un dump mysql avec Bash, en 1 dump par table

#!/bin/bash file=$1 # the input file directory= »$file-splitted » # the output directory output= »$directory/header » # the first file containing the header GREP= »DROP TABLE » # what we are looking for mkdir $directory # create the output directory while read line do # if the current line contains the wanted statement if [ $(echo « $line » | grep -c « $GREP ») […]

Ubuntu: How to Force a Silent Cron | The Rugged Rock of Craig

Ubuntu: How to Force a Silent Cron Posted on Tuesday, January 4, 2011 by Craig Lotter By default, cron actions that produce output generates emails that get sent to the system administrator. If we don’t particularly want this behaviour, we need to terminate our function calls with a specific character sequence, which looks as follows: […]

Template for Generic Nagios Plugin | blog.jgriffiths.org

I love nagios it’s the perfect way to monitor linux. Monitoring command can be written in almost any language: nagios expects a exit code and a exit string and it works. I write most of my plugins in bash shell. Here is a generic plugin template: #!/bin/bash # Sanity check if [ $# -ne 2 […]

Build cross-compiled kernel debian package – Sysmic.org

Build cross-compiled kernel debian package Par Jérôme Pouiller le vendredi, octobre 29 2010, 09:37 – Lien permanent As you may know, you have juste to add options ARCH and if necessary CROSS_COMPILE to command line: make ARCH=powerpc CROSS_COMPILE=ppc-linux-gnu- XXX_defconfig make ARCH=powerpc CROSS_COMPILE=ppc-linux-gnu- XImage My primary concern is to compile an x86 32bits kernel in 64bits […]

Snipt – isagoksu – Show the process ID that uses specific port | Share and store code or command snippets.

# The linux fuser command has a special option for port conflicts. # Use fuser -n tcp <port id> for tcp ports to see which process is using # the port. # For example to see which application is already using port 80 use: $ fuser -n tcp 80 # The netstat command can also […]

Benoît.Bâlon.free.fr » Le dernier jour du mois ?

Le dernier jour du mois ? 30/04/2010 Benoît Bâlon Commenter Allez aux commentaires Dans la catégorie « astuces pour amoureux de la ligne de commande sous GNU/Linux », voici une petite commande qui peut s’avérer pratique dans le cas de certains développements en Bash. La simplicité de ce code n’a d’égal que sa beauté ! […]