Skip to content

Instantly share code, notes, and snippets.

View vbrozik's full-sized avatar
☮️
Ukraine stay strong

Václav Brožík vbrozik

☮️
Ukraine stay strong
  • NTT Czech Republic
  • Czech Republic
  • 20:14 (UTC +02:00)
View GitHub Profile
@vbrozik
vbrozik / backupfile
Last active June 11, 2021 11:44
backup changed files - shell script
#!/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}"
@vbrozik
vbrozik / purge-old-kernels
Created October 19, 2015 20:25
purge-old-kernels
#!/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?)
@vbrozik
vbrozik / cpview_queries.sql
Last active May 10, 2022 06:13
Useful SQL queries to Check Point cpview database
-------- 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'
;
@vbrozik
vbrozik / wsl-ubuntu-prep.sh
Last active May 17, 2022 22:22
WSL Ubuntu preparation
#!/bin/sh
# Prepares freshly installed WSL
# Written for:
# WLS2, Ubuntu 22.04
sudo apt update
sudo apt install wslu
# TODO:
@vbrozik
vbrozik / wslu-partial.sh
Created July 6, 2022 14:58
wslu partial installation
#!/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:
@vbrozik
vbrozik / hyperlinks-markdown-jira.js
Created November 9, 2022 14:26 — forked from fengtan/hyperlinks-html-markdown-jira.js
Generate hyperlinks for Jira, Gitlab, ServiceNow or drupal.org and copy to clipboard
@vbrozik
vbrozik / .cspell.json
Last active June 15, 2023 12:03
Python - my commonly used libraries
{
"ignoreWords": ["appdirs"]
}
@vbrozik
vbrozik / README.md
Last active June 30, 2023 18:04
Git - useful commands

Git - useful commands

git diff

# 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
@vbrozik
vbrozik / README.md
Last active June 25, 2023 09:16
Windows 11 customizations

Windows 11 Customizations

GUI

# Nastavení taskbar etc.
Get-Item -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'

Networking

@vbrozik
vbrozik / RADME.md
Last active June 25, 2023 20:45
Bash - customizations

Bash - customizations

Command history

Settings in .bashrc:

# separate history files
HISTFILE=$HOME/.history/$(date +%y%m%d.%H%M%S).$USER.$TERM.$SSH_PORT.$$