Skip to content

Instantly share code, notes, and snippets.

Joseph Bass jab416171

View GitHub Profile
@jab416171
jab416171 / myuser.sls
Last active Aug 29, 2015
sls file for adding a user
View myuser.sls
myuser:
user:
- present
- uid: 1234
- gid: 1234
- remove_groups: False
- password: $6$asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
- shell: /bin/bash
- home: /home/myuser
- require:
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
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 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 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;
@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 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)
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 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 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) {
You can’t perform that action at this time.