Skip to content

Instantly share code, notes, and snippets.

View paulchabotca's full-sized avatar
🤓
Javascript, PHP, Python, Bash, Regex

Paul Chabot paulchabotca

🤓
Javascript, PHP, Python, Bash, Regex
View GitHub Profile
@mattbell87
mattbell87 / create-mysql.bash
Last active May 7, 2024 01:07 — forked from omeinusch/create-mysql.bash
Simple bash script to create mysql db, user with generated password
#!/bin/bash
echo "Creating MySQL user and database"
PASS=$2
if [ -z "$2" ]; then
PASS=`openssl rand -base64 8`
fi
mysql -u root <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
@lazyfrosch
lazyfrosch / docker-cleanup.sh
Created March 6, 2018 07:32
Docker Cleanup for dangling images and volumes, but keep named volumes
#!/bin/bash
RC=0
IMAGES=($(docker images -q -f dangling=true))
VOLUMES=($(docker volume ls -q -f dangling=true))
if [ "${#IMAGES[@]}" -ne 0 ]; then
for image in "${IMAGES[@]}"
do
@sheharyarn
sheharyarn / bash-boilerplate.sh
Created October 29, 2016 21:51
Bash Script Boilerplate code
#!/usr/bin/env bash
# Bash3 Boilerplate. Copyright (c) 2014, kvz.io
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
# Set magic variables for current file & dir
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@samsheffield
samsheffield / UnityCodingCheatSheet.txt
Last active November 13, 2024 10:12
Unity C# Cheat Sheet
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin [email protected]:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@julienbourdeau
julienbourdeau / prestashop.conf
Created May 4, 2016 14:23
PrestaShop Nginx Configuration
server {
listen 80;
listen [::]:80; #Use this to enable IPv6
server_name www.example.com;
root /var/www/prestashop17;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.php index.html;
@devynspencer
devynspencer / minimal.ks.cfg
Last active October 24, 2022 03:05
Minimal Kickstart template for Centos 7.x
#
# configure installation settings
install
cdrom
lang en_US.UTF-8
keyboard us
timezone UTC
unsupported_hardware
text
@ErisDS
ErisDS / examples.md
Last active July 2, 2024 23:52
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

@P7h
P7h / jdk_download.sh
Last active July 31, 2024 06:46
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@davidonet
davidonet / agent
Last active February 15, 2018 05:22
Using ElectricImp to pilot LPD8806 ledstrip from a webpage
function requestHandler(request, response) {
try {
if ("color" in request.query) {
local ledState = request.query.color.tointeger();
local sleep=10;
if ("sleep" in request.query){
sleep = request.query.sleep.tointeger();
}
params<-{"color":ledState,"sleepTime":sleep};