Skip to content

Instantly share code, notes, and snippets.

View qoomon's full-sized avatar
🌳
Go for it.

Bengt Brodersen qoomon

🌳
Go for it.
View GitHub Profile
@qoomon
qoomon / default.conf
Last active January 6, 2016 16:29
nginx subdomain to port config HTTP
# replace <ServiceSubDomain>
# replace <LocalPort>
server {
listen 80;
server_name <ServiceSubDomain>.*;
access_log off;
# Increase this to JIRA's maximum attachment size (10M by default)
client_max_body_size 10M;
@qoomon
qoomon / default.conf
Last active January 6, 2016 16:31
nginx subdomain to port config HTTPS
# replace <ServiceSubDomain>
# replace <LocalPort>
# replace <SslFileName>
server {
listen 443 ssl;
server_name <ServiceSubDomain>.*;
access_log off;
ssl_certificate /etc/ssl/certs/<SslFileName>.pem;
@qoomon
qoomon / keybase.md
Created August 12, 2016 10:37
Keybase proof

Keybase proof

I hereby claim:

  • I am qoomon on github.
  • I am qoomon (https://keybase.io/qoomon) on keybase.
  • I have a public key ASAZKCVD102Exu5sgIndvAuISX-y-3q9ouKfMUu0F-xK7Ao

To claim this, I am signing this object:

@qoomon
qoomon / git-clone-into-non-empty-directory.sh
Last active March 22, 2017 13:58 — forked from damondouglas/gitclone-nonempty.sh
Git clone into non-empty directory
#!/bin/sh
REPO_URL="$1"
TARGET_DIR="${2:-$(basename $REPO_URL .git)}"
SHADOW_DIR='.git.shadow'
cd $TARGET_DIR
git clone --no-checkout $REPO_URL $SHADOW_DIR
mv $SHADOW_DIR/.git .
rm -rf $SHADOW_DIR
@qoomon
qoomon / remove_logs.cron
Last active March 22, 2017 14:07
Crontab Job to remove old logging files
* * * * * find /var/log/process -type f -name '*.log.*' -mtime +7 -delete
@qoomon
qoomon / Git update hook
Last active July 18, 2017 15:19
Git update hook
#!/bin/sh
#
# An example hook script to block unannotated tags from entering.
# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
#
# To enable this hook, rename this file to "update".
#
# Config
# ------
# hooks.allowunannotated
@qoomon
qoomon / config
Last active September 4, 2017 10:16
~/.ssh/config
Host *.compute.amazonaws.com
User ec2-user
IdentityFile ~/.ssh/aws.pem
Host *.compute.internal
User ec2-user
IdentityFile ~/.ssh/aws.pem
Host *
IdentityFile ~/.ssh/id_rsa
@qoomon
qoomon / aws_ec2_userdata_builder.sh
Last active September 5, 2017 09:06
Build Directory Based AWS EC2 Userdata
#!/bin/sh
userdata=$(cat <<END
#!/bin/sh
echo '$(tar -cv userdata |gzip --best |base64)' |base64 -d |gzip -d |tar -xv
cd userdata
chmod u+x init.sh
./init.sh
END
)
@qoomon
qoomon / deploy_to_git.sh
Last active September 12, 2017 09:11
Deploy to Git
#!/bin/sh
set -e
if [ $# -ne 3 ]; then
echo "Usage: ... <SOURCE_FOLDER> <TARGET_REPO> <TARGET_BRANCH>"
exit 1;
fi
SOURCE_FOLDER="$1"
@qoomon
qoomon / git_create_orphan_branch.sh
Last active September 12, 2017 10:36
Create Git Orphan Branch
#!/bin/bash
BRANCH_NAME=$1
git checkout --orphan $BRANCH_NAME
git rm -rf .
rm -f '.gitignore'
echo "#$BRANCH_NAME" > README.md
git add README.md
git commit -a -m "Initial Commit"