Skip to content

Instantly share code, notes, and snippets.

@kazuki
kazuki / gist:831432ad0634f2374030
Created May 16, 2014 16:24
redmine + httpd-auth
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 43257b2..b946ec1 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -108,6 +108,8 @@ class ApplicationController < ActionController::Base
if session[:user_id]
# existing session
user = (User.active.find(session[:user_id]) rescue nil)
+ elsif (forwarded_user = request.env["REMOTE_USER"])
+ user = (User.find_by_login(forwarded_user) rescue nil)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kazuki
kazuki / README
Last active August 29, 2015 14:05
Hadoop SwiftFileSystem KeyStone v3 TRUST Support Patch
Added configuration parameter "fs.swift.service.<name>.trust-id".
When you use "fs.swift.service.<name>.trust-id" parameter,
you have to set "fs.swift.service.sic.auth.url" to Keystone V3 URL (http://keystone-host:5000/v3/auth/tokens)
Example:
$ hadoop fs -ls -Dfs.swift.service.sahara.auth.url=http://localhost:5000/v3/auth/tokens \
-Dfs.swift.service.sahara.username=<swift-proxy-user> \
-Dfs.swift.service.sahara.password=<swift-proxy-user-password> \
-Dfs.swift.service.sahara.trust-id=<trust-id> \
swift://<container-name>.sahara/
@kazuki
kazuki / patch
Created December 14, 2014 11:03
Linux Kernel 3.18 Haswell-EP uncore init fixes (ASRock X99M Extreme4 BIOS1.50, Xeon E5-1650v3)
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index 9762dbd..958f331 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -898,9 +898,6 @@ static int __init uncore_pci_init(void)
case 62: /* Ivy Bridge-EP */
ret = ivbep_uncore_pci_init();
break;
- case 63: /* Haswell-EP */
- ret = hswep_uncore_pci_init();
diff --git a/sahara/service/edp/job_manager.py b/sahara/service/edp/job_manager.py
index 9d52ef8..12f4bfe 100644
--- a/sahara/service/edp/job_manager.py
+++ b/sahara/service/edp/job_manager.py
@@ -58,7 +58,7 @@ def _write_job_status(job_execution, job_info):
update['end_time'] = datetime.datetime.now()
job_configs = p.delete_proxy_user_for_job_execution(job_execution)
if job_configs:
- update['job_configs'] = job_configs
+ update.update(job_configs)
p = 1000000007
T = 100000
def find(x):
for i in xrange(1,T*3/2+1):
mul4 = (((x << 1) % p) << 1) % p # x * 4
x0 = (mul4 + 3) % p # x0 = 4x+3 (mod p)
x1 = (((x0 << 1) % p) + 1) % p # x1 = 8x+7 (mod p)
if x0 == 0:
return (i, 0)
@kazuki
kazuki / overlay-repositories.xml
Created November 15, 2011 05:18
Kazuki's Gentoo Overlays
<repositories version="1.0">
<repo quality="experimental" status="unofficial">
<name>kazuki-overlay</name>
<homepage>https://github.com/kazuki/overlay</homepage>
<description lang="en">kazuki's portage overlay</description>
<owner type="person">
<email>k at oikw.org</email>
<name>Kazuki Oikawa</name>
</owner>
<source type="git">git://github.com/kazuki/overlay.git</source>
@kazuki
kazuki / MEMO.md
Last active November 25, 2015 15:58
PC遍歴

1代目 (1997-)

  • CPU: AMD K6-Ⅱ 300MHz
  • メモリ: 64MB
  • HDD: 4.2GB

小学5年生の時に購入.仙台のPCショップのショップブランド.TwoTopではないお店だったけど,どこだったかな...

2代目 (1999-)

@kazuki
kazuki / hoge.pdf
Last active December 17, 2015 23:29
たきざわっかそん#2の適当資料
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kazuki
kazuki / bootchart-20131013.svg
Last active December 25, 2015 10:18
sandbox
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.