A Brief Introduction to Multi-Threading in PHP
- Foreword
- Execution
- Sharing
- Synchronization
- Pitfalls
#!/bin/bash | |
# SPDX-License-Identifier: MIT | |
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]> | |
## | |
## This script is licensed under the terms of the MIT license. | |
## https://opensource.org/licenses/MIT | |
# | |
# Lockable script boilerplate | |
/** | |
* Check if a given ip is in a network | |
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1 | |
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed | |
* @return boolean true if the ip is in this range / false if not. | |
*/ | |
function ip_in_range( $ip, $range ) { | |
if ( strpos( $range, '/' ) == false ) { | |
$range .= '/32'; | |
} |
SIPp Box | |
1. Download and Modify SIPp to auto respond always and include OPTIONS packet as well (-aa broken?), edit src/call.cpp: | |
call::T_AutoMode call::checkAutomaticResponseMode(char * P_recv) | |
{ | |
if (strcmp(P_recv, "BYE")==0) { | |
return E_AM_UNEXP_BYE; | |
} else if (strcmp(P_recv, "CANCEL") == 0) { | |
return E_AM_UNEXP_CANCEL; | |
} else if (strcmp(P_recv, "PING") == 0) { |
# ~/.tmux.conf | |
# use UTF8 | |
set -g utf8 | |
set-window-option -g utf8 on | |
# make tmux display things in 256 colors | |
set -g default-terminal "screen-256color" | |
# set scrollback history to 10000 (10k) | |
set -g history-limit 30000 |
#!/bin/sh | |
# setup ~/.pgpass to allow passwordless connection to postgres | |
# keep last 30 executions for each job | |
KEEP=30 | |
cd /var/lib/rundeck/logs/rundeck | |
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d` |
#!/bin/bash | |
instance_profile=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/` | |
aws_access_key_id=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep AccessKeyId | cut -d':' -f2 | sed 's/[^0-9A-Z]*//g'` | |
aws_secret_access_key=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep SecretAccessKey | cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g'` | |
token=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | sed -n '/Token/{p;}' | cut -f4 -d'"'` | |
file="somefile.deb" | |
bucket="some-bucket-of-mine" | |
date="`date +'%a, %d %b %Y %H:%M:%S %z'`" |
# Source: https://gist.github.com/6fb3e7da327df9203d9d4c184fcb5831 | |
############################################################################## | |
# Combining Argo CD (GitOps), Crossplane (Control Plane), And Kubevela (OAM) # | |
# https://youtu.be/eEcgn_gU3SM # | |
############################################################################## | |
# Referenced videos: | |
# - Argo CD - Applying GitOps Principles To Manage Production Environment In Kubernetes: https://youtu.be/vpWQeoaiRM4 | |
# - Cloud-Native Apps With Open Application Model (OAM) And KubeVela: https://youtu.be/2CBu6sOTtwk |