Skip to content

Instantly share code, notes, and snippets.

View kvutien's full-sized avatar

Vu Tien Khang kvutien

View GitHub Profile
@kvutien
kvutien / flutter-macOs-homebrew-tree.sh
Created April 3, 2022 16:19
Example of shell output when installing tree
kvutien@MBP21VTK ~ % brew install tree
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 53 formulae.
Running `brew update --preinstall`...
==> Downloading https://ghcr.io/v2/homebrew/core/tree/manifests/2.0.2
@kvutien
kvutien / flutter-macOs-ruby.sh
Created April 3, 2022 16:05
Example of shell output when creating Ruby with brew
kvutien@MBP21VTK develop % cd ~
kvutien@MBP21VTK ~ % brew install ruby
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 34 formulae.
Running `brew update --preinstall`...
@kvutien
kvutien / rubyM1.rb
Created April 3, 2022 16:01
Ruby script to check CPU used to compile Ruby
require 'rbconfig'
OSVERSION = RbConfig::CONFIG['host_os']
ARCH = RbConfig::CONFIG['arch']
HOSTCPU = RbConfig::CONFIG['host_cpu']
BUILDCPU = RbConfig::CONFIG['build_cpu']
TARGETCPU = RbConfig::CONFIG['target_cpu']
puts "OS: #{OSVERSION}"
puts "Arch: #{ARCH}"
puts "Host CPU: #{HOSTCPU}"
puts "Build CPU: #{BUILDCPU}"
@kvutien
kvutien / flutter-macos-homebrew-config
Last active April 3, 2022 15:42
example of brew config on a Mac M1
kvutien@MBP21VTK ~ % brew config
HOMEBREW_VERSION: 3.4.4
ORIGIN: https://github.com/Homebrew/brew
HEAD: 5f5af43244eaece1f09d695603e1a261676713a0
Last commit: 5 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 58e3b8eed940177096a87fae90635ef0291bf259
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
@kvutien
kvutien / flutter-macOS-homebrew-install
Created April 3, 2022 15:15
example of homebrew install output
MBP21VTK:~ kvutien % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew
@kvutien
kvutien / ubuntu64-hostname-change.txt
Created September 15, 2021 17:19
change RPi hostname
ubuntu@ubuntu:~$ sudo hostnamectl set-hostname ipfs-pi64
ubuntu@ubuntu:~$ hostnamectl
Static hostname: ipfs-pi64
Icon name: computer
Machine ID: fe9bb4b2a6194fadb829dadad9dffbb6
Boot ID: 4241236bed6a4d55b4fb0a4a3f626936
Operating System: Ubuntu 20.04.3 LTS
Kernel: Linux 5.4.0-1042-raspi
Architecture: arm64
@kvutien
kvutien / ubuntu-rpi-first-login.txt
Created September 15, 2021 17:01
Ubuntu RPi4 first login
MBP18VTK:~ kvutien$ ssh ubuntu@192.168.178.45
The authenticity of host '192.168.178.45 (192.168.178.45)' can't be established.
ECDSA key fingerprint is SHA256:ASIUuKFlPg7crrGuucbLwPVrrRabYBDdo0MJgQCzDew.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.178.45' (ECDSA) to the list of known hosts.
ubuntu@192.168.178.45's password: ubuntu
You are required to change your password immediately (administrator enforced)
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-1042-raspi aarch64)
* Documentation: https://help.ubuntu.com
@kvutien
kvutien / Ubuntu-append-user-data-to-reboot.txt
Created September 15, 2021 16:20
user-data instruction to reboot after network is configured
##Reboot after cloud-init completes, due to a bug in netplan
power_state:
mode: reboot
@kvutien
kvutien / Ubuntu-network-config-RPi64bit.txt
Created September 15, 2021 16:09
network-config for Ubuntu 64-bit on Raspberry Pi
# This file contains a netplan-compatible configuration which cloud-init
# will apply on first-boot. Please refer to the cloud-init documentation and
# the netplan reference for full details:
#
# https://cloudinit.readthedocs.io/
# https://netplan.io/reference
#
# Some additional examples are commented out below
version: 2
@kvutien
kvutien / RPi-for-MachuPicchu.txt
Created September 7, 2021 17:09
Table of Raspberry Pi's for Machu Picchu
|---- model ------| 3A+ | 3B | 3B+ | 4B | 0W | 0WH | 400 |---|
|-----------------|------|---------|---------|---------|-------|-------|-----------|---|
| target price | $25 | $35 | $35 |$35/55/75| $10 | $15 | $70 |---|
| Instruction set |64-bit|64/32-bit|64/32-bit|64/32-bit| 32-bit| 32-bit|64/32-bit |---|
| SDRAM memory |512 MB| 1 GB | 1 GB | 2/4/8 GB| 512 MB| 512 MB| 4 GB |---|
| USB-2 ports | 1 | 4 | 4 | 2 |1 micro|1 micro| 1 |---|
| USB-3 ports | 0 | 0 | 0 | 2 | 0 | 0 | 2 |---|
| Ethernet | 0 | 100Mb | 1 Gb | 1 Gb | 0 | 0 | 1 Gb |---|
| Wi-Fi | dual | 2.4 | dual | dual | 2.4 | 2.4 | dual |---|
| Bluetooth | 4.2 | 4.1 | 4.2 | 5.0 | 4.1 | 4.1 | 5.0 |---|