# Check staged changes in minimal diff (just file names and changed lines)
# keeping coloring, less needs -R to pass colors
git diff --staged -U0 --color | grep -Pv '^(\e\[.{1,2}m)?(---|\+\+\+|index)' | less
# Note: None of these codes for ASCII ESC worked in GNU grep -E \e \x1b \033
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
#!/bin/sh | |
# Copyright (c) 2015 Václav Brožík | |
# MIT License - See the file LICENSE. | |
# Description: full backup changed file(s), log operations | |
# Syntax: backupchanged statusfile logfile destination | |
datetime="$(date +%Y-%m-%dT%H:%M:%S)" | |
backuplist="${1-backup-list}" |
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
#!/bin/sh | |
# removes old kernel packages which stays after kernel upgrades | |
# on Debian-based systems | |
# requires: POSIX shell, awk, sed (with -r), grep sort, head, uname | |
# printf, echo | |
# dpkg, apt-get | |
# sudo (? remove?) |
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
-------- Useful cpview SQL queries -------- | |
-------- numbers of concurrent connections from an alternative table | |
SELECT | |
datetime(timestamp, 'unixepoch', 'localtime') AS datetime, | |
conns | |
FROM fw_network_stats_concurrent_conns | |
WHERE component_name = 'Total' | |
; |
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
#!/bin/sh | |
# Prepares freshly installed WSL | |
# Written for: | |
# WLS2, Ubuntu 22.04 | |
sudo apt update | |
sudo apt install wslu | |
# TODO: |
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
#!/bin/sh | |
# Install parts of wslu (currently only wslview) as independent files to avoid | |
# installing the huge amount of dependencies. | |
# In Ubuntu 20.04-22.04 the dependecies are: 61 packages, 177 MB disk space | |
# Václav Brožík 2022-07 | |
# public-domain | |
# references: |
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
// ==UserScript== | |
// @name Generate hyperlinks for Jira, Gitlab, ServiceNow or drupal.org and copy to clipboard | |
// @namespace https://gist.github.com/fengtan/4493530e0989b896692d3804937e17a9 | |
// @version 1.0 | |
// @description View a page on Jira, Gitlab, ServiceNow or drupal.org, and then hit Alt+M or Alt+J: this will build a markdown or jira-formatted hyperlink to the clipboard | |
// @author fengtan | |
// @include *gitlab* | |
// @include *jira*/browse/* | |
// @include *jira*/issues/* | |
// @include *.service-now.com/* |
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
{ | |
"ignoreWords": ["appdirs"] | |
} |
OlderNewer