Skip to content

Instantly share code, notes, and snippets.

<?php
$ua = $_SERVER["HTTP_USER_AGENT"];
/*
if(strpos($_SERVER["HTTP_HOST"],"kmobs")) {
header('Location: kmobsmod/index.php');
}
else */
if (strpos($ua,"Android")) {
header ('Location: index_android.php');
public List<Snippet> listSnippets() throws IOException {
verifyRootDirectoryExists();
File[] files = DIRECTORY.listFiles(new FileFilter() {
public boolean accept(File file) {
return file.isFile() && !file.isHidden();
}
});
List<Snippet> result = Collections.emptyList();
if(files != null) {

Ubuntu 12.04, Ruby, Rails, Nginx, Unicorn and git-deploy

In the seemlingly endless search for the actual correct and easy way to deploy a Rails app, we have tried several ways. We tried out using Apache2 and running a cluster of Thin servers. With the built in threading of Puma we decided to use it with Nginx.

Server Setup

  • Create new server
  • Login to new server
    • ssh username@IPaddress (you can also use the domain name if you have the DNS setup already)
    • accept the RSA key
recovery_tool_version=0.9.2
recovery_tool_linux_version=0.9.2
recovery_tool_update=
name=HP Pavilion Chromebook
version=3701.81.2
desc=HP Pavilion Chromebook
channel=stable-channel
hwid=BUTTERFLY AGAVE A-A 9026
@jab416171
jab416171 / orderlyshutdown
Created June 11, 2013 16:05
Stack Trace Comparison
hudson.remoting.RequestAbortedException: hudson.remoting.RequestAbortedException: hudson.remoting.Channel$OrderlyShutdown
at hudson.remoting.Request.call(Request.java:174)
at hudson.remoting.Channel.call(Channel.java:672)
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:158)
at $Proxy118.join(Unknown Source)
at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:915)
at hudson.Launcher$ProcStarter.join(Launcher.java:360)
at hudson.tasks.Ant.perform(Ant.java:217)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
@jab416171
jab416171 / orderlyshutdown
Created June 10, 2013 21:37
OrderlyShutdown Stack Trace
hudson.remoting.RequestAbortedException: hudson.remoting.RequestAbortedException: hudson.remoting.Channel$OrderlyShutdown
at hudson.remoting.Request.call(Request.java:174)
at hudson.remoting.Channel.call(Channel.java:672)
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:158)
at $Proxy118.join(Unknown Source)
at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:915)
at hudson.Launcher$ProcStarter.join(Launcher.java:360)
at hudson.tasks.Ant.perform(Ant.java:217)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
{"status":13,"value":{"class":"java.lang.NullPointerException","stackTrace":[{"fileName":"ExternalSessionKey.java","lineNumber":73,"className":"org.openqa.grid.internal.ExternalSessionKey","methodName":"fromWebDriverRequest"},{"fileName":"WebDriverRequest.java","lineNumber":60,"className":"org.openqa.grid.web.servlet.handler.WebDriverRequest","methodName":"extractSession"},{"fileName":"RequestHandler.java","lineNumber":234,"className":"org.openqa.grid.web.servlet.handler.RequestHandler","methodName":"getSession"},{"fileName":"RequestHandler.java","lineNumber":117,"className":"org.openqa.grid.web.servlet.handler.RequestHandler","methodName":"process"},{"fileName":"DriverServlet.java","lineNumber":84,"className":"org.openqa.grid.web.servlet.DriverServlet","methodName":"process"},{"fileName":"DriverServlet.java","lineNumber":62,"className":"org.openqa.grid.web.servlet.DriverServlet","methodName":"doGet"},{"fileName":"HttpServlet.java","lineNumber":707,"className":"javax.servlet.http.HttpServlet","methodName":"se
I/Adreno200-EGL(24350): <eglInitialize:269>: EGL 1.4 QUALCOMM build: Nondeterministic AU_full_mako_PARTNER-ANDROID/JB-MR1-DEV_CL2961380_release_AU (CL2961380)
I/Adreno200-EGL(24350): Build Date: 12/10/12 Mon
I/Adreno200-EGL(24350): Local Branch:
I/Adreno200-EGL(24350): Remote Branch: m/partner-android/jb-mr1-dev
I/Adreno200-EGL(24350): Local Patches: NONE
I/Adreno200-EGL(24350): Reconstruct Branch: NOTHING
D/OpenGLRenderer(24350): Enabling debug mode 0
private static class ASyncUpload extends AsyncTask<FileInputStream, Integer, String> {
private NotificationManager mNotifyManager;
private NotificationCompat.Builder mBuilder;
public DocumentUploadAsync(Context ctxt) {
mNotifyManager =
(NotificationManager) ctxt.getSystemService(Context.NOTIFICATION_SERVICE);
mBuilder = new NotificationCompat.Builder(ctxt);
mBuilder.setContentTitle("File Upload")
.setContentText("Upload in progress");
}
@jab416171
jab416171 / instructions.txt
Last active December 16, 2015 11:58
Installing Linux on the Chromebook Pixel
These directions are provided AS-IS, if you lose all of your data or
brick your machine, it's not my problem.
Quick pre-requisites:
A) You should (optionally) have a USB mouse you can plug into the
Pixel for when you first boot into Linux as the touchpad and
touchscreen won't work at the beginning.
You can forego this bit and work from the VC console instead