Skip to content

Instantly share code, notes, and snippets.

View killerwolf's full-sized avatar

Hamdi LAADHARI killerwolf

View GitHub Profile
@MinDBreaK
MinDBreaK / .env
Last active January 19, 2024 18:02
Simple Hashicorp Vault Parameter Resolver for Symfony
# Your env var to resolve : kvStore:key[:version]
VAULT_TEST=api:test
@travishegner
travishegner / haproxy2apache
Last active May 6, 2022 15:44
A quick bash one liner to convert haproxy logs to something like apache logs so that logstalgia can read them
tail -f log | stdbuf -o0 awk '{print $9" "$6" - - "$7" "$18" "$19" "$20" "$11" "$12}' | sed -u "s/:[0-9]\{4,5\}//g" | sed -u "s/\(:[0-6][0-9]\)\.[0-9]\{3\}/\\1 -400/g" | logstalgia --sync --paddle-mode vhost
@Mika-
Mika- / gist:185c8d777aab3ebba548
Created February 11, 2015 15:26
Resize and convert image to web optimized jpg with imagemagick and mozjpeg
convert source.png -resize 1920x1080 -background white -flatten TGA:- | cjpeg -quality 90 -targa -outfile compressed.jpg
@rothgar
rothgar / main.yml
Last active March 8, 2024 07:16
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@jcaraballo
jcaraballo / git-branch-between-different-repositories.md
Created March 6, 2012 01:05
How to fork a github repository in bitbucket

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync