Skip to content

Instantly share code, notes, and snippets.

View iPublicis's full-sized avatar

Lopo iPublicis

View GitHub Profile
@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 / malware-removal.sh
Created November 4, 2024 00:28 — forked from ThakurGumansingh/malware-removal.sh
This script will check for any htaccess present in wp folders and if exists, it will rename it and will create a new htaccess in root_dir with default rules and downloads core files.
#!/bin/bash
# Function to search and rename .htaccess files
search_and_rename_htaccess() {
local dir="$1"
if [ -f "$dir/.htaccess" ]; then
echo "Found .htaccess in $dir"
mv "$dir/.htaccess" "$dir/.htaccess-bak"
echo "Renamed to $dir/.htaccess-bak"
fi
@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 / 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 / trelloinstall.sh
Last active July 16, 2024 16:40
Install Trello Linux Client
#!/bin/bash
# Your system should be 64 bits and check if the last version at https://github.com/danielchatfield/trello-desktop/ is 0.19
# If the current version is not 0.19 change the file name below accordingly
wget https://github.com/Racle/trello-desktop/releases/download/v0.2.0/Trello-linux-0.2.0.zip -O trello.zip
sudo mkdir /opt/trello
sudo unzip trello.zip -d /opt/trello/
sudo ln -sf /opt/trello/Trello /usr/bin/trello
echo -e '[Desktop Entry]\n Version=1.0\n Name=Trello Desktop\n Exec=/usr/bin/trello\n Icon=/opt/trello/resources/app/static/Icon.png\n Type=Application\n Categories=Application' | sudo tee /usr/share/applications/trello.desktop
@iPublicis
iPublicis / emergency.php
Last active July 16, 2024 11:33 — forked from eduardopintor/emergency.php
Emergency Password Reset Script
<?php
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@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
#
@iPublicis
iPublicis / git-unmerged
Created May 29, 2020 19:05 — forked from agnoster/git-unmerged
Check to see if which commits are not shared between two branches
#!/bin/bash
BRANCH1=${1:-master}
BRANCH2=${2:-HEAD}
echo; echo "Only in $BRANCH1"
git cherry -v $BRANCH2 $BRANCH1
echo; echo "Only in $BRANCH2"
git cherry -v $BRANCH1 $BRANCH2
@iPublicis
iPublicis / README.md
Created May 1, 2020 15:27 — forked from kostasx/README.md
Using TensorFlow.js with MobileNet models for image classification on Node.js

USAGE:

$ node mobilenet-node.js ./model image.jpg