This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo nano /etc/netplan/00-installer-config.yaml | |
| # This file is generated from information provided by | |
| # the datasource. Changes to it will not persist across an instance. | |
| # To disable cloud-init's network configuration capabilities, write a file | |
| # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: | |
| # network: {config: disabled} | |
| network: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo docker create \ | |
| --name=duckdns \ | |
| -e PUID=1000 \ | |
| -e PGID=1000 \ | |
| -e TZ=Europe/Madrid \ | |
| -e SUBDOMAINS=ejemplo1,ejemplo2 \ | |
| -e TOKEN=TOKEN HERE \ | |
| --restart unless-stopped \ | |
| linuxserver/duckdns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $btc = 0.00005; // amount | |
| echo ($btc)*(pow(10, 8)); // bitcoin to satoshi | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $satoshi = 5000; //Satoshi to btc | |
| echo number_format(($satoshi)*(pow(10, -8)), 8, '.', ''); //Returns 0.00005000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npm i ethereumjs-wallet@0.6.3 | |
| var Wallet = require('ethereumjs-wallet'); | |
| const EthWallet = Wallet.generate(); | |
| console.log("address: " + EthWallet.getAddressString()); | |
| console.log("privateKey: " + EthWallet.getPrivateKeyString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // DEFINE our cipher | |
| define('AES_256_CBC', 'aes-256-cbc'); | |
| // Generate a 256-bit encryption key | |
| // This should be stored somewhere instead of recreating it each time | |
| $encryption_key = openssl_random_pseudo_bytes(32); | |
| // Generate an initialization vector | |
| // This *MUST* be available for decryption as well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use BitWasp\Bitcoin\Bitcoin; | |
| use BitWasp\Bitcoin\Key\Factory\PrivateKeyFactory; | |
| use BitWasp\Bitcoin\Script\P2shScript; | |
| use BitWasp\Bitcoin\Script\WitnessScript; | |
| use BitWasp\Bitcoin\Script\ScriptFactory; | |
| use BitWasp\Bitcoin\Transaction\Factory\Signer; | |
| use BitWasp\Bitcoin\Transaction\Factory\TxBuilder; | |
| use BitWasp\Bitcoin\Transaction\OutPoint; | |
| use BitWasp\Bitcoin\Transaction\TransactionOutput; | |
| use BitWasp\Buffertools\Buffer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // This can be found in the Symfony\Component\HttpFoundation\Response class | |
| const HTTP_CONTINUE = 100; | |
| const HTTP_SWITCHING_PROTOCOLS = 101; | |
| const HTTP_PROCESSING = 102; // RFC2518 | |
| const HTTP_OK = 200; | |
| const HTTP_CREATED = 201; | |
| const HTTP_ACCEPTED = 202; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const TronWeb = require('tronweb'); | |
| const HttpProvider = TronWeb.providers.HttpProvider; | |
| const fullNode = new HttpProvider("https://api.trongrid.io"); | |
| // const fullNode = new HttpProvider("http://192.168.1.162:8090"); | |
| const solidityNode = new HttpProvider("https://api.trongrid.io"); | |
| const eventServer = new HttpProvider("https://api.trongrid.io"); | |
| const privateKey = "3481E79956D4BD95F358AC96D151C976392FC4E3FC132F78A847906DE588C145"; | |
| const tronWeb = new TronWeb(fullNode, solidityNode, eventServer, privateKey); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Route::get('/storage/uploads/{filename}', function ($filename) | |
| { | |
| $path = storage_path('app/public/uploads/images/' .'/'. $filename); | |
| if (!File::exists($path)) { | |
| $path = storage_path('app/public/uploads/' . 'NoImg.jpeg'); | |
| } | |
| return Image::make($path)->response(); | |