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
# Example with a space after the colon | |
echo "bc3977f Some beautiful long commit message [skip: verification]" | sed -En 's/.*\[skip\:(.*|\ .*)\]/\1/p' | awk '{$1=$1;print}' | |
verification | |
# Example with no space after the colon | |
echo "bc3977f Some beautiful long commit message [skip: verification]" | sed -En 's/.*\[skip\:(.*|\ .*)\]/\1/p' | awk '{$1=$1;print}' | |
verification | |
# Working example from the last commit message | |
git log -1 --oneline | sed -En 's/.*\[skip\:(.*|\ .*)\]/\1/p' | awk '{$1=$1;print}' |
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/sh | |
# Why? In a containerised environment, you may need to run commands on other Docker containers | |
# within the Docker bridge network. For slim images such as Alpine-based distributions, you do | |
# not want the docker executable installed. Instead, you can simply pass the docker socket during | |
# runtime, and interact with it using cURL. The following functions allow you to easily interact | |
# with other containers, as you would using the native docker exec command. | |
# Example of mounting the docker socket: | |
# |
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
For a simplistic view on what versioning ranges look like, see below: | |
Version Range | |
>=1.0 1.0.0 - *.*.* | |
>=1.0 <2.0 1.0.0 - 1.*.* | |
>=1.0 <1.1 || >=1.2 1.0.0 - 1.*.* || 1.2.0 - *.*.* | |
>=1.0 <1.1 1.0.0 - 1.*.* | |
>=1.0.0 <2.1 1.0.* - 2.0.* | |
>=1.0.0 <=2.1.0 1.0.0 - 2.1.0 | |
~1.2 1.2.0 - 1.*.* |
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
sudo apt-get install \ | |
xscreensaver \ | |
xscreensaver-gl-extra \ | |
xscreensaver-data-extra \ | |
xscreensaver-screensaver-bsod | |
# Or, via the preferred method: | |
# Look for the latest version from https://www.jwz.org/xscreensaver/download.html | |
sudo apt-get install \ | |
xorg-dev \ |
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
location / { | |
try_files $uri /index.php$is_args$args; | |
} | |
rewrite /wp-admin$ $scheme://$host$uri/ permanent; | |
location ~ /\. { | |
deny all; | |
} |
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 | |
OUTPUT=~/stats.txt; | |
for i in {0..120}; | |
do date >> $OUTPUT; | |
ps -Ao user,pid,pcpu,pmem,comm --sort=-pcpu | head -n6 >> $OUTPUT; | |
echo "" >> $OUTPUT; | |
sleep 0.5; | |
done |
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
SELECT | |
trx_w.trx_id AS waiting_trx_id, | |
trx_w.trx_mysql_thread_id AS waiting_process_id, | |
TIMESTAMPDIFF(SECOND, trx_w.trx_wait_started, CURRENT_TIMESTAMP) AS wait_time, | |
trx_w.trx_query AS waiting_query, | |
l.lock_table AS waiting_table_lock, | |
trx_b.trx_id AS blocking_trx_id, | |
trx_b.trx_mysql_thread_id AS blocking_process_id, | |
CONCAT(pl.user, '@', pl.host) AS blocking_user, | |
pl.command, |
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
SELECT | |
TABLE_NAME AS DATABASE_NAME, | |
FORMAT(TABLE_ROWS, 0) AS Rows | |
FROM information_schema.tables | |
WHERE | |
table_schema = 'DATABASE_NAME' | |
AND TABLE_ROWS > 0 | |
; |
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
SELECT RTRIM(CONCAT( | |
'`', | |
COLUMN_NAME, | |
'`', | |
' ', | |
COLUMN_TYPE, | |
' ', | |
IF (COLLATION_NAME IS NULL, '', CONCAT('COLLATE ', COLLATION_NAME, ' ')), | |
IF (IS_NULLABLE = 'YES', '', 'NOT NULL '), | |
IF (COLUMN_DEFAULT IS NULL, '', CONCAT('DEFAULT ', COLUMN_DEFAULT, ' ')), |
NewerOlder