Skip to content

Instantly share code, notes, and snippets.

@nexeck
nexeck / greyhole.conf
Created January 28, 2012 18:46
greyhole.conf
db_engine = mysql
db_host = localhost
db_user = greyhole
db_pass = Oiu4VUrZ
db_name = greyhole
email_to = fo3nik5@mbeck.org
log_level = INFO
greyhole_log_file = /var/log/greyhole.log
delete_moves_to_trash = 1
balance_modified_files = 0
@nexeck
nexeck / smb.conf
Created January 28, 2012 18:46
smb.conf
#======================= Global Settings =======================
[global]
workgroup = WORKGROUP
server string = %h server
include = /etc/samba/dhcp.conf
dns proxy = no
log level = 0
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
/var/www/*/*/logs/access.log /var/www/*/*/logs/error.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
@nexeck
nexeck / gist:1445217
Created December 7, 2011 23:12
Greyhole Initial Import MySQL
CREATE DATABASE IF NOT EXISTS `greyhole`;
GRANT USAGE ON * . * TO 'greyhole'@'localhost' IDENTIFIED BY 'some_pass' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
GRANT ALL PRIVILEGES ON `greyhole` . * TO 'greyhole'@'localhost';
CREATE TABLE IF NOT EXISTS `greyhole`.`settings` (
`name` TINYTEXT NOT NULL,
`value` TEXT NOT NULL,
PRIMARY KEY ( `name`(255) )
@nexeck
nexeck / git_history.php
Created November 24, 2011 15:01 — forked from geeknam/git_history.php
Parse git log with PHP to an array
<?php
// Author: Ngo Minh Nam
$dir = "/path/to/your/repo/";
$output = array();
chdir($dir);
// Linux
exec("git log",$output);
// Windows
exec('"C:\Program Files (x86)\Git\bin\git.exe" ' ."log", $output);
@nexeck
nexeck / select.php
Created October 21, 2011 06:42
formo view select with disabled attribute for readonly
<?php echo $open; ?>
<label<?php if ($id = $this->attr('id')) echo ' for="'.$id.'"'; ?>>
<?php echo $label; ?>
<span class="field">
<?php if ($this->editable() === TRUE): ?>
<?php echo $this->open(); ?>
<?php else: ?>
<?php $this->attr('disabled', 'disabled'); ?>
<?php echo $this->open(); ?>
<?php endif; ?>
@nexeck
nexeck / gist:1257411
Created October 2, 2011 12:38 — forked from daGrevis/gist:1257357
Route for mini-CMS
<?php
Route::set('cms', function($uri) {
$is_empty = empty($uri);
$does_exists = class_exists('Controller_' . $uri);
if ($is_empty || $does_exists) {
$default_route = Route::get('default');
<?php
Route::set('cms', function($uri) {
if (empty($uri))
{
$default_route = Route::get('default');
$controller = Arr::get($default_route->defaults(), 'controller');
$action = Arr::get($default_route->defaults(), 'action');
@nexeck
nexeck / bootstrap.php
Created September 26, 2011 16:57
Kohana v3.2 Bootstrap for multiple environment configs
<?php defined('SYSPATH') or die('No direct script access.');
// -- Environment setup --------------------------------------------------------
// Load the core Kohana class
require SYSPATH.'classes/kohana/core'.EXT;
if (is_file(APPPATH.'classes/kohana'.EXT))
{
// Application extends the core
@nexeck
nexeck / gist:1216085
Created September 14, 2011 08:14
Kohana Valid Date Less Than
/**
* Kleiner Als Methode
*
* @static
* @param $validation
* @param $field1
* @param $field2
* @param $field2_name string Wird für den Fehlertext benutzt, und sollte die Bezeichnung des Feld1 beinhalten
* @return bool
*/