Skip to content

Instantly share code, notes, and snippets.

View IchHabRecht's full-sized avatar

Nicole Hummel IchHabRecht

  • biz-design
  • Berlin, Germany
View GitHub Profile
@IchHabRecht
IchHabRecht / gist:6299817
Created August 21, 2013 20:30
[BASH] Sort directories by size
du -k | sort -nr
du -m | sort -nr
du -B 1024 | sort -nr
du -B 1048576 | sort -nr
du -B 1073741824 | sort -nr
@IchHabRecht
IchHabRecht / gist:6299846
Created August 21, 2013 20:33
[VCL] Basic Varnish configuration for TYPO3
sub vcl_recv {
# Set backend
set req.backend = default;
if (req.http.host ~ "gitweb.squeezebox.vm") {
return (pass);
}
# Set a unique cache header with client ip
if (req.http.x-forwarded-for) {
@IchHabRecht
IchHabRecht / gist:6299857
Created August 21, 2013 20:33
[TYPO3] Extbase eid bootstrap
<?php
/***************************************************************
* Copyright notice
*
* (c) 2011 Nicole Cordes <[email protected]>, CPS-IT GmbH
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@IchHabRecht
IchHabRecht / gist:6299898
Created August 21, 2013 20:36
[BASH] Enable git tab completion
# Enable current git branch to bash promt
# nano /root/.bashrc
if [ -f /etc/bash_completion.d/git ]; then
. /etc/bash_completion.d/git
fi
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w $(__git_ps1 "(%s)")\$ '
@IchHabRecht
IchHabRecht / gist:6299970
Created August 21, 2013 20:40
[APACHE] SSL certificate
Step 1: Generate a Private Key
openssl genrsa -des3 -out server.key 1024
Step 2: Generate a CSR (Certificate Signing Request)
openssl req -new -key server.key -out server.csr
Step 3: Remove Passphrase from Key
cp server.key server.key.old
openssl rsa -in server.key.old -out server.key
@IchHabRecht
IchHabRecht / gist:6300085
Created August 21, 2013 20:49
[WINDOWS] Enable host access for VMWare client
1) Ping
Name: Ping (public)
Protocol: ICMPv4
Specific ICMP types: echo request
Scope: IP range
2) Apache HTTP Server
Switch from deny to allow for both rules (TCP and UDP)
Set up IP scope
@IchHabRecht
IchHabRecht / gist:6300091
Created August 21, 2013 20:50
[BASH] Chroot bind9
/etc/init.d/bind9 stop
mkdir -p /var/chroot/bind9/{etc,dev,var/cache/bind,var/run/bind/run}
chown -R bind:bind /var/chroot/bind9/var/*
mknod /var/chroot/bind9/dev/null c 1 3
mknod /var/chroot/bind9/dev/random c 1 8
chmod 666 /var/chroot/bind9/dev/{null,random}
mv /etc/bind /var/chroot/bind9/etc
ln -s /var/chroot/bind9/etc/bind /etc/bind
chown -R bind:bind /etc/bind/*
nano /etc/default/bind9
@IchHabRecht
IchHabRecht / gist:6300101
Created August 21, 2013 20:50
[GIT] Replace commit date with author date
git filter-branch --env-filter 'GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE; export GIT_COMMITTER_DATE'
@IchHabRecht
IchHabRecht / gist:6300130
Created August 21, 2013 20:53
[GIT] Set author and commit date
GIT_AUTHOR_DATE='2013-02-18 17:45' GIT_COMMITTER_DATE='2013-02-18 17:45' git commit -m ""
@IchHabRecht
IchHabRecht / gist:6300141
Created August 21, 2013 20:54
[TYPO3] Alternating table classes
RTE {
## define table classes
classes.myCustomTable {
name = My custom table layout
alternating.rows {
# 0 = even, 1 = odd
startAt = 0
oddClass = row-odd