Skip to content

Instantly share code, notes, and snippets.

View thiagodelgado111's full-sized avatar

Thiago Delgado thiagodelgado111

View GitHub Profile
@wlib
wlib / LICENSE
Last active April 30, 2024 17:07
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@sebmor
sebmor / gist:e32629f2c9f26cb7c9ff7356d349e27a
Last active November 9, 2018 03:41
Open Ethereum Wallet
import bip39 from 'bip39'
import hdkey from 'ethereumjs-wallet/hdkey'
import uuid from 'uuid'
import SHA256 from 'crypto-js/sha256'
import pbkdf2 from 'pbkdf2'
const SHARED_SALT = 'MaWe^C?2uButtKymBeRw5z*h3Z^x6LN*Bcj%d9xh@rkBFfA5X+#dwd5SRraYPY&2vjP_s*w$kd*!en7-%td&?R+zgtpHGLeBrSnh=-J#Fj=qpg%GwSpA=H83bG53sjmNBNe-DR6NDVXe@SJgps!-zx2^FFEk*DWsqYPg&edC3rR9n%$M*h2W+6*ADwc$Hpj*bESS?aV!&S8xnJ%%Z6jeFCBnHsXANVC2ZjD%8C3*P5e=CWn+x8Y?8CKJA3@fF6*=e8!L5$BWSBNQ2B3ECYbJ4-EkTE=!4#5nhPb5sw#3N4bCQDcGt7_QEE4xYpYz6EvJF9?5BD7bwwV7?kS9B6RRXBe3WYFwuG88yr$#JHb=?*vfMe=F+8rkTxNY2T^RyE4BFaDQenaj?$XHgafsRU#n!XnD3ageyWEMjSu&vPa9yy!$XCBFURfL#G9!u@B^5U%ZJx9$Gm6P5jjfAkZ=U@JqUq^YPY74DTbZaxjMRgVJ&$$q_v?r@fKsvJfSJp3fGYGq'
export function openWallet(walletid = uuid(), password) {
console.time('timetodecrypt')
@dchest
dchest / bad-node.md
Last active April 20, 2017 18:13
Bad things that Node.js does

Bad things that Node.js does

The point of the list is not to complain, but to educate (informing people about unexpected and suprisingly broken things), and propose workarounds.

1. Buffer.from(str, "base64") doesn't validate base64 encoding

Bug report: nodejs/node#8569.

Example

@nrollr
nrollr / MongoDB_macOS_Sierra.md
Last active April 1, 2024 16:23
Install MongoDB on Sierra using Homebrew

Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@JamesOBenson
JamesOBenson / Generating a secure SSH Key and commands
Last active October 16, 2023 06:45
SSH Generation and commands.
ssh-keygen
-t ed25519 - for greatest security (bits are a fixed size and -b flag will be ignored)
-t rsa - for greatest portability (key needs to be greater than 4096 bits)
-t ecdsa - faster than RSA or DSA (bits can only be 256, 284, or 521)
-t dsa - DEEMED INSECURE - DSA limted to 1024 bit key as specified by FIPS 186-2, No longer allowed by default in OpenSSH 7.0+
-t rsa1 - DEEMED INSECURE - has weaknesses and shouldn't be used (used in protocol 1)
-b 4096 bit size
-a 500 rounds (should be no smaller than 64, result in slower passphrase verification and increased resistance to brute-force password cracking)
-C "First.Last@somewhere.com" comment..
/**
* This script will automatically sync all updates from one database to another. It is meant to be run while
* syncing the database using mongodump and mongorestore.
*
* Example:
* node livesync.js mongodb://<user>:<pass>@dbhost.com:10645/app-production \
* mongodb://<user>:<pass>@dbhost.com:10499/local?authSource=app-production \
* app-production \
* mongodb://<user>:<pass>@newdbhost.com/app-prod
*/
@mattjohnsonpint
mattjohnsonpint / railstz.json
Created May 11, 2016 06:12
Rails TZ Map in JSON
{
"International Date Line West":"Pacific/Midway",
"Midway Island":"Pacific/Midway",
"American Samoa":"Pacific/Pago_Pago",
"Hawaii":"Pacific/Honolulu",
"Alaska":"America/Juneau",
"Pacific Time (US & Canada)":"America/Los_Angeles",
"Tijuana":"America/Tijuana",
"Mountain Time (US & Canada)":"America/Denver",
"Arizona":"America/Phoenix",

From zero to microservice with 𝚫 now

The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.

It uses Open Source tools that are widely available, tested and understood:

  • Node.JS
  • NPM
  • Express
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# 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