sudo apt update && sudo apt upgrade
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
cat not_found.txt | xargs -I {} grep {} db/sends.json |
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
anchor deploy ... \\ | |
&& anchor idl init -f target/idl/thread_program.json solana address -k $(target/deploy/clockwork_thread_program.json) \\ | |
|| anchor idl upgrade -f target/idl/thread_program.json solana address -k $(target/deploy/clockwork_thread_program.json) | |
Note the usage of "||" | |
-> Ideally anchor idl init just need to be run once and can be removed from the script entirely |
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 std::num::ParseIntError; | |
use std::str::FromStr; | |
#[derive(Debug, PartialEq)] | |
enum ParsePersonError { | |
// Empty input string | |
Empty, | |
// Incorrect number of fields | |
BadLen, | |
// Empty name field |
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
systemctl stop [servicename] | |
systemctl disable [servicename] | |
rm /etc/systemd/system/[servicename] | |
rm /etc/systemd/system/[servicename] # and symlinks that might be related | |
rm /usr/lib/systemd/system/[servicename] | |
rm /usr/lib/systemd/system/[servicename] # and symlinks that might be related | |
systemctl daemon-reload | |
systemctl reset-failed |
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
#!/usr/bin/env bash | |
# ------------------------------------------ HELP | |
# https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units | |
# https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-centos-8 | |
# (NOT PRECISE): https://docs.timescale.com/install/latest/self-hosted/installation-redhat/#setting-up-the-timescaledb-extension | |
# export SYSTEMD_EDITOR=vim | |
# Logs: | |
# journalctl -xeu postgresql-14 |
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
anchor init myproj; cd myproj; anchor build | |
# Open a new tab and run a local ledger | |
solana-test-validator --no-bpf-jit | |
# Go back to main tab | |
anchor deploy `solana address -k target/deploy/bouteilles-keypair.json` | |
# After our first deploy we now have a keypair and we can use the public address as the programID. | |
sed -i '' "s/Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS/$(solana address -k target/deploy/bouteilles-keypair.json)/g" Anchor.toml |
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
pragma solidity ^0.8.0; | |
// We first import some OpenZeppelin Contracts. | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
import "hardhat/console.sol"; | |
// We inherit the contract we imported. This means we'll have access | |
// to the inherited contract's methods. | |
contract MyEpicNFT is ERC721URIStorage { |
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
import { Connection, PublicKey } from '@solana/web3.js'; | |
import { Program, Provider, web3, BN } from '@project-serum/anchor'; | |
import { programAddress, pdaSeed, network, connectionsOptions } from './config'; | |
// SystemProgram is a reference to the Solana runtime! | |
const { SystemProgram } = web3; |
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
# ******* Structures | |
class Node: | |
def __init__(self, data): | |
self.data = data | |
self.next = None | |
class LinkedList: | |
def __init__(self): |
NewerOlder