Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
for elm in $@; do
database=$(echo $elm | cut -f1 -d '.')
tables=$(echo $elm | cut -f2 -d '.')
if [ $tables == "{*}" ]; then
tables=$(mysql -uroot -e "SHOW TABLES FROM $database")
tables=$(echo $tables | sed s",^Tables_in_$database,,")
fi
@jinnko
jinnko / collectd-smartmon.sh
Last active August 15, 2018 00:22
SMART script for collectd. Forked from original at http://devel.dob.sk/collectd-scripts/smartmon.sh
#!/bin/dash
###
# ABOUT : collectd monitoring script for smartmontools (using smartctl)
# AUTHOR : Samuel B. <samuel_._behan_(at)_dob_._sk> (c) 2012
# LICENSE: GNU GPL v3
# SOURCE: http://devel.dob.sk/collectd-scripts/
#
# This script monitors SMART pre-fail attributes of disk drives using smartmon tools.
# Generates output suitable for Exec plugin of collectd.
###
@ogrrd
ogrrd / dnsmasq OS X.md
Last active May 10, 2024 09:08
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@phinpho
phinpho / foca.js
Created September 4, 2012 15:47 — forked from fczuardi/foca.js
Foca no código
/* .---.
/o o\
__(= " =)__
//\'-=-'/\\
) (_
/ `"=-._
/ \ ``"=.
/ / \ \ `=..--.
___/ / \ \___ _, , `\
`-----' `""""`'-----``"""` \ \_/
@rnapier
rnapier / fix-xcode
Last active March 18, 2022 01:17
Links Xcode SDKs from the /SDKs directory (which you maintain yourself)
#!/usr/bin/python
# fix-xcode
# Rob Napier <robnapier@gmail.com>
# Script to link in all your old SDKs every time you upgrade Xcode
# Create a directory called /SDKs (or modify source_path).
# Under it, put all the platform directories:
# MacOSX.platform iPhoneOS.platform iPhoneSimulator.platform
# Under those, store the SDKs:
@douglasmiranda
douglasmiranda / gist:2555156
Created April 30, 2012 03:07
Solução para instalar lxml no ubuntu com sucesso =] ( erro em pip install lxml )
#Se o erro for algo parecido com isto:
#building 'lxml.etree' extension
#gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
#In file included from src/lxml/lxml.etree.c:239:0:
#src/lxml/etree_defs.h:9:31: erro fatal: libxml/xmlversion.h: Arquivo ou diretório não encontrado
#compilação terminada.
#error: command 'gcc' failed with exit status 1
#basta instalar libxml2-dev e libxslt-dev
@eparreno
eparreno / gist:1845561
Created February 16, 2012 15:17
Install libmagic on Mac OS X via homebrew
$ brew install libmagic
$ brew link libmagic (if the link is already created is going to fail, don't worry about that)
$ env ARCHFLAGS="-arch x86_64" gem install ruby-filemagic -- --with-magic-include=/usr/local/include --with-magic-lib=/usr/local/lib/