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 / export_mysql_table_to_tsv.sh
Last active October 30, 2018 15:23
Export table from MySQL database to Tab-separated value (TSV) file (bash/sh one-liner)
#!/usr/bin/env bash
DB_HOST=localhost
DB_NAME=database
DB_USER=user
DB_PASSWORD=p@ssw0rd
DB_TABLE=some_table
mysql --host=$DB_HOST --user=$DB_USER --password=$DB_PASSWORD --execute="select * from $DB_NAME.$DB_TABLE;" > sql_dump_$DB_NAME_$DB_TABLE.tsv
exit
@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active October 30, 2025 15:29
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@F21
F21 / signing-gpg-keys.md
Last active October 13, 2025 14:52
Signing someone's GPG key

This is a quick guide of the commands we use to sign someone's GPG key in a virtual key signing party.

Note: The steps cover only the technical aspects of signing someone's key. Before signing someone's key, you must verify their identity. This is usually done by showing government-issued ID and confirming the key's fingerprint

The commands will work for both GPG and GPG2.

I use Julian's key for the examples. His key id is 2AD3FAE3. You should substitute with the appropriate key id when running the commands.

Signing the key

  1. List the keys currently in your keyring: gpg --list-keys.
@bobpaul
bobpaul / gnu_getopt_example.sh
Created March 20, 2018 18:24
An example showing how to use getopt
#!/usr/bin/env bash
# Time-stamp: <2017-04-27 09:57:21 kmodi>
# Time-stamp: <2018-03-20 12:58:02 bobpaul>
# derived from kmodi's gist: https://gist.github.com/kaushalmodi/74e9875d5ab0a2bc1010447f1bee5d0a
#
# Example of using getopt to parse command line options
# http://stackoverflow.com/a/29754866/1219634 Limitation: All the options
# starting with - have to be listed in --options/--longoptions, else getopt will
# error out.
# The downside is that if you intend to use this as a wrapper to some other program,
@ggarcia24
ggarcia24 / pipeline.gdsl
Last active June 23, 2025 07:55
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
@zuyu
zuyu / ubuntu-install-gcc-6
Last active July 27, 2025 22:25
Install gcc 6 on Ubuntu
sudo apt update && \
sudo apt install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt update && \
sudo apt install gcc-6 g++-6 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \
gcc -v
@turboBasic
turboBasic / berkoMap.geojson
Created January 6, 2018 12:00
Map of features of Berkovets residential area, #kyiv, #ukraine
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@turboBasic
turboBasic / routes2bb.md
Last active January 6, 2018 12:28
Routes to BeBee

Расположение

Общество садоводов "Судостроитель"

  • Карта расположения въезда в ОС "Судостроитель": https://is.gd/utakub

Схемы проезда

@turboBasic
turboBasic / Get-GistFiles.ps1
Last active December 23, 2017 06:46
[Get-GistFiles.ps1] Gets list of files inside the GitHub gists of a user. #powershell #github
#Requires -Version 3
#Requires -Modules Posh-Gist
function Get-GistFiles {
<#
.SYNOPSIS
Gets list of files inside the GitHub gists of a user
.DESCRIPTION
Gets list of files inside the GitHub gists of a user. GitHub API is not very convenient
#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \