Skip to content

Instantly share code, notes, and snippets.

View pcting's full-sized avatar

Patrick Ting pcting

View GitHub Profile
2011-01-18 19:39:09,166 INFO com.cloudera.flume.handlers.hdfs.EscapedCustomDfsSink: Opening s3n://XXX/logs/mediasites/date=2011-01-18/hour=19/site=XXX/XXX-log.00000019.20110118-193809143+0000.501707223589.seq
2011-01-18 19:39:09,191 INFO com.cloudera.flume.handlers.rolling.RollSink: closing RollSink 'collectorSink'
2011-01-18 19:39:09,192 WARN com.cloudera.flume.handlers.rolling.RollSink: TriggerThread interrupted
2011-01-18 19:39:09,192 INFO com.cloudera.flume.handlers.debug.StubbornAppendSink: Opening Stubborn Append Sink com.cloudera.flume.handlers.debug.StubbornAppendSink@6295eb
2011-01-18 19:39:09,192 INFO com.cloudera.flume.handlers.rolling.RollSink: opening RollSink 'collectorSink'
2011-01-18 19:39:09,193 INFO com.cloudera.flume.handlers.debug.InsistentOpenDecorator: Opened MaskDecorator on try 0
2011-01-18 19:39:09,193 INFO com.cloudera.flume.handlers.debug.StubbornAppendSink: Opening Stubborn Append Sink com.cloudera.flume.handlers.debug.StubbornAppendSink@6295eb
2011-01-18 19:39:09,193 INFO com.clo
@pcting
pcting / gist:785914
Created January 19, 2011 09:38
Flume S3 Sink Failure
2011-01-19 09:34:32,592 [logicalNode nginx_log_collector-20] INFO hdfs.EscapedCustomDfsSink: Opening s3n://XXX/logs/mediasites/date=2011-01-19/hour=09/site=XXX/XXX-log.00000020.20110119-093416586+0000.29141563286990.seq
2011-01-19 09:34:32,592 [logicalNode nginx_log_collector-20] INFO rolling.RollSink: closing RollSink 'collectorSink'
2011-01-19 09:34:32,593 [Roll-TriggerThread-5] WARN rolling.RollSink: TriggerThread interrupted
2011-01-19 09:34:32,593 [logicalNode nginx_log_collector-20] DEBUG collector.CollectorSink: Roll closed, pushing acks for log.00000020.20110119-093416586+0000.29141563286990.seq :: []
2011-01-19 09:34:32,593 [logicalNode nginx_log_collector-20] INFO debug.StubbornAppendSink: Opening Stubborn Append Sink com.cloudera.flume.handlers.debug.StubbornAppendSink@178460d
2011-01-19 09:34:32,593 [logicalNode nginx_log_collector-20] INFO rolling.RollSink: opening RollSink 'collectorSink'
2011-01-19 09:34:32,594 [logicalNode nginx_log_collector-20] INFO debug.InsistentOpenDecorator: Opened Mask
@pcting
pcting / gist:843293
Created February 25, 2011 02:33
s3cmd 0.9.9.91 patch for eucalyptus
diff -cr -r /usr/share/s3cmd/S3/ACL.py ./S3/ACL.py
*** /usr/share/s3cmd/S3/ACL.py 2009-01-07 04:16:32.000000000 -0800
--- ./S3/ACL.py 2011-02-24 17:57:20.583095822 -0800
***************
*** 31,37 ****
return self.tag == "URI" and self.name == Grantee.ALL_USERS_URI
def isAnonRead(self):
! return self.isAllUsers and self.permission == "READ"
@pcting
pcting / gist:843327
Created February 25, 2011 03:24
set-admin-password.ps1, Powershell script to reset the admin password for Eucalyptus instances
param(
[int] $len = 6,
[string] $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"
)
$bytes = new-object "System.Byte[]" $len
$rnd = new-object System.Security.Cryptography.RNGCryptoServiceProvider
$rnd.GetBytes($bytes)
$result = ""
for( $i=0; $i -lt $len; $i++ )
{
@pcting
pcting / gist:877729
Created March 19, 2011 19:18
CPAN for Ganglia Python Module
curl http://github.com/api/v2/json/blob/all/ganglia/gmond_python_modules/master
@pcting
pcting / gist:895304
Created March 30, 2011 21:05
Generate CSSH commands from hostnames generated by elb-describe-instance-health
#!/bin/sh
LB_HEALTH=$(elb-describe-instance-health 'my-elb-name')
echo "$LB_HEALTH"
LB_NAME=$(echo "$LB_HEALTH" | awk 'BEGIN { ORS=" " } { print $2 }')
echo "$LB_NAME"
INST_CMD=$(echo "$LB_NAME" | awk '{ print "ec2-describe-instances " $0 }')
echo "$INST_CMD"
INST_HEALTH=$(eval "$INST_CMD")
echo "$INST_HEALTH"
@pcting
pcting / install-rails-ruby-1.9.2.sh
Created June 7, 2011 20:06 — forked from dmitry-ilyashevich/install-rails-ruby-1.9.2.sh
Installing rails on rvm ruby 1.9.2
#!/bin/bash
# created by Josh Frye | joshfng@gmail.com
# Check if the user has sudo privileges.
sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; }
# Update the system before going any further
echo "Updating system..."
sudo apt-get update >> install.log && sudo apt-get -y upgrade >> ~/install.log
echo "done.."
@pcting
pcting / gist:1026203
Created June 14, 2011 23:44
Chainsaw Configuration for Log4r
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
<plugin name="UDPReceiver" class="org.apache.log4j.net.UDPReceiver">
<param name="Port" value="4445" />
</plugin>
<logger name="org.apache.log4j">
<level value="warn"/>
</logger>
<root>
@pcting
pcting / gist:1041387
Created June 22, 2011 22:13
SSH Tunnel UDP Packets from REMOTE server
# YOUR LOCAL BOX
socat -t0 -T0 tcp4-listen:6667,reuseaddr,fork UDP:localhost:4445
ssh user@remote_server -R 6667:localhost:6667
# REMOTE MACHINE
socat -t0 -T0 udp4-recvfrom:4445,reuseaddr,fork tcp:localhost:6667
@pcting
pcting / AkkaHttpCorsSupport.scala
Last active August 2, 2018 13:44
Akka HTTP 1.0 CORS Support
import akka.http.scaladsl.model.HttpHeader
import akka.http.scaladsl.model.HttpMethods._
import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Credentials`
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Methods`
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Origin`
import akka.http.scaladsl.model.headers.Origin
import akka.http.scaladsl.server.Directive0
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.MethodRejection