Skip to content

Instantly share code, notes, and snippets.

View stefgosselin's full-sized avatar

Stephane Gosselin stefgosselin

  • Saint-Eugène-De-Guiges
View GitHub Profile
@stefgosselin
stefgosselin / restart-ssh.bash
Created December 16, 2022 16:05 — forked from influx6/restart-ssh.bash
Restart SSH on Mac Terminal (High Sierra)
# high sierra
sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd
# latest
sudo vim /etc/services # (update the port config for ssh and save)
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
@stefgosselin
stefgosselin / best_bash_history.sh
Created December 8, 2022 22:09 — forked from ckabalan/best_bash_history.sh
The Best Bash History Settings Ever
# /etc/profile.d/best_bash_history.sh
# Save 5,000 lines of history in memory
HISTSIZE=10000
# Save 2,000,000 lines of history to disk (will have to grep ~/.bash_history for full listing)
HISTFILESIZE=2000000
# Append to history instead of overwrite
shopt -s histappend
# Ignore redundant or space commands
HISTCONTROL=ignoreboth
# Ignore more
@stefgosselin
stefgosselin / phplint.sh
Created September 28, 2017 18:04 — forked from mathiasverraes/phplint.sh
Recursive PHP Lint script
#!/bin/bash
for file in `find .`
do
EXTENSION="${file##*.}"
if [ "$EXTENSION" == "php" ] || [ "$EXTENSION" == "phtml" ]
then
RESULTS=`php -l $file`
@stefgosselin
stefgosselin / docker-ci-tool-stack.sh
Created June 26, 2017 16:26 — forked from marcelbirkner/docker-ci-tool-stack.sh
Getting started with docker CI tool stack
git clone git@github.com:marcelbirkner/docker-ci-tool-stack.git
cd docker-ci-tool-stack
docker-compose up
@stefgosselin
stefgosselin / generate-compose.sh
Created November 24, 2016 21:28 — forked from lalyos/generate-compose.sh
generate docker-compose.yml by inspecting a running container
docker-yml() {
docker inspect -f $'
{{.Name}}
image: {{.Config.Image}}
entrypoint: {{json .Config.Entrypoint}}
environment: {{range .Config.Env}}
- {{.}}{{end}}
' $1
}
@stefgosselin
stefgosselin / l.php
Created March 8, 2014 16:32 — forked from adriengibrat/l.php
Autoload in include path
<?php
//set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); // optional
spl_autoload_register(function ($class) {
$file = preg_replace('#\\\|_(?!.+\\\)#','/', $class) . '.php';
if (stream_resolve_include_path($file))
require $file;
});

unicorn config file

Edit file /home/gitlab/gitlab/config/unicorn.rb

Find line listen "#{app_dir}/tmp/sockets/gitlab.socket" and comment it. Uncomment line listen "127.0.0.1:8080"

required modules for apache

  • sudo a2enmod proxy
  • sudo a2enmod proxy_http
(function ($) {
Drupal.behaviors.myModule = {
attach: function (context) {
// Code ...
}
}
})(jQuery);