Skip to content

Instantly share code, notes, and snippets.

View n0ts's full-sized avatar
🏠
Working from home

Naoya Nakazawa n0ts

🏠
Working from home
  • Freelancer
  • Tokyo, Japan
  • X @n0ts
View GitHub Profile
@n0ts
n0ts / gist:493f0867b0541077768e
Created November 13, 2014 00:16
pgsql link error
...
ld: warning: directory not found for option '-L/usr/local/homebrew/Cellar/libpng/1.6.10/lib'
Undefined symbols for architecture x86_64:
"_lo_lseek64", referenced from:
_zif_pg_lo_seek in pgsql.o
"_lo_tell64", referenced from:
_zif_pg_lo_tell in pgsql.o
"_lo_truncate64", referenced from:
_zif_pg_lo_truncate in pgsql.o
ld: symbol(s) not found for architecture x86_64
@n0ts
n0ts / DBUtil.py.patch
Created December 22, 2014 02:22
Patch gmond/python_modules/db/DBUtil.py
--- ./gmond/python_modules/db/DBUtil.py-org 2014-10-23 10:24:40.000000000 +0900
+++ ./gmond/python_modules/db/DBUtil.py 2014-10-23 10:35:23.000000000 +0900
@@ -86,7 +86,7 @@
innodb_status['active_transactions']
for line in innodb_status_raw:
- istatus = line.split()
+ istatus = line.replace(',', '').replace(';', '').split()
isum = sumof(istatus)
@n0ts
n0ts / mysql.py.patch
Created December 22, 2014 02:23
Patch gmond/python_modules/db/mysql.py
--- ./gmond/python_modules/db/mysql.py-org 2014-10-23 10:20:38.000000000 +0900
+++ ./gmond/python_modules/db/mysql.py 2014-10-23 12:23:31.000000000 +0900
@@ -113,7 +113,7 @@
if get_innodb:
cursor = conn.cursor(MySQLdb.cursors.Cursor)
cursor.execute("SHOW /*!50000 ENGINE*/ INNODB STATUS")
- innodb_status = parse_innodb_status(cursor.fetchone()[0].split('\n'))
+ innodb_status = parse_innodb_status(cursor.fetchone()[2].split('\n'))
cursor.close()
logging.debug('innodb_status: ' + str(innodb_status))
@n0ts
n0ts / mysql.pyconf
Created December 22, 2014 02:35
Ganglia MySQL Configuration
###
###
### This module requires MySQL-python e.g. on Centos/RHEL
### * yum install MySQL-python
###
### Note:
### To setup database access:
### GRANT SUPER, PROCESS ON *.* TO your_user@localhost \
### IDENTIFIED BY "your_password";
###
@n0ts
n0ts / gist:5ce4e90e1ede58458bb1
Last active August 29, 2015 14:13
tmp nginx.conf
server {
listen 80;
server_name _;
#access_log /tmp/access.log main;
access_log /var/log/nginx/test-access.log main;
location / {
#root /tmp/test;
root /test/tmp;
#!/bin/bash
if [ ! -x "/usr/bin/xcodebuild" ]; then
echo "Could not found /usr/bin/xcodebuild"
exit 1
fi
# XCode license agreement
sudo /usr/bin/xcodebuild -license
@n0ts
n0ts / gist:3b1611eb54807833cca28fe920f2c3f8
Last active May 25, 2016 05:53
nginx-full mruby compile error at 10.11.5
$ brew install nginx-full --devel --with-passenger --with-addition --with-auth-req --with-degredation --with-flv --with-geoip --with-google-perftools --with-gunzip --with-gzip-static --with-http2 --with-image-filter --with-mail --with-mp4 --with-pcre-jit --with-perl=/usr/local/homebrew/perl --with-random-index --with-realip --with-secure-link --with-status --with-stream --with-sub --with-webdav --with-xslt --with-mruby-module --with-lua
...
build: [exec] git clone git://github.com/redis/hiredis.git
Cloning into 'hiredis'...
build: [exec] make
make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
clang -g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -Wwrite-strings -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
net.c:139:37: error: use of undeclared identifier 'TCP_KEEPALIVE'
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &val, sizeof(val)) < 0) {
ERROR (ddagent.py:274): Response: HTTPResponse(_body=None,buffer=None,code=599,effective_url='https://5-8-0-app.agent.datadoghq.com/intake/?api_key=*****************************',error=HTTPError('HTTP 599: Timeout',),headers={},reason='Unknown',request=<tornado.httpclient.HTTPRequest object at 0x7fae74d94d50>,request_time=20.000539779663086,time_info={})
traps: python[591] general protection ip:7f5fa2051350 sp:7f5f7b7f9c70 error:0 in libcrypto.so.1.0.0[7f5fa1f90000+19c000]
@n0ts
n0ts / gist:eb01f31ce1386d18bd2c84d5d4ef43ac
Last active August 4, 2016 04:56
HTML5 details test
<details>
require('does.not.exist')
Error: Cannot find module 'does.not.exist'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at repl:1:1
at REPLServer.defaultEval (repl.js:164:27)
at bound (domain.js:250:14)