Skip to content

Instantly share code, notes, and snippets.

View larsar's full-sized avatar

Lars Preben Sørsdahl larsar

View GitHub Profile
@larsar
larsar / git_workflow.txt
Created April 3, 2011 11:16
My Git development workflow
# Based on http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html
# Start working on new feature/fix
git checkout -b <feature/fix branch name>
# On a regular basis, rebase against upstream
git fetch origin master
git rebase origin/master
# When feature/fix is finished, rebase and squash commits into fewer
@larsar
larsar / gist:1362913
Created November 13, 2011 23:34
Set textmate as Git editor
git config --global core.editor "mate -w"
@larsar
larsar / user_larstobi.pp
Created November 14, 2011 13:01 — forked from larstobi/user_larstobi.pp
Puppet user resource
class user_larstobi {
$user = "larstobi"
group { "$user":
ensure => present,
allowdupe => false,
}
user { "$user":
comment => "Lars Tobias Skjong-Borsting",
gid => "$user",
@larsar
larsar / gitolite.pp
Created November 14, 2011 13:02 — forked from larstobi/gitolite.pp
Gitolite manifest
file {
"/var/spool/gitolite":
ensure => directory,
owner => "git",
group => "git";
"admin.pub":
ensure => present,
path => "/var/spool/gitolite/admin.pub",
content => "ssh-rsa AAAAB3NzaC1...bmhLcxczOQ== admin@example.net";
@larsar
larsar / selinux-create-policy
Created November 14, 2011 14:46
Creating SELinux policy for failing stuff
For instance Puppet server will not start under RHEL SELinux. Try to start it, then run the following script. Continue this cycle until it starts. It will probably work for different SELinux challenges as well.
The script requires:
$yum install policycoreutils-python
cd /tmp && \
cat /var/log/audit/audit.log | audit2allow -m puppetmaster > puppetmaster.te && \
checkmodule -M -m puppetmaster.te -o puppetmaster.mod && \
semodule_package -m puppetmaster.mod -o puppetmaster.pp && \
semodule -i puppetmaster.pp
@larsar
larsar / gist:1408962
Created November 30, 2011 12:52
SSH not using authorized_keys with SELinux
restorecon -R -v /home
Source: http://blog.natesilva.com/post/9618889334/in-centos-linux-6-0-you-cant-ssh-using
@larsar
larsar / openssl
Created January 26, 2012 09:24
OpenSSL notes
# Display certs for a server
openssl s_client -showcerts -connect <host.domain>:<port>
@larsar
larsar / shared_folder_centos_virtualbox.txt
Created January 27, 2012 08:04
Mount shared folder on CentOS in VirtualBox
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel make
reboot
@larsar
larsar / gist:2666576
Created May 12, 2012 13:42
Push different branch to heroku
git checkout -n new_branch
git push heroku +HEAD:master
git push -f heroku HEAD:master
Source: http://stackoverflow.com/questions/2971550/how-to-push-different-local-git-branches-to-heroku-master
@larsar
larsar / heroku_deployment_workflow
Created October 11, 2012 18:24
Heroku deployment workflow
Gjenskape produksjon:
Backup av staging og prod database:
heroku pgbackups:capture --remote staging
heroku pgbackups:capture --remote production
Clean staging-database:
heroku pg:reset DATABASE_URL --remote staging