Skip to content

Instantly share code, notes, and snippets.

Joseph Bass jab416171

Block or report user

Report or block jab416171

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View serversetup.md

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
View listSnippets.java
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) {
View index.php
<?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');
View gist:6768787
wget http://nodejs.org/dist/node-latest.tar.gz
tar zxvf node-latest.tar.gz
cd node-v0.10.18/
./configure
make
make install
View gist:7163973
Status Code: 500
Exception: java.lang.NullPointerException
Stacktrace:
javax.servlet.ServletException: java.lang.NullPointerException
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:719)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
@jab416171
jab416171 / gist:7164949
Created Oct 26, 2013
git clone failing occassionally
View gist:7164949
SimpleGit: checking out
Clear Workspace enabled: deleting contents of /jenkins/workspace/Commit_pr.
- Executing: `/usr/bin/git clone git+ssh://attask@git.ops.ut.us.attask.com/attask .`
hudson.util.IOException2: remote file operation failed: /jenkins/workspace/Commit_pr at hudson.remoting.Channel@4274d50:commit-853
at hudson.FilePath.act(FilePath.java:901)
at hudson.FilePath.act(FilePath.java:878)
at com.joelj.jenkins.Git.executeCommand(Git.java:69)
at com.joelj.jenkins.Git.cloneRepo(Git.java:61)
at com.joelj.jenkins.SimpleGitScm.checkout(SimpleGitScm.java:88)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1369)
View MainActivity.java
package com.garagze;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
View bulk_register.py
#!/usr/bin/env python2
# python2 bulk_register.py < accounts.txt > registered.txt
# format accounts.txt like 'username:password:email'
import requests
import sys
accounts = [a.split(":") for a in sys.stdin.read().split("\n") if a.strip() != ""]
base = "https://feelinsonice.appspot.com"
for account in accounts:
View DrawingPanel.java
public class DrawingPanel extends SurfaceView implements SurfaceHolder.Callback {
private final Drawable mCustomImage;
@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
mCustomImage.setBounds(new Rect(0, 0, 50, 50));
mCustomImage.draw(canvas);
View monitorFreeSpace.sh
#!/bin/sh
#
# � 2010 Western Digital Technologies, Inc. All rights reserved.
#
# monitorVolume.sh
# Note: this is called by cron
#
#
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
You can’t perform that action at this time.