Skip to content

Instantly share code, notes, and snippets.

View knibals's full-sized avatar

Oumar Fall knibals

View GitHub Profile
@knibals
knibals / php-cs-fixer-pre-commit.php
Created October 22, 2017 17:44 — forked from mardix/php-cs-fixer-pre-commit.php
A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*
@knibals
knibals / composer.json
Created October 22, 2017 17:45 — forked from Glutnix/composer.json
Checking PSR-2 validation with PHPCS using a pre-commit git hook.
{
"require-dev": {
"squizlabs/php_codesniffer": "2.0.*@dev"
},
"scripts": {
"post-install-cmd": [
"bash contrib/setup.sh"
]
}
}
@knibals
knibals / git-pre-receive-hook.sh
Created October 31, 2017 15:46 — forked from caniszczyk/git-pre-receive-hook.sh
A reasonable git pre-receive-hook
#!/bin/sh
#
# For each ref, validate the commit.
#
# - It disallows deleting branches without a /.
# - It disallows non fast-forward on branches without a /.
# - It disallows deleting tags without a /.
# - It disallows unannotated tags to be pushed.
@knibals
knibals / docker-image-size.sh
Created May 11, 2018 12:16 — forked from andyrbell/docker-image-size.sh
Sort docker images by size desc
#!/bin/sh
docker images --format '{{.Size}}\t{{.Repository}}\t{{.Tag}}\t{{.ID}}' | sed 's/ //' | sort -h -r
@knibals
knibals / GitConfigHttpProxy.md
Created September 28, 2018 10:09 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

##In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

---
layout: post
section-type: post
title: Casually using a Proxy with Bash on Ubuntu on Windows
category: Win10
tags: [microsoft, canonical, windows, windows 10, bash, ubuntu, proxy, session, logon, enterprise, company, network]
---
With the **Microsoft Windows 10 Anniversary Update (1607)** we also got an integrated *Linux Subsystem* and the so called [Bash on Ubuntu on Windows], providing us with a familiar Bash shell and Linux environment in which you can run most Linux command-line tools, directly on Windows, **unmodified**, without needing an entire Linux virtual machine.
As I'm using my Surface Pro 4 within our company network as well as at home, I need to use a proxy-server only occasionally and wanted an easy method to switch it within the Bash.
@knibals
knibals / keybase.md
Last active September 22, 2019 11:56

Keybase proof

I hereby claim:

  • I am knibals on github.
  • I am knibals (https://keybase.io/knibals) on keybase.
  • I have a public key ASAt-c3vDWMV9XL6kUSeazJZGL7IJPKY6MjhzstWpkJS6Ao

To claim this, I am signing this object:

@knibals
knibals / drupal_nginx_config
Created January 4, 2020 00:42
The Nginx virtualhost for Drupal sites
server {
server_name example.com;
root /var/www/drupal8;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
@knibals
knibals / WHOIAM.md
Created May 28, 2020 12:57
Mon CV sur Github

Hi I'm Oumar and I'm a digital plumber

@knibals
knibals / HAProxy_self-signed_certificate.txt
Last active September 20, 2020 12:02 — forked from yuezhu/gist:47b15b4b8e944221861ccf7d7f5868f5
Generate self-signed certificate for HAProxy
# Generate a unique private key (KEY)
sudo openssl genrsa -out mydomain.key 2048
# Generating a Certificate Signing Request (CSR)
sudo openssl req -new -key mydomain.key -out mydomain.csr
# Creating a Self-Signed Certificate (CRT)
openssl x509 -req -days 365 -in mydomain.csr -signkey mydomain.key -out mydomain.crt
# Append KEY and CRT to mydomain.pem