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
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 0
%define name_arch x86_64
Name: yum-hoge-%{name_arch}
Version: 1
Release: 1
Summary: hoge yum repository for %{name_arch}
Group: System Environment/Base
License: GPL
URL: http://example.com
@n0ts
n0ts / hoge.repo
Created September 12, 2010 13:40
[yum-hoge-x86_64]
name=yum-hoge-x86_64
baseurl=http://example.jp/cobbler/repo_mirror/hoge-x86_64
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-HOGE
gpgcheck=1
priority=1
@n0ts
n0ts / gist:613223
Created October 6, 2010 11:41
LVS crush log
BUG: soft lockup - CPU#14 stuck for 10s! [swapper:0]
CPU 14:
Modules linked in: ip_conntrack_netbios_ns xt_state iptable_filter ipt_MASQUERADE iptable_nat ip_nat ip_conntrack nfnetlink iptable_mangle ip_tables ipmi_devintf ipmi_si ipmi_msghandler ioatdma_v3 ip_vs_wrr ip_vs_wlc ip_vs cpufreq_ondemand acpi_cpufreq freq_table xt_tcpudp xt_MARK x_tables loop dm_multipath scsi_dh video backlight sbs power_meter hwmon i2c_ec dell_wmi wmi button battery asus_acpi acpi_memhotplug ac parport_pc lp parport sr_mod cdrom joydev igb i2c_i801 8021q sg dca i2c_core serio_raw pcspkr dm_raid45 dm_message dm_region_hash dm_mem_cache dm_snapshot dm_zero dm_mirror dm_log dm_mod ata_piix libata shpchp aacraid sd_mod scsi_mod ext3 jbd uhci_hcd ohci_hcd ehci_hcd
Pid: 0, comm: swapper Not tainted 2.6.18-194.3.1.el5 #1
RIP: 0010:[<ffffffff80064bfc>] [<ffffffff80064bfc>] .text.lock.spinlock+0x2/0x30
RSP: 0018:ffff81033fd2fc30 EFLAGS: 00000282
RAX: 00000000000000f2 RBX: 000000000000000e RCX: ffff81033c530500
RDX: ffff81033f422800 RSI
@n0ts
n0ts / atig.rb patch
Created November 30, 2010 11:58
atig.rb patch
--- atig.rb-org 2010-11-30 20:57:39.006639395 +0900
+++ atig.rb 2010-11-30 20:55:38.433887855 +0900
@@ -17,6 +17,7 @@
require 'atig/twitter'
require 'atig/scheduler'
+require 'atig/command/command'
Dir['atig/agent/*.rb'].each do|file|
load file
@n0ts
n0ts / gist:727243
Created December 3, 2010 17:23
atig patch at on_privmsg
--- a/atig/gateway/session.rb
+++ b/atig/gateway/session.rb
@@ -202,7 +202,6 @@ END
def on_privmsg(m)
target, mesg = *m.params
m.ctcps.each {|ctcp| on_ctcp(target, ctcp) } if m.ctcp?
- p target
case
when mesg.empty?
@n0ts
n0ts / gist:767641
Created January 6, 2011 07:15
Apache Cnfiguration for X-Content-Type-Options
http://d.hatena.ne.jp/hasegawayosuke/20110106/p1
SetEnvIf User-Agent ".*MSIE.*" ie
Header always append X-Content-Type-Options nosniff env=ie
@n0ts
n0ts / gist:822184
Created February 11, 2011 10:31
Tweets #qpstudy
---
2011-02-11 19:28:00
Total tweets: 1485
Gentoo: 202
Ubuntu: 124
Debian: 119
Vine: 79
Fedora: 65
---
require 'rubygems'
require 'benchmark'
gem 'memcached', '=1.0.6'
require 'memcached'
TEST_DATA_NUM = 100
$memcached = Memcached::new('localhost:11211')
# ベンチマークを計測する
require 'rubygems'
require 'benchmark'
gem 'memcache-client', '=1.8.5'
require 'memcache'
TEST_DATA_NUM = 100
$memcached = MemCache::new('localhost:11211')