Skip to content

Instantly share code, notes, and snippets.

View tegila's full-sized avatar

Edson Tégila tegila

View GitHub Profile
@tegila
tegila / nostr.noble.js
Last active September 5, 2024 15:06
Awesome work from @fiatjaf and @paulmillr resulting in total integration between #nostr and #bitcoin
const log = console.log;
import { hex } from '@scure/base';
import * as btc from '@scure/btc-signer';
import { secp256k1, schnorr as secp256k1_schnorr } from '@noble/curves/secp256k1';
import { bech32 } from '@scure/base';
const privKey = secp256k1.utils.randomPrivateKey();
//const privKey = hex.decode('');
log('privKey', hex.encode(privKey));
const log = console.log;
(async () => {
const localConnection = new RTCPeerConnection();
log(localConnection);
const lsendChannel = localConnection.createDataChannel("sendChannel");
const remoteConnection = new RTCPeerConnection();
log(remoteConnection);
const rsendChannel = remoteConnection.createDataChannel("sendChannel");
localConnection.onicecandidate = (e) =>
!e.candidate || remoteConnection.addIceCandidate(e.candidate).catch(log);
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract Berrante is ERC721, ERC721Enumerable, ERC721URIStorage, Ownable {
@tegila
tegila / loop.luks.pam_mount.sh
Created December 13, 2022 00:09
loop luks pam_mount
#!/bin/bash
truncate -s 1G ~/.priv
cryptsetup luksFormat ~/.priv
sudo cryptsetup luksOpen ~/.priv priv
sudo mkfs.ext4 /dev/mapper/priv
sudo cryptsetup luksClose priv
gst-launch-0.10 istximagesrc startx=0 starty=0 endx=1680 endy=1050 \
! ffmpegcolorspace ! videorate ! videoscale \
! video/x-raw-yuv,width=640,height=480,framerate=10/1 \
! theoraenc ! oggmux \
! shout2send ip=localhost password=hackme mount=stream streamname=Test description="Screencast"
[global]
fsid =
cluster = ceph
public network = 10.8.0.0/16
# Enable cephx authentication (which uses shared keys for almost everything)
auth cluster required = none
auth service required = none
auth client required = none
# Replication
osd pool default size = 2
printf "uid $(id -u) 1000\ngid $(id -g) 1000"  | lxc config set docker1 raw.idmap -

lxc config device add docker1 export disk source=/export/docker1 path=/export
/var/log/lxd/mail1/lxc.conf

lxc.idmap = u 0 100000 1000
container_name=remapped
lxc init ubuntu-daily:z $container_name
lxc config set $container_name raw.idmap "both $UID 1000"
lxc config device add $container_name homedir disk source=$HOME path=/home/ubuntu
lxc start $container_name
@tegila
tegila / synapse.md
Last active April 7, 2022 22:43
matrix synapse install
emerge -av dev-vcs/git vim tmux
[neko]
location = /var/db/repos/neko
sync-type = git
sync-uri = https://gitlab.com/deepbluev7/neko.git
This file has been truncated, but you can view the full file.
/ticker/fbinance/BTCUSDT 39600.00 -0.05
/ticker/fbinance/BTCUSDT 39600.10 0.1
/ticker/binance/SOLUSDT 81.13000000 5.78
/ticker/binance/SOLUSDT 81.13000000 3.53
/ticker/binance/SOLUSDT 81.13000000 15.34
/ticker/huobi/maticusdt 1.373029 80
/ticker/huobi/maticusdt 1.37304 80
/ticker/fbinance/BTCBUSD 39611.0 -0.001
/ticker/fbinance/BTCBUSD 39611.0 -0.01
/ticker/fbinance/BTCBUSD 39610.9 -0.028