Skip to content

Instantly share code, notes, and snippets.

View viktorsteinwand's full-sized avatar

Viktor Steinwand viktorsteinwand

View GitHub Profile
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
memory_usage=0; for line in `docker ps | awk '{print $1}' | grep -v CONTAINER`; do docker ps | grep $line | awk '{printf $NF" "}' && echo $(( `cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes` / 1024 / 1024 ))MB ; done
<?php
// Variables used in this script:
// $summary - text title of the event
// $datestart - the starting date (in seconds since unix epoch)
// $dateend - the ending date (in seconds since unix epoch)
// $address - the event's address
// $uri - the URL of the event (add http://)
// $description - text description of the event
// $filename - the name of this file for saving (e.g. my-event-name.ics)
//
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
@viktorsteinwand
viktorsteinwand / zsh.md
Last active August 29, 2015 14:20 — forked from tsabat/zsh.md

On the mac, edit /etc/exports and add a line like so:

"/Users/<username>/develop/" -network 10.211.55.0 -mask 255.255.255.0  -mapall=<username>

The network and mask parameters indicate what hosts we'll share with; in my case, this network is used by the parallels shared network adapter; yours may differ.

You may need to reload nfsd:

sudo nfsd update
@viktorsteinwand
viktorsteinwand / How to delete a remote git tag
Last active October 22, 2015 08:36
How to delete a remote git tag
If you have a tag named 'v1.0.1' then you need just do following:
git tag -d v1.0.1
git push origin :refs/tags/v1.0.1
@viktorsteinwand
viktorsteinwand / Easy access to composer docker image
Last active February 17, 2016 20:56
Easy access to composer/composer docker image
# This shell script can be used for easier accessing the composer/composer docker image (https://hub.docker.com/r/composer/composer/)
Create new composer file
```sh
sudo vim /usr/local/bin/composer
```
The contents of the file will look like this:
```sh
@viktorsteinwand
viktorsteinwand / Add docker-machine VM
Last active January 18, 2017 13:09
Add docker-machine VM
docker-machine create --driver virtualbox --virtualbox-disk-size "50000" -virtualbox-memory "4096" --virtualbox-cpu-count "4" default
@viktorsteinwand
viktorsteinwand / Windows-1252 to UTF-8 encoding
Created February 1, 2016 10:46
Convert enconding: Windows-1252 to UTF-8 encoding
iconv -f WINDOWS-1252 -t UTF-8 filename.txt