Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / chromecast.sh
Last active September 6, 2021 07:35
Linux chromecast play video
go get -u github.com/vishen/go-chromecast
go-chromecast ls
go-chromecast load video.mp4
go-chromecast pause
go-chromecast unpause
go-chromecast volume 0.5
go-chromecast stop
go-chromecast ui
@miguelmota
miguelmota / index.html
Created July 29, 2021 05:56
JavaScript get IP address using Cloudflare
<html>
<head>
<title>IP</title>
</head>
<body>
<output id="output"></output>
<script>
const output = document.getElementById('output')
fetch('https://www.cloudflare.com/cdn-cgi/trace')
.then(res => res.text())
@miguelmota
miguelmota / config
Last active March 27, 2024 19:46
Arch linux VNC server setup
session=lxqt
geometry=1920x1080
localhost # comment this out to allow connections from anywhere
alwaysshared
@miguelmota
miguelmota / README.md
Last active March 28, 2024 21:46
Arch linux secure machine

Create new user

sudo useradd -m -s /bin/bash alice
sudo passwd alice

Add user to wheel (sudo) group

@miguelmota
miguelmota / index.html
Created July 7, 2021 22:35
HTML details summary toggle css example
<!-- https://jsfiddle.net/1cehyw54/ -->
<details open>
<summary>Toggle me</summary>
<div>
Hello world
</div>
</details>
@miguelmota
miguelmota / docker.sh
Created June 29, 2021 23:17
Docker local log driver options (ie max size)
docker run --log-driver local --log-opt max-size=2gb hello-world
@miguelmota
miguelmota / README.md
Last active November 26, 2022 15:58
Ubuntu EC2 secure SSH server

Create new user

sudo useradd -m -s /bin/bash alice
sudo passwd alice
sudo usermod -aG sudo alice

Copy authorized users to new user

@miguelmota
miguelmota / multicall.go
Created June 12, 2021 01:10
Golang MultiCall solidity contract call example
package main
import (
"context"
"encoding/hex"
"fmt"
"strings"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
@cleanunicorn
cleanunicorn / MintMaxKDAI.sol
Created March 29, 2021 14:37
Mint max tokens
import {IERC20} from "./IERC20.sol";
contract MintMaxKDAI {
address owner = msg.sender;
constructor() {
IERC20 tDAI = IERC20(0x7d669A64deb8a4A51eEa755bb0E19FD39CE25Ae9);
tDAI.mint(
owner,
@miguelmota
miguelmota / pass.txt
Last active July 29, 2021 05:28
Arch linux PrivateInternetAccess (PIA) OpenVPN VPN setup
<username>
<password>