Blog (sk)
4k sector mdadm fdisk
There are no translations available, showing the original:

fdisk -H 224 -S 56 /dev/sda
  - create partitions

dd if=/dev/sda of=/dev/sdb count=100000
dd if=/dev/sda of=/dev/sdc count=100000
dd if=/dev/sda of=/dev/sdd count=100000
  - stupid partition copy (same disks required!)

mdadd --create /dev/md1 --level 10 --raid-devices 4 /dev/sd[a-d]3 --chunk=1024


# see calculator http://busybox.net/~aldot/mkfs_stride.html
mkfs.ext3 -b 4096 -E stride=256,stripe-width=512  /dev/md1
 
Nagios and SNMPv3 monitoring (RH cluster and 3ware)
There are no translations available, showing the original:

Monitoring a RedHat cluster:

snmpwalk -v3 -u username -A password -a md5 hostname  \
  -l authNoPriv REDHAT-CLUSTER-MIB::RedHatCluster

Monitoring 3ware disk array

snmpwalk -v3 -u username -A password -a md5 hostname  \ 
  -l authNoPriv TW-RAID-MIB::twRaidMIB

With nagios you can use checkcommands, and custom variables for hosts as:

define command {
  command_name    check_snmp3_mib
  command_line    /usr/lib/nagios/plugins/check_snmp -U $_HOSTSNMP_USERNAME$ \
          -A $_HOSTSNMP_PASSWORD$ -L $_HOSTSNMP_SECLEVEL$ -a $_HOSTSNMP_AUTHPROT$ \
          -H $HOSTADDRESS$ -m $ARG1$ -o $ARG1$::$ARG2$.0 -w $ARG3$ -c $ARG4$ -l $ARG2$
}

define host{
  use             generic-host
  name            generic-host-company
  register        0
  parents         Internet
  _SNMP_USERNAME  username
  _SNMP_PASSWORD  password
  _SNMP_SECLEVEL  authNoPriv
  _SNMP_AUTHPROT  MD5
}

define service{
  use                 company-service
  host_name           hostname
  service_description rhcClusterFailedServicesNum
  check_command       check_snmp3_mib!REDHAT-CLUSTER-MIB!rhcClusterFailedServicesNum!1!0
}
 
BASH debugging
There are no translations available, showing the original:

export PS4=' ${BASH_SOURCE}:${LINENO}(${FUNCNAME[0]}) '


ant run some code "sh -x script.sh"
 
HTTP server from current directory
There are no translations available, showing the original:

alias server="python -m SimpleHTTPServer $*"


and then it's just a matter of running "server" or "server 5000"
 
Picasa upload to Gallery2
There are no translations available, showing the original:

  • Download source python code from http://code.google.com/p/picasa2gallery/
    • [ svn checkout http://picasa2gallery.googlecode.com/svn/trunk/ picasa2gallery-read-only ]
  • Download and import picasa button
  • Download source python code from http://code.google.com/p/galleryuploader/
    • [ svn checkout http://galleryuploader.googlecode.com/svn/trunk/ galleryuploader-read-only ]
  • Create wrapper script. As picasa is not native linux app but is running through wine, it exports files to C:\windows\temp\. This wrapper script changes this to real linux paths. Please adjust the paths:
#!/bin/sh
# $Id: picasa2gallery_wrapper.sh,v 1.1 2009/01/31 22:51:38 cvsoernii Exp $

ALLFILES=$(echo $* | sed -e 's/C:\\/\/home\/oernii\/.google\/picasa\/3.0\/drive_c\//g' -e 's/\\/\//g')
python /home/oernii/bin/picasa2gallery-svn/picasa2gallery.py $ALLFILES
  • Edit picasa button to read: <param name="exe_path" value="/home/oernii/bin"/> Adjust the path in the script AND in the button to reflect your setup.

PS: degugging tip: run a dry test of galleryuploader in a terminal window first. Try download and save your folders list for example:
python gup.py --list-albums -G http://my.gallery/gallery2/ --save=myGallery -u g2USER -p YOURPASSWORD

This should create 2 files and your ~/.gup/ directory.
 
<< Start < Prev 1 2 Next > End >>

Results 1 - 9 of 17