Use redis-cli
interactive shell without installing redis on your host machine, using docker.
The following assumes you have docker engine or desktop up and running.
Add the following line to your bash profile (~/.bash_profile
or ~/.bashrc
)
<?php | |
// @see https://medium.com/@elhardoum/2a442e04bb2f | |
function get_redis() : \Redis { | |
static $redis; | |
if ( null === $redis ) { | |
$redis = new \Redis(); | |
$redis->connect('0.0.0.0', 6379); |
{ | |
"name": "New Tab", | |
"version": "1.0", | |
"description": "Load a simple and blank new tab for google chrome.", | |
"manifest_version": 3, | |
"chrome_url_overrides": { | |
"newtab": "./tab.html" | |
} | |
} |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace LearningActivity1 | |
{ | |
public class Book | |
{ | |
public string Name { get; set; } | |
public string Author { get; set; } |
/** | |
* Please change your nodebalancer configuration in `payload` line 6, and clusters configurations | |
* in lines 13 and 19 | |
* | |
* This must be run within cloud.linode.com/ dashboard, ideally via DevTools > Console (or snippets) | |
*/ | |
const payload = { "protocol": "tcp", "proxy_protocol": "none", "algorithm": "source", "stickiness": "table", "check": "none", "check_interval": 5, "check_timeout": 3, "check_attempts": 2, "port": 443, "check_passive": true, "cipher_suite": "recommended", "nodes": [] } | |
, ips = [] // a list of your IP addresses | |
, promises = [] |
(async () => | |
{ | |
/* | |
* Remember to login to linode dashboard, and from there open the devtools > console and run this code. | |
*/ | |
console.log('Fetching linodes...') | |
const linodes = await fetch('https://cloud.linode.com/api/v4/linode/instances/?page_size=100', { | |
headers: { | |
authorization: localStorage.getItem('authentication/token'), |
const game_elem = document.getElementById('game') | |
, game = JSON.parse(JSON.stringify(new Array(game_elem.childElementCount-1).fill( | |
new Array(game_elem.children[0].childElementCount).fill(null) | |
))) | |
const colors = { 1: 'red', 2: 'green' } | |
, color_style = document.getElementById('bg-styles') | |
, status = document.getElementById('status') | |
let current_player = 1 |
// call fileUploadRequestHandler( req, res ) from http.createServer callback context | |
// change ./files references to your files directory name | |
async function fileUploadRequestHandler( req, res ) | |
{ | |
const fs = require(fs), path = require('path') | |
// update the file name/ext here to a random or dynamic one (e.g supplied from querystring) | |
const filename = 'example.txt' |
<?php | |
// temporarily disable post_title matching for wp query search | |
add_filter('posts_where_paged', $disablePostTitleSearch=function( string $sql ) | |
{ | |
return str_replace('.post_title LIKE ', '.post_content LIKE ', $sql); | |
}); | |
// now query posts | |
$posts = query_posts([ |
#!/usr/bin/env sh | |
host="www.example.com" | |
ips=( | |
93.184.216.34 | |
) | |
for ip in "${ips[@]}"; do | |
curl -H "Host: $host" "https://$ip/" -kIs |grep 200\ OK >/dev/null && ( | |
echo "\033[0;32m[✓] $ip\t(passed)" |