Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Winther jippi

View GitHub Profile
@jippi
jippi / rc.d
Created Jul 5, 2011 — forked from vvuksan/gist:988765
Logstash Init script
View rc.d
update-rc.d logstash-shipper defaults
update-rc.d logstash-reader defaults
@jippi
jippi / logstash-shipper.pp
Created Jul 6, 2011
logstash puppet module
View logstash-shipper.pp
class package::logstash::shipper {
if !defined(Package['openjdk-6-jre']) {
package { 'openjdk-6-jre':
ensure => 'installed';
}
}
file {
"/opt/logstash/":
ensure => "directory",
View gist:1827525
<?php
echo $this->element('Crud/form', array(
'model' => 'FaxekondiVideo',
'columns' => array(
'name',
'description' => array('type' => 'textarea'),
1) 'video_asset_file_id' => array('element' => array('admin_form_selector', array('settings' => array('image' => false)), array('plugin' => 'Hest')))
if ($config['element']) {
echo call_user_func_array(array($this, 'element'), $config['element']);
}
@jippi
jippi / gist:1939271
Created Feb 29, 2012
Linode => Hetzner migration
View gist:1939271
export install, partition, sync, clean boot, install image, edit , reboot
ssh root@178.79.138.75 "dd if=/dev/xvdc " | dd of=/dev/sda1
find /etc -type f -exec sed -i s/178.79.138.75/176.9.207.38/g {} \;
Migration steps:
Linode Disk Partition: /dev/xvdb
Hetzner Disk Partition: /dev/sda
@jippi
jippi / gist:2478211
Created Apr 24, 2012
Nodes git config --system
View gist:2478211
[branch]
autosetuprebase = always
[color]
ui = true
diff = true
status = true
branch = true
interactive = true
[alias]
co = checkout
View wank.php
<?php
function safemode() { // jacked from Syrian Shell
$safe_mode = ini_get("safe_mode");
if (!$safe_mode) {
$safe_mode = 'off';
}
else {
$safe_mode = 'on'; // ...fuck
}
return $safe_mode;
View Model.diff
diff --git lib/Cake/Model/Model.php lib/Cake/Model/Model.php
index ab12d98..8049dd1 100644
--- lib/Cake/Model/Model.php
+++ lib/Cake/Model/Model.php
@@ -1438,10 +1438,12 @@ class Model extends Object implements CakeEventListener {
* @param mixed $data Optional data array to assign to the model after it is created. If null or false,
* schema data defaults are not merged.
* @param boolean $filterKey If true, overwrites any primary key input with an empty value
+ * @param array $options
* @return array The current Model::data; after merging $data and/or defaults from database
@jippi
jippi / sync.sh
Created May 11, 2012
Sync a github fork with all changes from the fork source
View sync.sh
#!/bin/sh
# Settings
#
fork_source_remote_name="origin"
my_form_remote_name="mine"
git_default_param=" -q "
#### Stolen from git flow ( https://github.com/nvie/gitflow/ ) ###
@jippi
jippi / build.xml
Created May 12, 2012
Ant / Jenkins / CakePHP build file
View build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="name-of-project" default="build-parallel">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdox,phpunit,phpcb"/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel" description="Run tools in parallel">
View fix.js
if (top == self) { // If we're not in an iframe:
// Redirecting to fanpage on Facebook
if (location.host.search(/\.like.st$/i) != -1) {
location = Nodes.config('fanpage') + '?sk=app_' + Nodes.config('app_id');
}
jQuery(document).ready(function() {
// Make sure there are scrollbars (for testing purposes):
jQuery('body').css('overflow', 'visible')
})