Skip to content

Instantly share code, notes, and snippets.

@vuonglab
vuonglab / gist:2cb36d02921eed1560b7f9eaf28f00de
Created August 26, 2023 14:01
prevent Logitech wireless mouse from waking arch linux
Create /etc/tmpfiles.d/disable-usb-wake.conf with the line:
w /proc/acpi/wakeup - - - - XHC
Reboot.
Source: https://forums.linuxmint.com/viewtopic.php?f=42&t=312953
@vuonglab
vuonglab / grub-fix-up.txt
Created February 3, 2022 07:20
Fix grub after image restore
# mount /dev/nvme0n1p5 /mnt
# mount /dev/nvme0n1p1 /mnt/efi
# arch-chroot /mnt
## grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch
## grub-mkconfig -o /boot/grub/grub.cfg
## exit
# umount -R /mnt
# reboot
Install latest nodejs and npm on Debian
1. sudo apt-get install software-properties-common
2. curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
3. sudo apt-get install nodejs
Source: https://tecadmin.net/install-latest-nodejs-npm-on-debian/
@vuonglab
vuonglab / debian vm
Created September 14, 2020 03:31
VirtualBox Debian
Install Debian without any packages. Standard libraries are not needed.
/etc/default/grub
GRUB_GFXMODE=1600x1200x32
GRUB_GFXPAYLOAD_LINUX=keep
# sudo update-grub
Some useful tools
sudo apt install vim openssh-server # for ssh and scp
@vuonglab
vuonglab / WordPress
Last active June 12, 2021 03:33
WordPress setup
Switch to sid (bleeding edge code; https://wiki.debian.org/DebianUnstable)
sudo vim /etc/apt/sources.list
change
deb .../debian/ buster main
deb-src .../debian/ buster main
to:
deb .../debian/ sid main
deb-src .../debian/ sid main
sudo apt update
sudo apt full-upgrade
@vuonglab
vuonglab / fuchsiafs
Last active September 27, 2020 22:04
Fuchsia FS dev notes
/fuchsia/zircon/system/ulib/blobfs/include/blobfs/format.h
Searching *blobfs* in /fuchsia/out/
blobfs, minfs and fvm host maps: /fuchsia/out/default/host_x64/exe.unstripped
blobfs tests
/fuchsia/out/default
/fuchsia/out/default/exe.unstripped
/fuchsia/out/default/gen/src/storage
/fuchsia/out/default/gen/zircon/system/ulib/blobfs/test
/fuchsia/out/default/dartlang/gen/src/tests/end_to_end/inspect_metrics
@vuonglab
vuonglab / rust-notes
Last active August 7, 2020 01:46
Rust notes
Rust has three channels: nightly, beta and stable.
use std::io; // std = standard library, io = a module
let mut guess = String::new(); // :: means new() is an associated (static) function of the String type
usize - 32 or 64 bits; good for indices
10_000u16
default: i32 and f64
char - 4 bytes and represents a Unicode Scalar Value
tuple
@vuonglab
vuonglab / rust-dev-tools
Last active July 13, 2020 01:11
Rust development tools
cargo fmt # format source files
cargo fix # fix compiler warnings
cargo clippy # run lints
rustup doc # view offline version of Rust book
cargo build/run --release -- params to pass to program
cargo update # upgrade crates with newer patch version (z number in x.y.z)
cargo doc --open # view doc on all dependency crates
@vuonglab
vuonglab / rust-setup
Last active July 12, 2020 22:49
Rust setup
Install rustup, the toolchain manager, from https://rustup.rs/
Add ~/.cargo/bin to PATH
Append ~/.cargo/bin to PATH in .bash_aliases
Delete this line from ~/.profile: export PATH="$HOME/.cargo/bin:$PATH"
rustup component add rustfmt clippy rls
Add Rust support to VS Code
Run VSCode, press Ctrl-P and paste "ext install rust-lang.rust" in the command palette.
(see https://marketplace.visualstudio.com/items?itemName=rust-lang.rust)
rustup update # upgrade Rust
@vuonglab
vuonglab / debian notes
Last active March 22, 2022 23:29
Install notes
Okay to install Debian without the standard system utilities.
Install VirtualBox - follow https://www.virtualbox.org/wiki/Linux_Downloads with this modificaton:
Create /etc/apt/sources.list.d/virtualbox.list with this line:
deb https://download.virtualbox.org/virtualbox/debian buster contrib
It's preferred that /etc/apt/sources.list not be modified.
sudo apt install nfs-common
Enable secondary NIC on workstation