Stress test with 50 requests per second
autocannon -r 50 --renderStatusCodes [ENDPOINT]
import { | |
AccountMeta, | |
ComputeBudgetProgram, | |
Connection, | |
Keypair, | |
LAMPORTS_PER_SOL, | |
PublicKey, | |
SystemProgram, | |
TransactionMessage, | |
VersionedTransaction, |
export type Token = { | |
protocol: string; | |
symbol: string; | |
token: string; | |
icon?: string; | |
chain?: string; | |
decimals?: number; | |
chainId?: string; | |
priceUsd?: number; | |
isBlocked?: boolean; |
Stress test with 50 requests per second
autocannon -r 50 --renderStatusCodes [ENDPOINT]
import { LCDClient, MsgExecuteContract } from "@terra-money/terra.js"; | |
const LCD_URL = "[LCD-ENDPOINT-HERE]"; | |
const CHAIN_ID = "neutron-1"; | |
const DEFAULT_GAS_PRICE = "0.02uatom"; | |
const DEFAULT_GAS_MULTIPLIER = 1.3; | |
(async function () { | |
const multisig = "[MS-ADDRESS-HERE]"; | |
console.log("Neutron: Simulating tx with address", multisig); |
import Mnemonic from "bitcore-mnemonic" | |
import { | |
BaseAccount, | |
ChainRestAuthApi, | |
createTransactionAndCosmosSignDoc, | |
PrivateKey, | |
TxRestApi, | |
InjectiveDirectEthSecp256k1Wallet, | |
hexToBuff, | |
createTxRawFromSigResponse, |
[ | |
{ | |
"label": "American Samoa", | |
"default": "Pacific/Pago_Pago", | |
"timezones": ["Pacific/Pago_Pago"] | |
}, | |
{ | |
"label": "Coordinated Universal Time-11", | |
"default": "Pacific/Midway", | |
"timezones": ["Pacific/Midway", "Pacific/Niue"] |
When you are working in a team, you often make branches for features/bugs. After the branch gets merged into master, you end up with an old reference in your own git history.
If you are like me, that although knowing git in the command line, use the Github Desktop app, you end up with an infinite list of old branches.
Heres the one single command solution:
$ git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d
Last week there was a disk space problem on an AWS instance, we couldn't figure out where space was being used.
The good old ls / ll wasn't going to cut it, had to search a way to discover what folder was taking up so much space.
Starting from the root $ cd /
I used the command below:
$ du -hcsx .[!.]* * | sort -rh | head
# If for some reason you need to make a backup of your database here's how you dump and restore it. | |
# Backup | |
$ mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql | |
# Restore | |
$ mysql -u root -p[root_password] [database_name] < dumpfilename.sql | |
// Append 0 to the left of the number if needed so the number always has 4 digits | |
$number = 10; | |
echo str_pad($number, 4, "0", STR_PAD_LEFT); | |
// Output: 0010 |