Skip to content

Instantly share code, notes, and snippets.

@yufengwng
yufengwng / public_ip.txt
Created May 16, 2018 03:18
Get public IP address programmatically
$ curl -si https://ipinfo.io
@yufengwng
yufengwng / doctl_zsh_completion.sh
Created March 29, 2017 00:20
ZSH completion file for doctl.
# ZSH completion script for doctl.
#
# This takes bach completion and converts it to support zsh.
# Inspired by [kubectl][kc] and [opencompose][oc], the bash
# part is from [@andewsomething][as-gist].
#
# [kc]: https://github.com/kubernetes/kubernetes/blob/9dec47d/pkg/kubectl/cmd/completion.go
# [oc]: https://github.com/redhat-developer/opencompose/blob/master/pkg/cmd/completion.go
# [as-gist]: https://gist.github.com/andrewsomething/7ba993a7f7897936c6946ffed2f1edc6
@yufengwng
yufengwng / usb.txt
Created November 24, 2016 15:25
Commands for managing usb devices
view device filesystems
$ lsblk -f
view devices
$ udiskctl status
view device info
$ udiskctl info -b /dev/<id>
mount partition
@yufengwng
yufengwng / zipping.txt
Created March 26, 2015 02:56
Commands for archiving and zipping files.
tar
===
create new gunzipped tar
$ tar cvzf <name>.tar.gz file <files>
extract from gunzipped tar
$ tar xvzf <name>.tar.gz
list contents of gunzipped tar
@yufengwng
yufengwng / arch_cheatsheet.txt
Last active April 14, 2024 06:34
Arch Linux Commands Cheatsheet
pacman
======
view logs: /var/log/pacman.log
update system
# pacman -Syu
list installed packages
# pacman -Q