Skip to content

Instantly share code, notes, and snippets.

View cristiarg's full-sized avatar
🙃

Cristian Arghiroiu cristiarg

🙃
View GitHub Profile
@cristiarg
cristiarg / passwordless_ssh.sh
Last active February 23, 2021 19:10
passwordless ssh login into remote server
# either use existing authentication keys, check with:
ll ~/.ssh/id_*
# if none exist that can be reused,
# or generate a new key with
ssh-keygen -t rsa
# which will automatically generate private/public keys as ~/.ss/id_*[.pub]
# check again with
ll ~/.ssh/id_*
# copy the public key to the remote server with; by default, this will copy the most recent
# key to the remote server, if that is not the case, use the '-i' option
@cristiarg
cristiarg / configure-multiple-gcc.sh
Last active January 29, 2021 11:05
Configure multiple GCC versions on Ubuntu
#!/usr/bin/env bash
#sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
#sudo apt update
# find out what points to what
# an indirect way of finding out if alternatives are currently involved
update-alternatives --display gcc
update-alternatives --display g++
update-alternatives --display cc
git config --global alias.co 'checkout'
git config --global alias.br 'branch'
git config --global alias.ci 'commit'
git config --global alias.st 'status'
git config --global alias.uns 'reset HEAD --'
git config --global alias.fe 'fetch'
git config --global alias.last 'log -3 HEAD'
git config --global alias.lga 'log --graph --all --name-status'
git config --global alias.lg 'log --graph'
git config --global alias.alias "! git config --get-regexp ^alias\. | sed -e s/^alias\.// -e s/\ /\ =\ /"
@cristiarg
cristiarg / csql.sh
Last active May 5, 2021 11:09
Cubrid CSQL client utility bash autocompletion script
#
# Cubrid CSQL client utility bash autocompletion script
# Usage:
# - copy/rename as '/etc/bash_completion_d/csql' and it should be picked up by bash
__csql()
{
local curr prev opts_utilities_all
COMPREPLY=()
curr="${COMP_WORDS[COMP_CWORD]}"
@cristiarg
cristiarg / cubrid.sh
Last active May 5, 2021 11:09
Cubrid DBMS administration console bash autocompletion script
#
# Cubrid DBMS administration console bash autocompletion script
# Usage:
# - copy/rename as '/etc/bash_completion_d/cubrid' and it should be picked up by bash
#
# Capabilities/Limitations:
# - service and administrator utilities are hardcoded
# - service utilities 'server' and 'heartbeat' have limited support for listing databases from the
# $CUBRID_DATABASES/databases.txt file
# - administrator utilities' options are extracted by parsing that utility's usage/help output so,