Skip to content

Instantly share code, notes, and snippets.

View tegila's full-sized avatar

Edson Tégila tegila

View GitHub Profile
@tegila
tegila / wireguard.md
Created October 7, 2021 20:53 — forked from dockerlead/Tutorial.md
Wireguard on CentOS 7/8

Set Up Your Own WireGuard VPN Server on CentOS

This tutorial is going to show you how to set up your own WireGuard VPN server on CentOS. WireGuard is made specifically for the Linux kernel. It runs inside the Linux kernel and allows you to create fast, modern, and secure VPN tunnel. TL;DR

Prerequisites

This tutorial assumes that the VPN server and VPN client are both running CentOS operating system.

Step 1: Install WireGuard on CentOS Server and Desktop

Log into your CentOS server, then run the following commands to install WireGuard.

# CentOS 8
@tegila
tegila / sim900.mdown
Last active November 2, 2023 09:55
SIM900 TIPS AND TRICKS

TUTORIAL

Attach to GPRS Service

-> AT+CGATT = 1
<- OK

Define PDP Context (cid, PDP type, APN)

-&gt; AT+CGDCONT=1,"IP","zap.vivo.com.br"
@tegila
tegila / nostr.noble.js
Last active May 25, 2023 14:03
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);
#!/bin/bash
mkdir -p /mnt/linux
mount /dev/local/linux /mnt/linux
mount /dev/sda1 /mnt/linux/boot
mount -t proc none /mnt/linux/proc
mount -o bind /dev /mnt/linux/dev
mount -o bind /sys /mnt/linux/sys
mount -t devpts devpts /mnt/linux/dev/pts
@tegila
tegila / mt7601.sh
Created April 15, 2015 15:23
MediaTek MT7601 to Raspberry Pi 2 Raspbian
## Fetch source code from firmware and linux
git clone --depth 1 https://github.com/raspberrypi/firmware
git clone --depth=1 -b rpi-3.19.y --single-branch https://github.com/raspberrypi/linux
## Update firmware files
sudo mkdir /boot/backup
sudo cp /boot/* /boot/backup/
sudo cp -r firmware/modules /lib
sudo cp -r src/firmware/boot /
sudo cp firmware/extra/Module7.symvers linux/Module.symvers
// 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"
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