This file contains 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
// Creating the channel | |
{ | |
"txjson": { | |
"TransactionType": "PaymentChannelCreate", | |
"Amount": "1000000", | |
"Destination": "rfHn6cB5mmqZ6fHZ4fdemCDSxqLTijgMwo", | |
"PublicKey": "037E3F11237DF2E0EBFE3B5872A5BB76F1C05DE079BA44E157E7896F0AFC7F7BE8", // Only needed if not the signer | |
"SettleDelay": 1 | |
} | |
} |
This file contains 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
// Uint32 max: 4294967295 | |
// 1500474479 | |
console.log( | |
parseInt(Buffer.from('Yolo', 'utf-8').toString('hex'), 16) | |
) | |
console.log( | |
Buffer.from(Number(1500474479).toString(16), 'hex').toString('utf-8') | |
) |
This file contains 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
# Modify route | |
set protocols static table 10 route 0.0.0.0/0 next-hop 10.200.0.113 | |
set firewall modify PBR rule 20 description LAN1 | |
set firewall modify PBR rule 20 source address 10.150.5.0/24 | |
set firewall modify PBR rule 20 modify table 10 | |
set firewall modify PBR rule 30 description LAN2 | |
set firewall modify PBR rule 30 source address 10.50.5.0/24 |
This file contains 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
var snmp = require ("net-snmp"); | |
var session = snmp.createSession("10.2.1.151", "private") | |
const relayOid = '1.3.6.1.4.1.318.1.1.10.4.4.4.1.5.0.1' | |
const outletOid = '1.3.6.1.4.1.318.1.1.10.4.5.4.1.5.0.1' | |
var oids = [ | |
"1.3.6.1.4.1.318.1.1.10.4.2.3.1.5.0.1", // temp 1 | |
"1.3.6.1.4.1.318.1.1.10.4.2.3.1.5.0.4", // temp 4 |
This file contains 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 { TwitterApi } from 'twitter-api-v2' | |
const client = new TwitterApi({ | |
appKey: 'xxxxx', | |
appSecret: 'xxxxx', | |
}) | |
const foundUsers = await client.v1.searchUsers('xumm wallet'); | |
const seen = [] |
This file contains 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
class ByteSet { | |
@lazy | |
static readonly dataSize: u32 = 32; | |
constructor(public bytes: ByteArray) { | |
if (bytes.length != ByteSet.dataSize) | |
rollback("", pack_error_code(bytes.length)); | |
} | |
has(n: u8): bool { |
This file contains 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
function hook(reserved: i32) | |
{ | |
etxn_reserve(1) | |
const savings_account = new HookParam<Account>({ | |
name: "savings_account", | |
description: 'The account the rounded savings are sent to' | |
}) | |
const dest_accid = savings_account.get( | |
new Account(util_accid("rfCarbonVNTuXckX6x2qTMFmFSnm6dEWGX"))) |
This file contains 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
#!/bin/bash | |
cpt=${PWD##*/} # to assign to a variable | |
cpt=${result:-/} # to correct for the case where PWD=/ | |
cpt=$(printf '%q\n' "${PWD##*/}") | |
cpt=${cpt,,} | |
rm -f /etc/nginx/sites-enabled/$cpt | |
cp /etc/nginx/template/template-vhost /etc/nginx/sites-enabled/$cpt |
This file contains 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 { XrplClient } from 'xrpl-client' | |
const account = 'rpKJsRsvKXt5JwV2PFRnvfkEH47MEWpVYo' | |
const client = new XrplClient() | |
let marker | |
let pages = 0 | |
let accounts = 0 |
This file contains 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 { Xumm } from 'xumm' | |
import WebSocket from 'ws' | |
const xumm = new Xumm('xxxxxx', 'yyyyyy') | |
const payload = await xumm.payload?.create({ TransactionType: "SignIn" }) | |
console.log(payload.refs.websocket_status) | |
const ws = new WebSocket(payload.refs.websocket_status) |