git format-patch -1 <sha>
OR
git format-patch -1 HEAD
git apply --stat file.patch
# show stats.
git apply --check file.patch
# check for error before applying
#!/bin/sh | |
# OpenWRT support libs | |
. /lib/functions.sh | |
. /lib/functions/network.sh | |
. /usr/share/libubox/jshn.sh | |
ip_regex="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" | |
ddns= | |
code= |
#!/bin/bash | |
# Use the script like this: | |
# . setphp 7.1 | |
# or | |
# source setphp 5.6 | |
# | |
# It will look for the path to the current PHP version in your PATH and switch to | |
# the new PHP version. | |
# If you do not have a path to a php version, then it will add one. |
const jsdom = require("jsdom"); | |
const { JSDOM } = jsdom; | |
const dom = new JSDOM('<!DOCTYPE html><html><head></head><body></body></html>'); | |
global.window = dom.window; | |
global.document = dom.window.document; | |
// Simulate window resize event | |
const resizeEvent = document.createEvent('Event'); |
# ======================================================== | |
# Setup a Dumb AP, Wired backbone for OpenWRT / LEDE | |
# ======================================================== | |
# Set lan logical interface as bridge (to allow bridge multiple physical interfaces) | |
uci set network.lan.type='bridge' | |
# assign WAN physical interface to LAN (will be available as an additional LAN port now) | |
uci set network.lan.ifname="$(uci get network.lan.ifname) $(uci get network.wan.ifname)" | |
uci del network.wan.ifname | |
# Remove wan logical interface, since we will not need it. | |
uci del network.wan |
#include <SimpleTimer.h> | |
//#define BLYNK_PRINT Serial // Comment this out to disable prints and save space | |
#include <BlynkSimpleEsp8266.h> | |
extern "C" { | |
uint16 readvdd33(void); | |
} | |
char auth[] = "fromBlynkApp"; | |
const char* ssid = "ssid"; |
How To Manage QMail Queue In Linux Plesk | |
Ref URL | |
---------------- | |
http://geeksterminal.com/qmail-commands-logs-plesk-server/580/ | |
https://www.24x7servermanagement.com/blog/how-to-manage-qmail-queue-in-linux-plesk/ | |
---------------- | |
1) To check the mail queue in plesk from command line, you can use the command : |
dhcp-script=/etc/detect_new_device.sh
Reference:
<?php | |
function add_combination($data){ | |
global $webService, $config; | |
try{ | |
$xml = $webService->get(array('url' => $config["ps_shop"].'api/combinations?schema=blank')); | |
$combination = $xml->children()->children(); | |
$combination->associations->product_option_values->product_option_values[0]->id = $data["option_id"]; | |
$combination->reference = $data["code"]; | |
$combination->id_product = $data["id_product"]; |
#!/bin/bash | |
# Disable root access via SSH | |
# USAGE: | |
# curl -Lo DisableRootAccessSSH https://gist.githubusercontent.com/NunoFilipeSantos/7eee84fcb40b52d5ede6332f902d1b1c/raw/DisableRootAccessSSH.sh | |
# chmod +x DisableRootAccessSSH | |
# ./DisableRootAccessSSH | |
perl -pi -e 's/PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config |