Skip to content

Instantly share code, notes, and snippets.

View iPublicis's full-sized avatar

Lopo iPublicis

View GitHub Profile
@iPublicis
iPublicis / myapp-node-watcher.path
Last active October 31, 2024 12:55
NODE.JS app as a systemd service with CI controller
#########
# File: myapp-node-watcher.path
#
# Save this to /etc/systemd/system/
# Run systemctl enable myapp-node-watcher.path && systemctl daemon-reload && systemctl start myapp-node-watcher.path
#
[Path]
PathModified=/home/myuser/myappdir/public_html
[Install]
@iPublicis
iPublicis / .htaccess
Last active November 4, 2024 00:57
NODE.JS app in Apache - force www. and https: sample .htaccess, skip images or other files desired - partialy based on vielhuber/.htaccess
#########################
#
# NODE.JS app running in Apache
# sample .htaccess - partialy based on vielhuber/.htaccess
# Read also https://gist.github.com/vielhuber/f2c6bdd1ed9024023fe4
# Also rules to enforce www. prefix and https: SSL access and avoid extra processing for any file defined.
#
# This file must be on the dir where Apache expects to find the website
# The Node App can be anywhere else but must be accessible as explained below.
#
@iPublicis
iPublicis / .htaccess
Created January 31, 2019 17:21 — forked from vielhuber/.htaccess
Apache: htaccess force www and https ssl #server
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
@iPublicis
iPublicis / create_gif.sh
Created January 7, 2019 15:34 — forked from EmmanuelKasper/create_gif.sh
Create gif file with avconf
#export frames
avconv -i hatari.avi -vf fps=10 frames/ffout%03d.png
#assemble frames a gif
convert -loop 0 frames/ffout0*.png new.gif
@iPublicis
iPublicis / EnsureQueueListenerIsRunning.php
Last active October 31, 2024 14:37 — forked from ivanvermeyen/EnsureQueueListenerIsRunning.php
Ensure that the Laravel queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
@iPublicis
iPublicis / cpanel_remove_all_email_accounts.sh
Last active December 6, 2018 13:47
cPanel mass delete e-mail accounts script
#!/bin/bash
##########################
#
# Taken from https://forums.cpanel.net/threads/mass-delete-e-mail-accounts-script.387802/
# Created by QuizKnows - https://forums.cpanel.net/members/quizknows.178313/
#
if [ -z $2 ]
then
@iPublicis
iPublicis / chmodr.sh
Created December 4, 2018 23:19 — forked from francisbyrne/chmodr.sh
Recursive chmod script for dirs and/or files
#!/bin/sh
#
# chmodr.sh
#
# author: Francis Byrne
# date: 2011/02/12
#
# Generic Script for recursively setting permissions for directories and files
# to defined or default permissions using chmod.
#
@iPublicis
iPublicis / xkcd_pw.js
Last active March 21, 2019 13:09
Create XKCD password - taken from https://web.cs.dal.ca/~dneil/xkcdPassword.php
//-------------------------------------------------------------------
// Altered 2014, Derek Neil
// add functionality on controlling final output
//-------------------------------------------------------------------
//-------------------------------------------------------------------
// Copyright (c) 2011, Jeff Preshing
// http://preshing.com/20110811/xkcd-password-generator
// All rights reserved.
@iPublicis
iPublicis / xkcd-password.php
Created November 28, 2018 23:06 — forked from BinaryKitten/xkcd-password.php
xkcd-password-wordpress.php
<?php
/*
* Generate xkcd style password from /usr/share/dict/words
*
* http://xkcd.com/936/
* apt-get install wamerican
*/
if (!function_exists('wp_generate_password')) :
$filesize = @filesize('/usr/share/dict/words');
if ($filesize !== false):
@iPublicis
iPublicis / .bash_aliases
Last active January 29, 2021 16:12 — forked from romanitalian/.bashrc
Console aliases for .bash_aliases to include in .bashrc
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them directly in .bashrc.
#
# if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
# fi
#
# Reload bash with this command: . ~/.bashrc
#