Skip to content

Instantly share code, notes, and snippets.

View gitpushforcemain's full-sized avatar

gitpushforcemain

  • London, UK
View GitHub Profile
@gitpushforcemain
gitpushforcemain / Makefile
Created November 12, 2021 19:54
Basic Makefile for Golang project
.DEFAULT_GOAL = build
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: lint
lint: fmt
golint ./...
@gitpushforcemain
gitpushforcemain / gpg-key-import-export.md
Last active April 24, 2020 17:31
GPG key import/export

As the original user, use the following command to export all public keys to a base64-encoded text file:

gpg -a --export > mypubkeys.asc

Use the following command to export all encrypted private keys (which will also include corresponding public keys) to a text file:

gpg -a --export-secret-keys > myprivatekeys.asc

Keybase proof

I hereby claim:

  • I am ifqthenp on github.
  • I am andreibogomja (https://keybase.io/andreibogomja) on keybase.
  • I have a public key ASCanwWhzmde5z0vEYcOUvYhW8Cmr3QzYjAwTO3MC-BC7Ao

To claim this, I am signing this object:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
</web-app>
@gitpushforcemain
gitpushforcemain / mount_samba_local_synology_nas.md
Created May 1, 2018 11:05
Mount samba share on local Synology NAS

Mount samba share on local Synology NAS

To mount type

# mount -t cifs -o username=username,password=password //syndev.local/Tutorials /media/syndev

To unmount

@gitpushforcemain
gitpushforcemain / zero_pad_filenames.md
Created April 30, 2018 21:34
Bash script to zero pad numbers in file or folder names

Bash script to zero pad numbers in file or folder names

This one will add five zeros anywhere in the file name containing foo

rename 's/\d+/sprintf("%05d",$&)/e' foo*

This one will add two leading zeros in any file or folder name in the current directory

@gitpushforcemain
gitpushforcemain / startup_script.sh
Created March 21, 2018 08:47
GCP startup script for Otus DevOps HW 5
#!/usr/bin/env bash
# update system packages
sudo apt update
sudo apt upgrade -y
# install Ruby
sudo apt install -y ruby-full ruby-bundler build-essential
sudo gem install bundler
@gitpushforcemain
gitpushforcemain / gitconfig
Created January 5, 2017 21:30
A simple alias that takes an argument and lists out any matching global and local settings prefixed by an appropriate header for each section
[alias]
scopelist = "! f() { echo '[global settings]'; git config --global --get-regexp $1; echo '[local settings]'; git config --local --get-regexp $1; }; f"
@gitpushforcemain
gitpushforcemain / .gitattributes
Created December 25, 2016 15:37
.gitattributes template with Windows EOL for bat file
gradlew.bat eol=crlf
@gitpushforcemain
gitpushforcemain / .gitignore
Created December 25, 2016 15:33
.gitignore with Gradle and Idea templates
### Gradle template
.gradle
build/
gradle-app.setting
!gradle/wrapper/gradle-wrapper.jar
.gradletasknamecache
### Idea template
out/
.idea/