Skip to content

Instantly share code, notes, and snippets.

@x3rAx
x3rAx / Generate_ssh_key-pair_for_Bamboo_(when_Bamboo_uses_a_stupid_Java_implementation_of_git).md
Last active April 23, 2024 02:14
Generate ssh key-pair for Bamboo (when Bamboo uses a stupid Java implementation of git)

The Problem

Bamboo (at least the instance I have to work with) is using a Java implementation of git (JGit) that has problems reading the new SSH key-file format.

In earlier versions, ssh-keygen generated private keys that looked like:

-----BEGIN RSA PRIVATE KEY-----
...

-----END RSA PRIVATE KEY-----

# Maintainer: Alexey Stukalov <[email protected]>
# Contributor: Muflone http://www.muflone.com/contacts/english/
pkgname=smartgit
pkgver=19.1.0
pkgrel=1
pkgdesc='Git client with Hg and SVN support.'
arch=('any')
url="http://www.syntevo.com/smartgit"
license=('custom')
@x3rAx
x3rAx / docker-compose-up-fix.sh
Last active December 2, 2019 12:11
Transparently change default behavior of `docker-compose up` to be detached
# DISCLAIMER
#
# I do not take any responsibility and I'm not liable for any damage caused
# through the usage of this script.
#
# I have tested every case I can think of and I'm pretty confident, that there
# are no major errors in this script but future versions of `docker-compose`
# might introduce changes that interfere with this wrapper.
#
# ==> Use at your own risk! <==
@x3rAx
x3rAx / fix-permissions.sh
Created September 27, 2019 12:43
Shell script to easily fix permissions recursively on files and directories (Set user / group / file mode / dir mode)
#!/usr/bin/env bash
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# MIT License
#
# Copyright (c) 2019 Björn Richter
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@x3rAx
x3rAx / trim-string.sh
Created January 30, 2020 10:32
Trim whitespaces from a string with pure bash
trim_l() {
local str="$1"
if [[ $str =~ ^[[:space:]]*(|[^[:space:]].*)$ ]]; then
str="${BASH_REMATCH[1]}"
fi
echo "$str"
}
trim_r() {
local str="$1"
@x3rAx
x3rAx / # n-install #.md
Last active August 4, 2022 07:50
n-install

Install n the node package manager

Prerequisites

The following tools must be installed

  • git
  • curl
@x3rAx
x3rAx / # SSH-Agent.md
Last active April 27, 2024 12:47
SSH Agent

Note:

Replace @ with / in filenames.

Set up your .bashrc to use .shellrc.d.

Make sure ssh-agent, ps and awk are installed and that $USER is set to your username.

@x3rAx
x3rAx / vscode-keybindings-cheat-sheet.md
Last active March 23, 2020 08:39
My VSCode Keybindings Cheat Sheet

My VSCode Keybindings Cheat Sheet

Multi Cursor

  • ctrl + alt + j - Add cursor below
  • ctrl + alt + k - Add cursor above
@x3rAx
x3rAx / # Shellrc.d #.md
Last active April 27, 2024 12:47
Setup instructions for `~/.shellrc.d/`

Shellrc.d

Setup

Create the directory ~/.shellrc.d

mkdir ~/.shellrc.d

@x3rAx
x3rAx / # Rust Notes #.md
Last active May 18, 2020 18:43
Rust Notes

Safe conversion from u32 to i32:

use std::convert::TryFrom;

fn main() {
    let good: u32 = 50;
    let ok: i32 = i32::try_from(good).unwrap();
    println!("{} -> {}", good, ok);