Skip to content

Instantly share code, notes, and snippets.

View kohsuke's full-sized avatar
🏠
WFH

Kohsuke Kawaguchi kohsuke

🏠
WFH
View GitHub Profile
root@cucumber:/var/log/apache2/mirrors.jenkins-ci.org# mb scan -d updates ftp-nyc.osuosl.org
Tue Apr 10 01:24:03 2012 ftp-nyc.osuosl.org: starting
Tue Apr 10 01:24:03 2012 ftp-nyc.osuosl.org: files in 'updates' before scan: 33
Tue Apr 10 01:24:04 2012 ftp-nyc.osuosl.org: scanned 33 files (25/s) in 1s
Tue Apr 10 01:24:04 2012 ftp-nyc.osuosl.org: files to be purged: 0
Tue Apr 10 01:24:04 2012 ftp-nyc.osuosl.org: total files in 'updates' after scan: 33 (delta: 0)
Tue Apr 10 01:24:04 2012 ftp-nyc.osuosl.org: purged old files in 0s.
Tue Apr 10 01:24:04 2012 ftp-nyc.osuosl.org: done.
Completed in 1 seconds
import org.jruby.ext.posix.*;
import hudson.os.*;
class MyHandler implements POSIXHandler {
public void error(POSIX.ERRORS errors, String s) {
throw new PosixException(s,errors);
}
public void unimplementedError(String s) {
throw new UnsupportedOperationException(s);
require 'jenkins/plugin/behavior'
module Jenkins
#
# Defines the equivalent of `hudson.Extension`
#
module Extension
extend Plugin::Behavior
implemented do |cls|
% svn commit -m "exposed the timestamp"
Sending src/main/java/hudson/scm/SubversionChangeLogSet.java
Transmitting file data .
Committed revision 40346.
Warning: post-commit hook failed (exit code 2) with output:
Can't locate SVN/Notify.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/local/bin/svnnotify line 9.
BEGIN failed--compilation aborted at /usr/local/bin/svnnotify line 9.
kohsuke@spinach:/tmp/foo/usr/bin$ sudo ./gstack 8003
#0 0x00007ff647a53b70 in __read_nocancel () from /lib/libpthread.so.0
#1 0x00000000004c312f in ?? ()
#2 0x00000000004c31a9 in ?? ()
#3 0x0000000000494d5b in ?? ()
#4 0x0000000000494db5 in ?? ()
#5 0x000000000046fef1 in ?? ()
#6 0x00000000004b9122 in ?? ()
#7 0x00000000004b85b5 in ?? ()
#8 0x0000000000424744 in ?? ()
@kohsuke
kohsuke / gist:1599586
Created January 12, 2012 09:36
netstat output
This file has been truncated, but you can view the full file.
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 1770/smbd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2438/haproxy
tcp 0 0 63.246.20.93:80 210.94.41.89:59601 SYN_RECV -
tcp 0 0 63.246.20.93:80 109.193.60.22:2522 SYN_RECV -
tcp 0 0 63.246.20.93:80 193.12.210.241:24425 SYN_RECV -
tcp 0 0 63.246.20.93:80 80.86.190.59:56084 SYN_RECV -
tcp 0 0 63.246.20.93:80 194.31.15.3:52054 SYN_RECV -
tcp 0 0 63.246.20.93:80 84.49.231.147:56046 SYN_RECV -
@kohsuke
kohsuke / gist:1531019
Created December 29, 2011 01:35
iptables
root@eggplant:/srv/jira/current/conf# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 /* 000 accept all icmp requests */
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 22 /* 001 accept inbound ssh requests */
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 8080 /* 002 accept local traffic */
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 8081 /* 003 accept local traffic */
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 80 /* 100 accept inbound HTTP requests */
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 443 /* 101 accept inbound HTTPs requests */
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 /* 999 drop all other requests */
% JAVA_HOME=/usr/lib/jvm/java-6-openjdk /usr/bin/idea
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre10-0ubuntu5)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
WARNING: You are launching IDE using OpenJDK Java runtime.
THIS IS STRICTLY UNSUPPORTED DUE TO KNOWN PERFORMANCE AND GRAPHICS PROBLEMS!
NOTE: If you have both Oracle (Sun) JDK and OpenJDK installed
please validate either IDEA_JDK, JDK_HOME, or JAVA_HOME environment variable points to valid Oracle (Sun) JDK installation.
@kohsuke
kohsuke / gist:1371596
Created November 16, 2011 22:01
m[k] is O(N) not O(1) if m is Java map
public class MapJavaProxy extends ConcreteJavaProxy {
private static class RubyHashMap extends RubyHash {
@Override
public IRubyObject internalGet(IRubyObject key) {
Set<Map.Entry> entries = ((Map) ((JavaProxy)receiver).getObject()).entrySet();
for (Map.Entry entry : entries) {
IRubyObject rubyfiedKey = JavaUtil.convertJavaToUsableRubyObject(getRuntime(), entry.getKey());
if (key.eql(rubyfiedKey)) {
<f:entry title="">
<div align="right">
<f:repeatableDeleteButton />
</div>
</f:entry>