Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh -eu
keys=`redis-cli keys '*'`
if [ "$keys" ]; then
echo "$keys" | while IFS= read -r key; do
type=`echo | redis-cli type "$key"`
case "$type" in
string) value=`echo | redis-cli get "$key"`;;
hash) value=`echo | redis-cli hgetall "$key"`;;
set) value=`echo | redis-cli smembers "$key"`;;
list) value=`echo | redis-cli lrange "$key" 0 -1`;;
@anhtuan3996
anhtuan3996 / gist:cbdacf5a44a44e1c4400be32c4e61f9b
Created February 24, 2023 08:52 — forked from mikeyk/gist:1329319
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.box {
width: 100px;
@anhtuan3996
anhtuan3996 / README.txt
Created July 27, 2022 13:05
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.17+commit.bdeb9e52.js&optimize=false&runs=200&gist=
REMIX DEFAULT WORKSPACE
Remix default workspace is present when:
i. Remix loads for the very first time
ii. A new workspace is created with 'Default' template
iii. There are no files existing in the File Explorer
This workspace contains 3 directories:
1. 'contracts': Holds three contracts with increasing levels of complexity.
@anhtuan3996
anhtuan3996 / README.txt
Created April 28, 2022 07:02
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@anhtuan3996
anhtuan3996 / event-loop.md
Created September 11, 2021 02:08 — forked from EryouHao/event-loop.md
Depth in Event Loop, both browser and Node.js.

Depth in Event Loop

For those JavaScript programmers, event loop is an important concept, inevitably.

Literally, event loop is what JavaScritp uses to implement non-blocking execution. Understanding how the event loops works internally would benefit you a lot when programming in JavaScript.

There are two major environments JavaScript runs in: browser and Node.js.

Browser

@anhtuan3996
anhtuan3996 / stress.sh
Created August 22, 2021 15:32 — forked from mikepfeiffer/stress.sh
Install Stress Utility on Amazon Linux 2
sudo amazon-linux-extras install epel -y
sudo yum install stress -y
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
@anhtuan3996
anhtuan3996 / amazon-ec2-ftp.md
Created July 14, 2021 06:29 — forked from gunjanpatel/amazon-ec2-ftp.md
amazon ec2 LAMP and FTP installation and setup
@anhtuan3996
anhtuan3996 / ISO currencies
Created June 17, 2021 03:18 — forked from jorgsowa/ISO currencies
Table with all currencies for MySQl database
# List of currencies based on the official ISO standard
# https://www.currency-iso.org/en/home/tables/table-a1.html
CREATE TABLE `currencies` (
country VARCHAR(100),
currency VARCHAR(100),
code VARCHAR(4),
minor_unit SMALLINT,
symbol VARCHAR(100)
);