Skip to content

Instantly share code, notes, and snippets.

@mtrl
mtrl / .htaccess
Created November 17, 2011 11:16
CodeIgniter .htaccess
# Customized error messages.
ErrorDocument 404 /index.php
# Set the default handler.
DirectoryIndex index.php
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
@mtrl
mtrl / .gitignore
Created November 17, 2011 11:17
Eclipse .gitignore
.buildpath
.project
.settings
.DS_Store
@mtrl
mtrl / gist:1623350
Created January 16, 2012 22:19
Tridion .Net template DLLs, imports, post build
DLLs
-----
C:\Program Files\Tridion\bin\client\Tridion.Common.dll
C:\Program Files\Tridion\bin\client\Tridion.ContentManager.dll
C:\Program Files\Tridion\bin\client\Tridion.ContentManager.Publishing.dll
C:\Program Files\Tridion\bin\client\Tridion.ContentManager.Templating.dll
-----
Post build
-----
"$(SolutionDir)/TcmUploadAssembly.exe" /verbose /folder:tcm:5-29-2 /targeturl:http://localhost:81 /username:Administrator /password:Capgemini /uploadpdb:true "$(TargetFileName)"
@mtrl
mtrl / gitdailystatus.sh
Created March 12, 2012 11:04
Daily gitosis status
#!/bin/sh
LOGFILE=/home/git/gitdailystatus.log
RECIPIENT=you@domain.com
echo '' > $LOGFILE
for f in /home/git/repositories/*
do
cd $f
echo "-----------" >> $LOGFILE
pwd >> $LOGFILE
git log --since=`date --date='today' +%Y-%m-%d` --until=`date --date='tomorrow' +%Y-%m-%d`--date-order >> $LOGFILE
@mtrl
mtrl / gist:2291190
Created April 3, 2012 11:35
Mac - Mount ISO to bootable USB
$ diskutil list
and it returns something like
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 999.9 GB disk0s2
/dev/disk1
@mtrl
mtrl / gist:2724148
Created May 18, 2012 09:06
ffmpeg - FLAC to m4a
for i in *.flac; do ffmpeg -i "$i" -acodec alac "`basename "$i" .flac`.m4a"; done;
@mtrl
mtrl / gist:2935445
Created June 15, 2012 08:36
VNC over SSH
On client open a terminal and “ssh -L 5902:localhost:[remote-port(usually 5900) [user]@[server]”
Open VNC client and connect to display 2 on localhost, specify password if needed
@mtrl
mtrl / gist:2955001
Created June 19, 2012 16:08
Rsync resume and progress
rsync -P [local files] -e ssh [user]@[remote]:[remote location]
@mtrl
mtrl / .vimrc
Created July 31, 2012 11:16
My .vimrc file
set background=dark
set hlsearch
" Use incremental searching
set incsearch
" Set standard setting for PEAR coding standards
set tabstop=4
set shiftwidth=4
@mtrl
mtrl / gist:4683489
Created January 31, 2013 15:09
MS SQL 2008. Create new database from .bak file
From http://codeonaboat.wordpress.com/2012/02/16/sql-server-2008-creating-a-database-from-a-bak-file/
If that’s where you are stuck, the following will help you.
1. In SSMS, open a query window in the master database of the database server. That’s where you will run the following queries.
2. See what the “LogicalName” of the database that has been backed up in the .bak file is
RESTORE FILELISTONLY
FROM DISK = 'c:\tmp\tridioncm.bak'