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
sudo curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
sudo source ~/.profile
sudo nvm install node
node --version
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
@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 / index.samle.html
Created April 15, 2017 20:30
Base html5 template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sample site</title>
<meta name="description" content="Sample site">
<meta name="author" content="SampleSite">
@stefgosselin
stefgosselin / gluu_installer
Created January 30, 2017 20:13
Gluu initial base install - centOS 7
#!/usr/bin/bash
#######################################
# Helper script to install gluu-server
########################################
GLUU_VERSION=2.4.4.2
wget https://repo.gluu.org/centos/Gluu-centos7.repo -O /etc/yum.repos.d/Gluu.repo
wget https://repo.gluu.org/centos/RPM-GPG-KEY-GLUU -O /etc/pki/rpm-gpg/RPM-GPG-KEY-GLUU
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-GLUU
@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;
});