Skip to content

Instantly share code, notes, and snippets.

View lunix33's full-sized avatar
😁
Things are great!

Patrick Bergeron lunix33

😁
Things are great!
  • Biointelligence Technologies
  • Canada
  • X @lunix33
View GitHub Profile
@lunix33
lunix33 / up.sh
Last active March 5, 2020 14:05
Small function allowing to use `..` to go back a level. add a dot for each subsequent up. Simply source the file in bashrc.
#!/bin/bash
##
# This script allow to use a shorthand to navigate the directory structure.
# To use this script, simply source this script in your ~/.bashrc
#
# Examples:
# `..` : Move up by 1 directory.
# `....` : Move up by 3 directory.
# `.../hello_world`: Move up by 2 directory, then move into the directory `hello_world`.
@lunix33
lunix33 / .bash_ps1
Created February 5, 2020 07:58
Bash prompt displaying last command exit code, user, host, ssh and screen info, path and git info.
#!/bin/bash
# Load Git for Windows prompt.
if [ -f "/c/Program Files/Git/mingw64/share/git/completion/git-prompt.sh" ]; then
source "/c/Program Files/Git/mingw64/share/git/completion/git-prompt.sh"
fi
# colors
white='\[\033[1;37m\]'
gray='\[\033[1;30m\]'
@lunix33
lunix33 / conky.conf
Last active January 24, 2020 00:47
Simple monitor configuration for Conky.
--
-- Edit this section by filling in the information you want the monitor to display for specific section.
--
-- The title to display at the top of the monitor.
local title = "${nodename}"
-- The list of storage mount points to display.
-- Use `df` to see the list of drive with mount point.
local storageList = {"/", "/mnt/array"}
@lunix33
lunix33 / README.md
Last active September 20, 2019 23:17
Git bare automated deployment

Prelude

This guide will help you setup a bare git repository (essentially a repository which serves as a "server") to be able to automatically deploy its content when a push is received.

This can be useful if you have by example a web server (like bluehost or simple vps) where you which to deploy your code without setting up a full code deployment Pipeline through utilities like Jenkins.

The strategy used in this guide to automate the deployment is through the post-receive git hook.

The hook configuration is flexible and modular so you can split your deployment procedure through multiple files and it doesn't enforce a language as long as you can run the script with the first line as a shebang like this on the first line: #!/bin/bash (replace /bin/bash with the actual executable which should be used to run your script)

@lunix33
lunix33 / emby_install.js
Last active February 9, 2024 13:15
Installation and update script for emby
#!/usr/bin/env node
// Requires
const { execSync } = require('child_process'),
{ get } = require('https'),
{ writeFile, unlink } = require('fs').promises,
{ resolve } = require('path');
// Constants
const EMBY_GITHUB_URL = `https://api.github.com/repos/MediaBrowser/Emby.Releases/releases`,