Skip to content

Instantly share code, notes, and snippets.

View Jerry-Fix's full-sized avatar

Jerry Jerry-Fix

View GitHub Profile
@Jerry-Fix
Jerry-Fix / pydmesg
Created July 8, 2012 09:50 — forked from saghul/pydmesg
pydmesg: dmesg with human readable timestamps
#!/usr/bin/env python
# coding=utf8
# Copyright (C) 2010 Saúl ibarra Corretgé <saghul@gmail.com>
#
"""
pydmesg: dmesg with human-readable timestamps
"""
@Jerry-Fix
Jerry-Fix / nagios
Created July 18, 2012 13:53 — forked from smukkejohan/nagios
Nagios with Nginx configuration
server {
listen 80;
server_name nagios.example.tld;
access_log /var/log/nginx/nagios.access.log;
error_log /var/log/nginx/nagios.error.log info;
expires 31d;
root /usr/share/nagios3/htdocs;
@Jerry-Fix
Jerry-Fix / gist:3786673
Created September 26, 2012 07:54
disk error info
Apr 3 15:02:39 wtf kernel: [76428.804383] mpt2sas0: log_info(0x3112011a): originator(PL), code(0x12), sub_code(0x011a)
Apr 3 15:02:39 wtf kernel: [76428.804392] mpt2sas0: log_info(0x3112011a): originator(PL), code(0x12), sub_code(0x011a)
Apr 3 15:02:39 wtf kernel: [76428.804400] sd 0:0:1:0: [sdb] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
Apr 3 15:02:39 wtf kernel: [76428.804408] sd 0:0:1:0: [sdb] CDB: Write(10): 2a 00 00 07 21 67 00 04 00 00
Apr 3 15:02:39 wtf kernel: [76428.804429] end_request: I/O error, dev sdb, sector 467303
Apr 3 15:02:39 wtf kernel: [76428.804544] sd 0:0:1:0: [sdb] Unhandled error code
Apr 3 15:02:39 wtf kernel: [76428.804546] sd 0:0:1:0: [sdb] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
Apr 3 15:02:39 wtf kernel: [76428.804549] sd 0:0:1:0: [sdb] CDB: Write(10): 2a 00 00 05 b3 3f 00 04 00 00
Apr 3 15:02:39 wtf kernel: [76428.804554] end_request: I/O error, dev sdb, sector 373567
Apr 3 15:02:39 wtf kernel: [76428.804655] sd 0:0:1:0: [sdb] Unhandled error code
@Jerry-Fix
Jerry-Fix / gist:3786679
Created September 26, 2012 07:55
disk error hot plug
Sep 26 15:03:03 wtf kernel: [5640834.981956] mpt2sas0: removing handle(0x000c), sas_addr(0x50014ee30011c706)
Sep 26 15:04:48 wtf kernel: [5640939.604300] scsi 0:0:13:0: Direct-Access SEAGATE ST2000NM0001 PS06 PQ: 0 ANSI: 6
Sep 26 15:04:48 wtf kernel: [5640939.604308] scsi 0:0:13:0: SSP: handle(0x0018), sas_addr(0x5000c50041f753c5), device_name(0x0000000000000000)
Sep 26 15:04:48 wtf kernel: [5640939.604312] scsi 0:0:13:0: SSP: enclosure_logical_id(0x500065b37689abff), slot(4)
Sep 26 15:04:48 wtf kernel: [5640939.604316] scsi 0:0:13:0: qdepth(254), tagged(1), simple(1), ordered(0), scsi_level(7), cmd_que(1)
Sep 26 15:04:48 wtf kernel: [5640939.604766] sd 0:0:13:0: Attached scsi generic sg1 type 0
Sep 26 15:04:48 wtf kernel: [5640939.605237] sd 0:0:13:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
Sep 26 15:04:48 wtf kernel: [5640939.606128] sd 0:0:13:0: [sdb] Write Protect is off
Sep 26 15:04:48 wtf kernel: [5640939.606567] sd 0:0:13:0: [sdb] Write cache: enabled, read cache: enabled,
# ll *rpm
-rw-r--r--. 1 root root 3277088 Feb 3 21:44 anaconda-13.21.176-1.el6_3.x86_64.rpm
-rw-r--r--. 1 root root 12772 Feb 3 21:44 anaconda-yum-plugins-1.0-5.1.el6.noarch.rpm
-rw-r--r--. 1 root root 82656 Feb 3 21:44 createrepo-0.9.8-5.el6.noarch.rpm
-rw-r--r--. 1 root root 72680 Feb 3 21:44 deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
-rw-r--r--. 1 root root 98688 Feb 3 21:44 device-mapper-multipath-0.4.9-56.el6_3.1.x86_64.rpm
-rw-r--r--. 1 root root 162072 Feb 3 21:44 device-mapper-multipath-libs-0.4.9-56.el6_3.1.x86_64.rpm
-rw-r--r--. 1 root root 94640 Feb 3 21:44 fcoe-utils-1.0.22-3.el6.x86_64(1).rpm
-rw-r--r--. 1 root root 94640 Feb 3 21:44 fcoe-utils-1.0.22-3.el6.x86_64.rpm
-rw-r--r--. 1 root root 669704 Feb 3 21:44 iscsi-initiator-utils-6.2.0.872-41.el6.x86_64.rpm
@Jerry-Fix
Jerry-Fix / ubuntu 12.04 preseed
Created April 13, 2013 17:03
ubuntu 12.04 preseed for cobbler
d-i debian-installer/locale string en_US
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/allow_unauthenticated string true
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
@Jerry-Fix
Jerry-Fix / ubuntu 10.04 preseed
Created April 13, 2013 17:08
ubuntu 10.04 preseed
d-i debian-installer/locale string en_US
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/allow_unauthenticated string true
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/choose_interface select eth0
d-i mirror/country string manual
rh 6.0 kickstart with gpt.
1. add necessary service, remove unnecessary service
2. The last section starting with "#$SNIPPET('custom/xxyy')" are some post install scripts:
* modify /etc/hosts
127.0.0.1 localhost.localdomain localhost
private_ip hostname.jaseywang.me hostname
* remove zero route
* add some parameters to kernel options
* disable ipv6
* add ntp server for each server to sync time
#!/usr/bin/php
<?php
// The service you're using. Choices include clickatell, budgetsms, nexmo and clockwork
$service = 'emay';
// The API key.
$apikey = "YOUR_APIKEY;
// Username and password. With BudgetSMS use userid as password. Username not needed for Nexmo or Clockwork
@Jerry-Fix
Jerry-Fix / zabbix megaraid
Created July 24, 2013 15:33
zabbix megaraid
#!/bin/bash
#
# Checks the status of the hardware raid.
# Checkresults are returned as text or integer.
# The script expects one parameter: The check you want to perform .
# The second paramter, the value you want to grep, is optional.
# The third parameter, the adapter number, is optional. If adapter number is missing, 0 is set.
# Thanks to https://twiki.cern.ch/twiki/bin/view/FIOgroup/DiskRefPerc
# for the nice overview