Skip to content

Instantly share code, notes, and snippets.

View marcoceppi's full-sized avatar
.

Marco Ceppi marcoceppi

.
View GitHub Profile
{"2011-10-07 20:40:35Z": {"gitlog": {"mem": 0.0, "cpu": 0.0, "exec": [{"duration": "0:00", "command": "svlogd"}]}, "marco": {"mem": 0.2, "cpu": 0.0, "exec": [{"duration": "0:00", "command": "sshd:"}, {"duration": "0:00", "command": "-bash"}]}, "seacrow": {"mem": 6.3, "cpu": 0.1, "exec": [{"duration": "0:46", "command": "Rails:"}]}, "root": {"mem": 3.4000000000000004, "cpu": 0.0, "exec": [{"duration": "0:03", "command": "init"}, {"duration": "0:00", "command": "/usr/sbin/vsftpd"}, {"duration": "0:06", "command": "/usr/sbin/sshd"}, {"duration": "0:01", "command": "runsvdir"}, {"duration": "0:00", "command": "runsv"}, {"duration": "0:00", "command": "cron"}, {"duration": "0:00", "command": "/usr/sbin/courierlogger"}, {"duration": "0:00", "command": "/usr/lib/courier/courier-authlib/authdaemond"}, {"duration": "0:00", "command": "/usr/sbin/courierlogger"}, {"duration": "0:00", "command": "/usr/sbin/couriertcpd"}, {"duration": "0:00", "command": "/usr/lib/courier/courier-authlib/authdaemond"}, {"duration": "0:00",
root@dagobah:/opt/usagelog# git remote add upstream git://github.com/sfstpala/Usage-Log.git
root@dagobah:/opt/usagelog# git pull upstream master
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 4 (delta 2), reused 4 (delta 2)
Unpacking objects: 100% (4/4), done.
From git://github.com/sfstpala/Usage-Log
* [new branch] master -> upstream/master
Updating 579e48e..0bb9624
Fast-forward
import json_rpc
import subprocess
import cherrypy
import os
import json
class Module (object):
@marcoceppi
marcoceppi / install
Created November 3, 2011 14:16 — forked from mmm/install
sun java on ubuntu
#!/bin/bash
juju-log "Adding Canonical Partner repository"
RELEASE_CODE=`lsb_release -sc`
add-apt-repository "deb http://archive.canonical.com/ ${RELEASE_CODE} partner"
apt-get update
apt-get -y install -qq --no-install-recommends debconf-utils
echo "sun-java6-plugin shared/accepted-sun-dlj-v1-1 boolean true" | debconf-set-selections
@marcoceppi
marcoceppi / test.foo
Created November 22, 2011 21:28
Test
Bar bar bar!
Drink Drink Drink!
@marcoceppi
marcoceppi / hooks-install
Created January 4, 2012 00:17
Debconf Example
debconf-set-selections tpl/debconf-selections
@marcoceppi
marcoceppi / minecraft.conf
Created April 20, 2012 11:48
These go in /etc/init envoked with service [minecraft|shelr.tv] [start|stop|restart|status]
# Minecraft upstart
# this script will start/stop Minecraft
description "Minecraft Server"
version "1.0"
author "Marco Ceppi"
env CPU_COUNT=1
env JAVA_ARGS="-Xmx1024M -Xms1024M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts"
env LOG="server.log"
<?php
session_start();
$si_prefix = array( 'B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB' );
$base = 1024;
if( !is_array($_SESSION['speed']) )
{
$_SESSION['speed'] = array('updated' => time(), 'old' => file_get_contents('/sys/class/net/eth0/statistics/rx_bytes'));
@marcoceppi
marcoceppi / gitlab_html.rb
Created July 2, 2012 16:00
Readme, wiki, and others choke when using code blocks.
--- a/lib/redcarpet/render/gitlab_html.rb
+++ b/lib/redcarpet/render/gitlab_html.rb
@@ -3,7 +3,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
if Pygments::Lexer.find(language)
Pygments.highlight(code, :lexer => language, :options => {:encoding => 'utf-8'})
else
- Pygments.highlight(code, :options => {:encoding => 'utf-8'})
+ Pygments.highlight(code, :lexer => 'bash', :options => {:encoding => 'utf-8'})
end
end
@marcoceppi
marcoceppi / Storage.php
Created July 15, 2012 23:39
Storage via Redis
<?php
/**
* Storage Engine Components
*
* @author Marco Ceppi <marco@ceppi.net>
* @package Amulet
* @subpackage Model
*/
/**