Pattern below allows for a bash script to be called via, say, cron and check to see if it is already running.
Useful for things like rsync
tasks.
PIDFILE=/var/run/myscriptname.pid
if [ -f $PIDFILE ]
then
PID=$(cat $PIDFILE)
Pattern below allows for a bash script to be called via, say, cron and check to see if it is already running.
Useful for things like rsync
tasks.
PIDFILE=/var/run/myscriptname.pid
if [ -f $PIDFILE ]
then
PID=$(cat $PIDFILE)
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
<?php | |
// Display variations dropdowns on shop page for variable products | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'woo_display_variation_dropdown_on_shop_page' ); | |
function woo_display_variation_dropdown_on_shop_page() { | |
global $product; | |
if( $product->is_type( 'variable' )) { | |
Picking the right architecture = Picking the right battles + Managing trade-offs
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
#!/bin/sh | |
# To the extent possible under law, Viktor Szakats | |
# has waived all copyright and related or neighboring rights to this | |
# script. | |
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/ | |
# SPDX-License-Identifier: CC0-1.0 | |
# THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
public class JSON2Java { | |
private static final ScriptEngine jsonParser; | |
static | |
{ | |
try | |
{ | |
String init = read(Tools.class.getResource("json2java.js")); | |
ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript"); |