Skip to content

Instantly share code, notes, and snippets.

View turboBasic's full-sized avatar
🔮
Focusing

andriy melnyk turboBasic

🔮
Focusing
View GitHub Profile
@turboBasic
turboBasic / .zshrc
Last active May 6, 2023 03:05
Zshrc file for zdharma-continuum/zinit framework #zsh #zinit #dotfiles
## Global vars
export LESS='--buffers=128 --HILITE-UNREAD --ignore-case --LONG-PROMPT --max-back-scroll=15 --no-init --quiet --quit-at-eof --quit-if-one-screen --RAW-CONTROL-CHARS --status-column --tabs=4 --window=-4'
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"'
export FZF_DEFAULT_OPTS='--height 50% --ansi --info=inline'
export EDITOR='/usr/local/bin/nvim'
## zinit
source ~/.zinit/bin/zinit.zsh
@turboBasic
turboBasic / #ansi 256 colors chart.md
Last active February 21, 2021 08:50
Ansi 256 colors chart #pocket #ansi #color
@turboBasic
turboBasic / systemd-journalctl-cheatsheet.md
Last active January 30, 2021 23:27
systemd journalctl cheatsheet #systemd #journalctl #linux

systemd journalctl cheatsheet / tldr

@turboBasic
turboBasic / backup-all-gpg-keys.md
Last active February 18, 2021 02:15
Backup all secret and public keys from GnuPG keyring #gpg

Backup private & public GnuPG keys

Backup

KEY_ID='i@example.com'

cat <<EOF >"${KEY_ID}...pub+sec.asc" \ 
@turboBasic
turboBasic / new-github-repo.sh
Last active January 4, 2021 13:38
create Github repo from command line using Github REST API with correct escaping #shell #git #github
#!/bin/sh
# Create repository in Github with correct escaping in repo name
# Requires {@code GITHUB_TOKEN} env var.
# @return ssh url to created repository which can be used in git clone command
jq --null-input --compact-output \
--arg repo 'my-awesome-project' \
'{name: $repo}' \
| curl \
@turboBasic
turboBasic / groovySplitVsTokenize.groovy
Last active November 28, 2020 07:55
Groovy String split() vs tokenize() #groovy
final List TestCases = [
'/usr/bin/sh',
'//usr/bin/sh',
'usr//bin/sh',
'usr//bin//sh///',
'//',
'/',
' / ',
' // ',
' ',
@turboBasic
turboBasic / create-config-provider-object.md
Last active September 21, 2020 23:07
Create config provider object on master using Job DSL script #jenkins #job-dsl

Create config-provider object using Job DSL

configFiles {
    propertiesConfig {
        id 'conf-0100-properties'
        name 'created-by-dsl-properties'
        content '''
 GIT.COMMITTER_NAME = name
@turboBasic
turboBasic / executeInBash.groovy
Last active September 12, 2021 07:44
Execute complex bash command in Jenkins script console #jenkins #groovy #shell
String DIR = '/data/jenkins/workspace/UISW-C-UI/Daily/c-daily-build'
void executeInBash(String bashCommand) {
java.lang.Process process = ['/bin/bash', '-c', bashCommand].execute()
process.waitFor()
println process.getText()
}
//////
@turboBasic
turboBasic / Jenkinsfile.groovy
Last active August 7, 2020 13:32 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes #jenkins #groovy #shell
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER'
// 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"'
// 1
@turboBasic
turboBasic / firefox-places-query.md
Last active November 8, 2021 06:56
Firefox bookmarks with queries to Places db #firefox

Firefox Places database queries

Summary

  • For bookmark queries term is searched within bookmark names and tags. Title is returned if it contains term, tag is returned if only it matches term completely.