This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all network interfaces on my Mac | |
``` | |
$ networksetup -listallnetworkservices | |
An asterisk (*) denotes that a network service is disabled. | |
Display Ethernet | |
Thunderbolt Ethernet | |
Wi-Fi | |
Display FireWire | |
Bluetooth PAN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker run -it ubuntu | |
root@14d8108342b9:/# cat /etc/issue | |
Ubuntu 16.04.1 LTS \n \l | |
root@14d8108342b9:/# apt-get -qq update && apt-get -qq upgrade && apt-get -qq install build-essential | |
debconf: delaying package configuration, since apt-utils is not installed | |
(Reading database ... 7259 files and directories currently installed.) | |
Preparing to unpack .../libc6_2.23-0ubuntu5_amd64.deb ... | |
debconf: unable to initialize frontend: Dialog | |
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.) | |
debconf: falling back to frontend: Readline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# A handy way to redirect script output to syslog | |
# Way more granular then adding a bunch of `/usr/bin/logger` stanzas | |
# Thanks to http://urbanautomaton.com/blog/2014/09/09/redirecting-bash-script-output-to-syslog/ & | |
# Eric at https://twitter.com/lindvall/status/509054237267853312 | |
echo "writing to stdout, before the I/O redirection" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tested from a Mac command-line | |
$ dig +noall +answer SFDPH.ORG | |
$ dig +noall +answer www.SFDPH.ORG | |
www.sfdph.org. 1638 IN CNAME evqf8.x.incapdns.net. | |
evqf8.x.incapdns.net. 29 IN A 199.83.131.153 | |
$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#set -xv | |
# Update MacPorts base to latest released version using 'selfupdate' | |
# Then upgrade all outdated ports (upgrade outdated), and uninstall old version of each port (-u), | |
# following these guides: | |
# http://guide.macports.org/#using.common-tasks.updating | |
# http://guide.macports.org/#using.port.upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@devdb ~]# yum remove mysql-commercial\* | |
Loaded plugins: fastestmirror, priorities, ps, security, versionlock | |
Setting up Remove Process | |
Resolving Dependencies | |
--> Running transaction check | |
---> Package mysql-commercial-client.x86_64 0:5.7.22-1.1.el6 will be erased | |
---> Package mysql-commercial-common.x86_64 0:5.7.22-1.1.el6 will be erased | |
---> Package mysql-commercial-libs.x86_64 0:5.7.22-1.1.el6 will be erased | |
--> Processing Dependency: mysql-libs for package: 2:postfix-2.6.6-6.el6_5.x86_64 | |
---> Package mysql-commercial-libs-compat.x86_64 0:5.7.22-1.1.el6 will be erased |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@devdb ~]# yum list --quiet mysql-community-server mysql-community-client mysql-community-libs mysql-community-common mysql-community-libs-compat | |
Available Packages | |
mysql-community-client.x86_64 5.7.22-1.el6 mysql57-community | |
mysql-community-common.x86_64 5.7.22-1.el6 mysql57-community | |
mysql-community-libs.x86_64 5.7.22-1.el6 mysql57-community | |
mysql-community-libs-compat.x86_64 5.7.22-1.el6 mysql57-community | |
mysql-community-server.x86_64 5.7.22-1.el6 mysql57-community | |
[root@devdb ~]# yum --quiet downgrade mysql-community-libs-5.7.22-1.el6.x86_64 mysql-community-common-5.7.22-1. | |
el6.x86_64 mysql-community-client-5.7.22-1.el6.x86_64 mysql-community-libs-compat-5.7.22-1.el6.x86_64 mys | |
ql-community-server-5.7.22-1.el6.x86_64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Coreutils 8.24+ ships with dd with the status=progress option | |
root@host:~# dd if=/dev/sdb conv=sync,noerror status=progress | lz4 > disk.img.lz4 | |
1430323712 bytes (1.4 GB, 1.3 GiB) copied, 41 s, 34.9 MB/s | |
# pv (Pipeview) can also show a nice progress bar | |
root@host:~# dd if=/dev/sdb conv=sync,noerror | pv -tpreb | lz4 > ~stefanl/touch.img.lz4 | |
472MiB 0:00:14 [36.0MiB/s] [ <=> ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
By default, `git branch` by default uses a pager, which requires that you quit out of the pager, which erases the results fmor your screen | |
stefanl@stefanl:zfs git branch --all | |
* master | |
remotes/origin/HEAD -> origin/master | |
remotes/origin/master | |
remotes/origin/top | |
remotes/origin/zfs-0.6.3-stable | |
(END)^C |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
By default, `journalctl` will print the logs through a pager which can hide results from you. This can be annoying when trying to capture a screenshot: | |
root@docker01:~# journalctl -xe -u docker | |
May 21 23:25:40 docker01 dockerd[123]: time="2020-05-21T23:25:40.376573968Z" level=info msg="ign | |
May 22 00:45:37 docker01 dockerd[123]: time="2020-05-22T00:45:37.971043364Z" level=info msg="ign | |
lines 1006-1046/1046 (END) | |
Instead, pipe `journalctl` through `less`, `cat` or `tail` to quickly get familiar features such as wrapped lines: | |
root@docker01:~# journalctl -xe -u docker |